diff --git a/.build/images/Quartz64/quartz64_defconfig b/.build/images/Quartz64/quartz64_defconfig index 3a496f93d6..64a28852d8 100644 --- a/.build/images/Quartz64/quartz64_defconfig +++ b/.build/images/Quartz64/quartz64_defconfig @@ -247,6 +247,7 @@ CONFIG_HID_MICROSOFT=m CONFIG_HID_MONTEREY=m CONFIG_HID_MULTITOUCH=y CONFIG_HID_REDRAGON=m +CONFIG_HIDRAW=y CONFIG_HIGH_RES_TIMERS=y # CONFIG_HISILICON_ERRATUM_161010101 is not set CONFIG_HOTPLUG_PCI=y @@ -1011,6 +1012,7 @@ CONFIG_USB_EHCI_HCD_PLATFORM=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_GADGET=y CONFIG_USB_GSPCA=m +CONFIG_USB_HIDDEV=y CONFIG_USB_LAN78XX=m CONFIG_USB_LEDS_TRIGGER_USBPORT=y CONFIG_USB_LED_TRIG=y diff --git a/.build/images/U-Boot/boot.cmd b/.build/images/U-Boot/boot.cmd index 9c6d5b776f..5dfbb64fc3 100644 --- a/.build/images/U-Boot/boot.cmd +++ b/.build/images/U-Boot/boot.cmd @@ -20,8 +20,8 @@ setenv fdt_addr_r "0x4080000" setenv overlay_error "false" # Load environment file -if load ${devtype} ${devnum} ${scriptaddr} ${prefix}dietpiEnv.txt; then - env import -t ${scriptaddr} ${filesize} +if load "${devtype}" "${devnum}" "${scriptaddr}" "${prefix}dietpiEnv.txt"; then + env import -t "${scriptaddr}" "${filesize}" fi # Define kernel command-line arguments @@ -31,44 +31,44 @@ setenv bootargs "root=${rootdev} rootfstype=${rootfstype} rootwait ${consoleargs if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=memory swapaccount=1"; fi # Load kernel, initramfs and device tree -load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image -load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd -load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile} -fdt addr ${fdt_addr_r} +load "${devtype}" "${devnum}" "${kernel_addr_r}" "${prefix}Image" +load "${devtype}" "${devnum}" "${ramdisk_addr_r}" "${prefix}uInitrd" +load "${devtype}" "${devnum}" "${fdt_addr_r}" "${prefix}dtb/${fdtfile}" +fdt addr "${fdt_addr_r}" # Apply DT overlays if test -n "${overlays}${user_overlays}"; then fdt resize 65536 for overlay in ${overlays}; do - if load ${devtype} ${devnum} ${scriptaddr} ${prefix}dtb/${overlay_path}/overlay/${overlay_prefix}-${overlay}.dtbo; then + if load "${devtype}" "${devnum}" "${scriptaddr}" "${prefix}dtb/${overlay_path}/overlay/${overlay_prefix}-${overlay}.dtbo"; then echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay}.dtbo" - fdt apply ${scriptaddr} || setenv overlay_error "true" + fdt apply "${scriptaddr}" || setenv overlay_error "true" fi done for overlay in ${user_overlays}; do - if load ${devtype} ${devnum} ${scriptaddr} ${prefix}overlay-user/${overlay}.dtbo; then + if load "${devtype}" "${devnum}" "${scriptaddr}" "${prefix}overlay-user/${overlay}.dtbo"; then echo "Applying user provided DT overlay ${overlay}.dtbo" - fdt apply ${scriptaddr} || setenv overlay_error "true" + fdt apply "${scriptaddr}" || setenv overlay_error "true" fi done if test "${overlay_error}" = "true"; then echo "Error applying DT overlays, restoring original DT" - load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile} + load "${devtype}" "${devnum}" "${fdt_addr_r}" "${prefix}dtb/${fdtfile}" else - if load ${devtype} ${devnum} ${scriptaddr} ${prefix}dtb/${overlay_path}/overlay/${overlay_prefix}-fixup.scr; then + if load "${devtype}" "${devnum}" "${scriptaddr}" "${prefix}dtb/${overlay_path}/overlay/${overlay_prefix}-fixup.scr"; then echo "Applying kernel provided DT fixup script ${overlay_prefix}-fixup.scr" - source ${scriptaddr} + source "${scriptaddr}" fi - if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then - if load ${devtype} ${devnum} ${scriptaddr} ${prefix}fixup.scr; then + if test -e "${devtype}" "${devnum}" "${prefix}fixup.scr"; then + if load "${devtype}" "${devnum}" "${scriptaddr}" "${prefix}fixup.scr"; then echo "Applying user provided DT fixup script fixup.scr" - source ${scriptaddr} + source "${scriptaddr}" fi fi fi fi # Boot -booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r} +booti "${kernel_addr_r}" "${ramdisk_addr_r}" "${fdt_addr_r}" diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index 6d72660f85..5679df1b30 100755 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -573,15 +573,15 @@ _EOF_ # Rename if source image != output image yet [[ $(readlink -f "$PWD/$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT") != "$(readlink -f "$FP_SOURCE_IMG")" ]] && G_EXEC mv "$FP_SOURCE_IMG" "$OUTPUT_IMG_NAME.$OUTPUT_IMG_EXT" - # Check for sufficient free disk space to store the 7z archive with 100 MiB buffer + # Check for sufficient free disk space to store the xz archive with 100 MiB buffer (( $SKIP_ARCHIVE )) || G_CHECK_FREESPACE . $(( $IMAGE_SIZE * 15/100 / 1024**2 + 100 )) || exit 1 # Drive source and dd target elif [[ $CLONING_TOOL == 'dd' ]] then - # Check for sufficient free disk space to store the image and in case the 7z archive with 100 MiB buffer + # Check for sufficient free disk space to store the image and in case the xz archive with 100 MiB buffer local free_space_percent=100 - (( $SKIP_ARCHIVE )) || free_space_percent=115 # 15% image size for 7z archive + (( $SKIP_ARCHIVE )) || free_space_percent=115 # 15% image size for xz archive G_CHECK_FREESPACE . $(( $IMAGE_SIZE * $free_space_percent/100 / 1024**2 + 100 )) || exit 1 G_DIETPI-NOTIFY 2 "Creating final image with actually used size: $(( $IMAGE_SIZE / 1024**2 + 1 )) MiB" diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index c105b495c1..3b9b04054b 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -572,6 +572,9 @@ _EOF_ # Boot in 64-bit mode if this is a 64-bit image [[ $G_HW_ARCH == 3 ]] && G_CONFIG_INJECT 'arm_64bit=' 'arm_64bit=1' /boot/config.txt + # Temporary workaround for conflicting rpi-eeprom package + (( $DISTRO_TARGET > 6 )) && ! grep -q 'https://dietpi.com/downloads/binaries/rpi/rpi-eeprom.deb' "DietPi-$G_GITBRANCH/dietpi/func/dietpi-set_hardware" && G_EXEC sed -i 's|G_AG_CHECK_INSTALL_PREREQ rpi-eeprom|G_EXEC_OUTPUT=1 G_EXEC curl -fO https://dietpi.com/downloads/binaries/rpi/rpi-eeprom.deb; G_AGI ./rpi-eeprom.deb; G_EXEC rm rpi-eeprom.deb; G_EXEC apt-mark hold rpi-eeprom|' "DietPi-$G_GITBRANCH/dietpi/func/dietpi-set_hardware" + elif [[ $G_HW_MODEL =~ ^(10|11)$ ]] then armbian_repo=1 @@ -902,12 +905,12 @@ _EOF_ ) # Skip entropy daemon on all devices but those with old kernel - if [[ ! $G_HW_MODEL =~ ^(11|61|62|70)$ ]] # Odroid XU4, NanoPi M2/T2/Fire2, NanoPi M3/T3/Fire3, Sparky SBC + if [[ ! $G_HW_MODEL =~ ^(61|62|70)$ ]] # NanoPi M2/T2/Fire2, NanoPi M3/T3/Fire3, Sparky SBC 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|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 + 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 @@ -1248,6 +1251,20 @@ _EOF_ G_EXEC sed -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/extlinux/extlinux.conf aPACKAGES_REQUIRED_INSTALL+=('libubootenv-tool') + # Star64 + elif (( $G_HW_MODEL == 84 )) + then + G_EXEC curl -sSfo package.deb 'https://dietpi.com/downloads/binaries/linux-image-star64.deb' + dpkg-deb -I linux-image-star64.deb conffiles | while read -r line + do + [[ -f $line ]] && G_EXEC rm "$line" + done + G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb + G_EXEC rm package.deb + G_EXEC sed -i "s/root=[^[:blank:]]*/root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /)/" /boot/extlinux/extlinux.conf + G_EXEC sed -i "s/rootfstype=[^[:blank:]]*/rootfstype=$(findmnt -Ufnro FSTYPE -M /)/" /boot/extlinux/extlinux.conf + aPACKAGES_REQUIRED_INSTALL+=('libubootenv-tool') + # Orange Pi Zero 3 elif (( $G_HW_MODEL == 83 )) then @@ -1269,6 +1286,21 @@ _EOF_ # shellcheck disable=SC2154 write_uboot_platform "$DIR" "$BOOT_DEVICE" + # Apply device tree adjustment for Ethernet adapter + # shellcheck disable=SC2016 + sed -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 @@ -1525,6 +1557,7 @@ _EOF_ getent passwd fa > /dev/null && userdel -f fa # OMV (NanoPi NEO2) getent passwd colord > /dev/null && userdel -f colord # OMV (NanoPi NEO2) getent passwd saned > /dev/null && userdel -f saned # OMV (NanoPi NEO2) + getent passwd orangepi > /dev/null && userdel -f saned # Orange Pi images getent group openmediavault-config > /dev/null && groupdel openmediavault-config # OMV (NanoPi NEO2) getent group openmediavault-engined > /dev/null && groupdel openmediavault-engined # OMV (NanoPi NEO2) getent group openmediavault-webgui > /dev/null && groupdel openmediavault-webgui # OMV (NanoPi NEO2) @@ -1538,7 +1571,7 @@ _EOF_ G_DIETPI-NOTIFY 2 'Removing misc files/folders/services, not required by DietPi' [[ -f '/boot/boot.bmp' ]] && G_EXEC rm /boot/boot.bmp - [[ -f '/boot/logo.bmp' ]] && G_EXEC rm /boot/logo.bmp + [[ -f '/boot/logo.bmp' ]] && G_EXEC rm /boot/logo.bmp # Orange Pi images [[ -d '/selinux' ]] && G_EXEC rm -R /selinux [[ -d '/var/cache/apparmor' ]] && G_EXEC rm -R /var/cache/apparmor [[ -d '/var/lib/udisks2' ]] && G_EXEC rm -R /var/lib/udisks2 @@ -1675,6 +1708,7 @@ _EOF_ [[ -f '/etc/init.d/resize2fs_once' ]] && G_EXEC rm /etc/init.d/resize2fs_once # https://github.com/RPi-Distro/pi-gen/blob/master/stage2/01-sys-tweaks/files/resize2fs_once # - Remove all autologin configs for all TTYs: https://github.com/MichaIng/DietPi/issues/3570#issuecomment-648988475, https://github.com/MichaIng/DietPi/issues/3628#issuecomment-653693758 G_EXEC rm -f /etc/systemd/system/*getty@*.service.d/*autologin*.conf + G_EXEC rm -f /lib/systemd/system/*getty@*.service.d/override.conf # Orange Pi images # - make_nas_processes_faster cron job on ROCK64 + NanoPi + PINE A64(?) images [[ -f '/etc/cron.d/make_nas_processes_faster' ]] && G_EXEC rm /etc/cron.d/make_nas_processes_faster diff --git a/.conf/dps_114/lighttpd.nextcloud.conf b/.conf/dps_114/lighttpd.nextcloud.conf index 95c06bd7fd..0b908919b7 100644 --- a/.conf/dps_114/lighttpd.nextcloud.conf +++ b/.conf/dps_114/lighttpd.nextcloud.conf @@ -31,4 +31,14 @@ $HTTP["url"] =~ "^/nextcloud($|/)" { ) } + # Rewrites + url.rewrite-once += ( + "^/nextcloud/remote/(.*)" => "/nextcloud/remote.php/$1", + "^/nextcloud/ocm-provider($|/\?.*)" => "/nextcloud/index.php$1" + ) + url.rewrite-if-not-file += ( + "^/nextcloud/((core/ajax/update|cron|public|remote|status|ocs/v[12])\.php|ocs-provider/|updater/)" => "", + "^/nextcloud(.*)" => "/nextcloud/index.php$1" + ) + } diff --git a/.github/workflows/armbian.yml b/.github/workflows/armbian.yml new file mode 100644 index 0000000000..4fdb12c767 --- /dev/null +++ b/.github/workflows/armbian.yml @@ -0,0 +1,71 @@ +name: Armbian +on: + workflow_dispatch: + inputs: + asset: + description: 'Asset' + type: choice + options: [kernel, uboot, firmware] + default: kernel + required: true + branch: + description: 'Branch' + type: choice + options: [legacy, current, edge] + default: current + required: true + board: + description: 'Board' + required: true + gitowner: + description: 'Override Git owner of Armbian repo' + gitbranch: + description: 'Override Git branch of Armbian repo' +concurrency: + group: ${{ github.workflow }}-${{ github.event.inputs.asset }}-${{ github.event.inputs.branch }}-${{ github.event.inputs.board }} + cancel-in-progress: true +permissions: {} +defaults: + run: + shell: sh +jobs: + build: + name: "${{ github.event.inputs.asset }} - ${{ github.event.inputs.branch }} - ${{ github.event.inputs.board }}" + runs-on: ubuntu-22.04 + steps: + - name: Clone Armbian repo + run: | + owner='${{ github.event.inputs.gitowner }}' + [ "$owner" ] || owner='armbian' + branch='${{ github.event.inputs.gitbranch }}' + [ "$branch" ] || branch='main' + git clone -b "$branch" --depth=1 "https://github.com/$owner/build" + - name: Build asset + run: | + cd build + ./compile.sh '${{ github.event.inputs.asset }}' BRANCH='${{ github.event.inputs.branch }}' BOARD='${{ github.event.inputs.board }}' + - 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 + + # Generate file lists + files= + urls='"https://dietpi.com/downloads/binaries/testing/"' + cd build/output/debs + for i in * + do + mv -v "$i" "${i%%_*}.deb" + i="${i%%_*}.deb" + files="$files,$i" + urls="$urls,\"https://dietpi.com/downloads/binaries/testing/$i\"" + done + files=${files#,} + echo "Uploading file(s) $files to URL(s) $urls ..." + + # Upload + curl -T "{$files}" --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\":[$urls]}" diff --git a/.meta/dietpi-bookworm-upgrade b/.meta/dietpi-bookworm-upgrade index 03782b09e0..736a62ec0b 100755 --- a/.meta/dietpi-bookworm-upgrade +++ b/.meta/dietpi-bookworm-upgrade @@ -66,6 +66,15 @@ G_DIETPI-NOTIFY 2 'Reverting some package lists to Bullseye which have no Bookwo [[ -f '/etc/apt/sources.list.d/influxdb.list' ]] && G_EXEC sed -i 's/bookworm/bullseye/' /etc/apt/sources.list.d/influxdb.list [[ -f '/etc/apt/sources.list.d/mopidy.list' ]] && G_EXEC sed -i 's/bookworm/bullseye/' /etc/apt/sources.list.d/mopidy.list +if (( $G_HW_MODEL == 4 )) && dpkg-query -s rpi-eeprom &> /dev/null +then + G_DIETPI-NOTIFY 2 'Setting rpi-eeprom package on hold to prevent conflicting upgrade attempt' + G_EXEC_OUTPUT=1 G_EXEC curl -fO 'https://dietpi.com/downloads/binaries/rpi/rpi-eeprom.deb' + G_EXEC dpkg -i --force-confdef,confold ./rpi-eeprom.deb + G_EXEC rm rpi-eeprom.deb + G_EXEC apt-mark hold rpi-eeprom +fi + G_DIETPI-NOTIFY 2 'Applying the actual upgrade to Debian Bookworm' /boot/dietpi/dietpi-services stop G_AGUP diff --git a/.update/patches b/.update/patches index 1ecef4ad74..a1ba9b8f93 100755 --- a/.update/patches +++ b/.update/patches @@ -271,10 +271,9 @@ Patch_7_6() fi # https://github.com/jirka-h/haveged/pull/7 https://github.com/MichaIng/DietPi/issues/3689#issuecomment-678322767 - if [[ $G_DISTRO == 5 && $G_HW_ARCH == [23] ]] && { [[ $G_HW_MODEL == 11 ]] || dpkg-query -s haveged &> /dev/null; } + if [[ $G_DISTRO == 5 && $G_HW_ARCH == [23] ]] && dpkg-query -s haveged &> /dev/null then - G_DIETPI-NOTIFY 2 'Upgrading haveged entropy daemon to fix an issue on ARM:' - G_DIETPI-NOTIFY 2 ' - https://github.com/jirka-h/haveged/pull/7' + G_DIETPI-NOTIFY 2 'Upgrading haveged entropy daemon to fix an issue on ARM: https://github.com/jirka-h/haveged/pull/7' G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/libhavege2_$G_HW_ARCH_NAME.deb" G_EXEC curl -sSfLO "https://dietpi.com/downloads/binaries/buster/haveged_$G_HW_ARCH_NAME.deb" G_AGI "./libhavege2_$G_HW_ARCH_NAME.deb" "./haveged_$G_HW_ARCH_NAME.deb" @@ -685,7 +684,7 @@ Patch_8_4() if (( $G_HW_ARCH == 2 )) && dpkg-query -s haveged &> /dev/null then G_DIETPI-NOTIFY 2 'Applying workaround for haveged entropy daemon bug: https://bugs.debian.org/985196' - [[ -d '/etc/systemd/system/haveged.service.d' ]] || G_EXEC mkdir /etc/systemd/system/haveged.service.d + G_EXEC mkdir -p /etc/systemd/system/haveged.service.d G_EXEC eval 'echo -e '\''[Service]\nSystemCallFilter=uname'\'' > /etc/systemd/system/haveged.service.d/dietpi.conf' G_EXEC systemctl daemon-reload G_EXEC systemctl restart haveged @@ -943,12 +942,9 @@ Patch_8_15() { if (( $G_HW_MODEL == 49 )) then - if ! dpkg-query -s 'haveged' &> /dev/null - then - G_DIETPI-NOTIFY 2 'Installing correct entropy daemon on Quartz64' - G_AGI haveged - G_AGP rng-tools5 - fi + G_DIETPI-NOTIFY 2 'Removing obsolete entropy daemon' + G_AGP haveged rng-tools5 + [[ -d '/etc/systemd/system/haveged.service.d' ]] || G_EXEC rm -R /etc/systemd/system/haveged.service.d # Revert with new kernel: https://github.com/MichaIng/DietPi/issues/5890 grep -q ' systemd.unified_cgroup_hierarchy=0' /boot/extlinux/extlinux.conf && G_EXEC sed -i '/^append /s/ systemd.unified_cgroup_hierarchy=0//' /boot/extlinux/extlinux.conf @@ -989,11 +985,11 @@ Patch_8_16() /boot/dietpi/func/dietpi-set_hardware serialconsole disable ttyS2 /boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyFIQ0 fi - if ! dpkg-query -s 'rng-tools5' &> /dev/null + if dpkg-query -s 'haveged' &> /dev/null then - G_DIETPI-NOTIFY 2 'Installing hardware random generator daemon in favour of haveged' - G_AGI rng-tools5 + G_DIETPI-NOTIFY 2 'Removing obsolete entropy daemon' G_AGP haveged + [[ -d '/etc/systemd/system/haveged.service.d' ]] || G_EXEC rm -R /etc/systemd/system/haveged.service.d fi elif (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 5.15.105-dietpi1 @@ -1420,31 +1416,6 @@ Patch_8_23() G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb G_EXEC rm package.deb - # Quartz64 - elif (( $G_HW_MODEL == 49 )) - then - if dpkg --compare-versions "$(dpkg-query -Wf '${Version}' firmware-quartz64a 2> /dev/null)" lt-nl 6.5.8-dietpi1 - then - G_DIETPI-NOTIFY 2 'Updating Quartz64 Model A kernel and bootloader ...' - G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/firmware-quartz64a.deb' - G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb - G_EXEC rm package.deb - - elif dpkg --compare-versions "$(dpkg-query -Wf '${Version}' firmware-quartz64b 2> /dev/null)" lt-nl 6.5.8-dietpi1 - then - G_DIETPI-NOTIFY 2 'Updating Quartz64 Model B kernel and bootloader ...' - G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/firmware-quartz64b.deb' - G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb - G_EXEC rm package.deb - - elif dpkg --compare-versions "$(dpkg-query -Wf '${Version}' firmware-soquartz 2> /dev/null)" lt-nl 6.5.8-dietpi1 - then - G_DIETPI-NOTIFY 2 'Updating SOQuartz kernel and bootloader ...' - G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/firmware-soquartz.deb' - G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb - G_EXEC rm package.deb - fi - # VisionFive 2 elif (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.59-dietpi1 then @@ -1507,8 +1478,21 @@ Patch_8_23() Patch_8_24() { + # Quartz64 + if (( $G_HW_MODEL == 49 )) + then + for i in quartz64{a,b} soquartz + do + dpkg --compare-versions "$(dpkg-query -Wf '${Version}' "firmware-$i" 2> /dev/null)" lt-nl 6.5.11-dietpi2 || continue + G_DIETPI-NOTIFY 2 "Updating $i kernel and bootloader ..." + G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb "https://dietpi.com/downloads/binaries/firmware-$i.deb" + G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb + G_EXEC rm package.deb + break + done + # ROCK 3A: The "rk35xx" kernel packages have been merged into "rockchip64", and "edge-rk35xx" is Linux 6.1.11, older than "current-rockchip64", which is 6.1.50 - if (( $G_HW_MODEL == 77 )) && dpkg-query -s 'linux-image-edge-rk35xx' &> /dev/null + elif (( $G_HW_MODEL == 77 )) && dpkg-query -s 'linux-image-edge-rk35xx' &> /dev/null then G_DIETPI-NOTIFY 2 'Updating ROCK 3A kernel package ...' local apackages=('linux-image-current-rockchip64' 'linux-dtb-current-rockchip64') @@ -1516,6 +1500,14 @@ Patch_8_24() G_AGI "${apackages[@]}" G_EXEC apt-mark auto "${apackages[@]/current-rockchip64/edge-rk35xx}" + # VisionFive 2 + elif (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.62-dietpi1 + then + G_DIETPI-NOTIFY 2 'Updating RISC-V StarFive VisionFive 2 kernel ...' + G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-image-visionfive2.deb' + G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package.deb + G_EXEC rm package.deb + # Orange Pi Zero 3: Pre-v8.24 WiFi config migration elif [[ $G_HW_MODEL == 83 && -f '/etc/modules-load.d/dietpi-enable_wifi.conf' ]] then diff --git a/.update/pre-patches b/.update/pre-patches index b6ce0176cf..2e8174e28e 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -363,6 +363,11 @@ then G_DIETPI-NOTIFY 2 'Purging conflicting kodi-repository-kodi package' G_AGP kodi-repository-kodi fi + if (( $G_HW_MODEL == 4 && $G_DISTRO > 6 )) && dpkg-query -s rpi-eeprom &> /dev/null + then + G_DIETPI-NOTIFY 2 'Setting rpi-eeprom package on hold to prevent conflicting upgrade attempt' + G_EXEC apt-mark hold rpi-eeprom + fi fi exit 0 diff --git a/.update/version b/.update/version index 6ae6985c08..8be7f630f4 100644 --- a/.update/version +++ b/.update/version @@ -3,7 +3,7 @@ # Available DietPi version G_REMOTE_VERSION_CORE=8 G_REMOTE_VERSION_SUB=24 -G_REMOTE_VERSION_RC=0 +G_REMOTE_VERSION_RC=1 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=6 G_MIN_VERSION_SUB=14 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 17258ff016..ddada5475a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -8,15 +8,22 @@ New images: Enhancements: - ROCK 3A | A kernel upgrade from "edge-rk35xx" (Linux 6.1.11) to "current-rockchip64" (Linux 6.1.50 at time of writing) will be applied, which solves e.g. missing 3.5mm audio output. Many thanks to @wahono77 for testing the kernel upgrade: https://github.com/MichaIng/DietPi/issues/6710 +- Quartz64 | Along with the regular kernel upgrade, we added support for no-UI HID devices. Many thanks to @stormwyrm for the request: https://forum.pine64.org/showthread.php?pid=120632 - DietPi-Software | openHAB: The openHAB APT repository will be migrated from testing to stable suite. Previously "testing" was used, as "stable" shipped openHAB 3, which does not support Java 17. In the meantime "stable" ships openHAB 4 as well. Many thanks to @twikedk for bringing this back to our attention: https://github.com/MichaIng/DietPi/issues/6731 +- DietPi-Software | Prometheus Node Exporter: This software option has been enabled for the RISC-V architecture, for which builds are now available via official GitHub releases. Bug fixes: +- Raspberry Pi 4 | Worked around an issue on Bookworm systems, where the upgrade of the rpi-eeprom package pulled an incompatible raspi-firmware package, causing a failure of any APT upgrade. Many thanks to @piyushaswani55 and others for reporting this issue: https://github.com/MichaIng/DietPi/issues/6747 +- Proxmox | Resolved an issue where the QEMU guest agent was not always installed automatically on first boot. +- DietPi-Globals | Resolved a v8.22 regression where the error handler and bug report template contained only the first line of the failed command's output. - DietPi-Software | Resolved and issue where auto setup failed in case of trailing (non-integer) characters behind the "AUTO_SETUP_AUTOMATED=1" dietpi.txt setting. In this case, an automatic login was performed, but dietpi-software ran in interactive mode. It has been align now so that any trailing characters are ignored and either autologin and automated setup happens both or none. Many thanks to @inis17 for reporting a related issue: https://github.com/MichaIng/DietPi/issues/6719 - DietPi-Software | Sonarr: Resolved a DietPi v8.23 regression where the install failed at an URL check for the APT key. Many thanks to @TheGitGuy00 for reporting this issue: https://github.com/MichaIng/DietPi/issues/6699 - DietPi-Software | NFS Server: Resolved a DietPi v8.23 regression where the install failed because of a syntax error. Many thanks to @supertevran for reporting this issue: https://github.com/MichaIng/DietPi/issues/6722 - DietPi-Software | Shairport Sync: Resolved an issue where the install failed because of a missing service user required for the new NQPTP version. Many thanks to @vishnusure for reporting this issue: https://github.com/MichaIng/DietPi/issues/6735 +- DietPi-Software | Nextcloud: Resolved an issue where, with Lighttpd webserver, a warning about missing "ocm-provider" rewrite was shown in some cases. Many thanks to @rubinski for reporting this issue: https://dietpi.com/forum/t/nextcloud-update-error-message-nextcloud-ocm-provider/18266 +- DietPi-Software | NZBGet: Resolved an issue where the log file /var/log/nzbget.log was not created and used as intended, since the service does not have permissions to create it. -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 +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/6760 ----------------------------------------------------------------------------------------------------------- @@ -24,7 +31,7 @@ v8.23 (2023-10-21) Enhancements: -- RPi | On Debian Bookworm and above, the RPi APT repository will be migrated to its new Bookworm suite. This solves issues and should enhance performance with FFmpeg, Kodi and some other A/V software, where we used the Debian packages with less hardware support before. The packages should be upgraded automatically on DietPi update. Please report back if you experience any issues during this process. +- Raspberry Pi | On Debian Bookworm and above, the RPi APT repository will be migrated to its new Bookworm suite. This solves issues and should enhance performance with FFmpeg, Kodi and some other A/V software, where we used the Debian packages with less hardware support before. The packages should be upgraded automatically on DietPi update. Please report back if you experience any issues during this process. - ROCK 5B | Added an option to dietpi-config "Advanced Option" to flash the SPI bootloader, which enables USB and NVMe boot for DietPi images. - ROCK 4 | Added an option to dietpi-config "Advanced Option" to flash the SPI bootloader, which enables USB and in case NVMe boot for DietPi images. Note that not all ROCK 4 models ship with an onboard SPI storage. DietPi-Config will check for it, in case apply a related device tree overlay and suggests a reboot. If after the reboot an SPI device has still not been found, your board seems to have none. Report back if this is definitely wrong. Many thanks to @andreagdipaolo for doing this request: https://github.com/MichaIng/DietPi/issues/6688 - VisionFive 2 | A major kernel upgrade to Linux 6.1 will be applied, including the needed configuration files to read and write the U-Boot environment, and a generic default environment. This allows booting from all filesystems of all partitions of all storage media, including NVMe SSDs, USB, eMMC, SD cards and DHCP/TFTP. This was necessary since the default environment of the latest StarFive U-Boot release does not support booting from any other then FAT filesystems on partition 3 anymore. It is hence necessary to apply our default environment before updating the SPI bootloader. After the DietPi update and a reboot, run "fw_setenv" to do that. Afterwards you can use this command and "fw_printenv" to edit the environment, including the "boot_targets" variable to define boot targets and priorities. Additionally this release will apply device tree overlays to enable 8 GB RAM and A revision Ethernet support. As this is a major change, we recommend a dietpi-backup or even an image backup. We are happy for any feedback: https://github.com/MichaIng/DietPi/issues/6212 diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 7f1804f5ca..38bbc8e5bc 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1088,9 +1088,18 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]] && bluetooth_state=0 bluetooth_state_text='Off' G_WHIP_MENU_ARRAY+=('Bluetooth' ": [$bluetooth_state_text]") - # RPi specific - if (( $G_HW_MODEL < 10 )); then + # Orange Pi Zero 3 specific + if (( $G_HW_MODEL == 83 )) + then + # SPI state + local spi_enabled=$(grep -Ecm1 '^[[:blank:]]*overlays=(.*[[:blank:]])?spi1-cs1-spidev([[:blank:]]|$)' /boot/dietpiEnv.txt) + local spi_text='Off' + (( $spi_enabled )) && spi_text='On' + G_WHIP_MENU_ARRAY+=('SPI state' ": [$spi_text]") + # RPi specific + elif (( $G_HW_MODEL < 10 )) + then # I2C state local rpi_i2c_enabled=$(grep -cm1 '^[[:blank:]]*dtparam=i2c_arm=on' /boot/config.txt) local rpi_i2c_text='Off' @@ -1104,21 +1113,19 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the G_WHIP_MENU_ARRAY+=('I2C frequency' ": [$rpi_i2c_baudrate kHz]") # SPI state - local rpi_spi_enabled=$(grep -cm1 '^[[:blank:]]*dtparam=spi=on' /boot/config.txt) - local rpi_spi_text='Off' - (( $rpi_spi_enabled )) && rpi_spi_text='On' - G_WHIP_MENU_ARRAY+=('SPI state' ": [$rpi_spi_text]") + local spi_enabled=$(grep -cm1 '^[[:blank:]]*dtparam=spi=on' /boot/config.txt) + local spi_text='Off' + (( $spi_enabled )) && spi_text='On' + G_WHIP_MENU_ARRAY+=('SPI state' ": [$spi_text]") # USB boot option: RPi3 only and not required for RPi3+: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md - if [[ $G_HW_MODEL == 3 && $G_HW_MODEL_NAME != *'+'* ]]; then - + if [[ $G_HW_MODEL == 3 && $G_HW_MODEL_NAME != *'+'* ]] + then local rpi3_usb_boot_bit_enabled=$(vcgencmd otp_dump | grep -cm1 '17:3020000a') local rpi3_usb_boot_bit_text='Off' (( $rpi3_usb_boot_bit_enabled )) && rpi3_usb_boot_bit_text='On' G_WHIP_MENU_ARRAY+=('USB boot support' ": [$rpi3_usb_boot_bit_text]") - fi - fi G_WHIP_MENU 'Please select an option:' || { Back_or_Exit 0; return 0; } # Main menu @@ -1275,7 +1282,7 @@ Latest release notes: https://github.com/starfive-tech/VisionFive2/releases elif [[ $G_WHIP_RETURNED_VALUE == 'SPI state' ]]; then - /boot/dietpi/func/dietpi-set_hardware spi $(( ! $rpi_spi_enabled )) && REBOOT_REQUIRED=1 + /boot/dietpi/func/dietpi-set_hardware spi $(( ! $spi_enabled )) && REBOOT_REQUIRED=1 elif [[ $G_WHIP_RETURNED_VALUE == 'Serial/UART' ]]; then diff --git a/dietpi/dietpi-ddns b/dietpi/dietpi-ddns index 6b9d463d31..2b33e6bfd7 100755 --- a/dietpi/dietpi-ddns +++ b/dietpi/dietpi-ddns @@ -345,14 +345,14 @@ Menu_Username() # Add note for custom provider local text="Please enter the $username to update your dynamic IP against your DDNS provider.\n - The colon character : is currently not supported!" - [[ $PROVIDER == 'No-IP' || $PROVIDER == 'OVH' ]] || text+='\nThis is used for HTTP authentication. If no HTTP authentication is required, type in a \"0\" to skip the username.' + [[ $PROVIDER == 'No-IP' || $PROVIDER == 'OVH' || $PROVIDER == 'YDNS' ]] || text+='\nThis is used for HTTP authentication. If no HTTP authentication is required, type in a \"0\" to skip the username.' G_WHIP_DEFAULT_ITEM=$USERNAME G_WHIP_INPUTBOX "$text" || return 1 USERNAME=$G_WHIP_RETURNED_VALUE # Unset with custom provider when "0" is given - [[ $PROVIDER == 'No-IP' || $PROVIDER == 'OVH' || $USERNAME != 0 ]] || unset -v USERNAME + [[ $PROVIDER == 'No-IP' || $PROVIDER == 'OVH' || $PROVIDER == 'YDNS' || $USERNAME != 0 ]] || unset -v USERNAME } Menu_Password() diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index fa97e9d8c8..aec1c8659e 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -422,7 +422,7 @@ Available commands: aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/media/#plex-media-server' # - ARMv6: https://github.com/MichaIng/DietPi/issues/648 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 - # - RISC-V: No package + # - RISC-V: No package: https://www.plex.tv/media-server-downloads/?cat=computer&plat=linux#plex-media-server aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 #------------------ software_id=43 @@ -559,8 +559,6 @@ Available commands: aSOFTWARE_DEPS[$software_id]='162' # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 - # - RISC-V: Missing Docker package: https://download.docker.com/linux/debian/dists/ - aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 #------------------ software_id=178 aSOFTWARE_NAME[$software_id]='Jellyfin' @@ -809,7 +807,7 @@ Available commands: aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/cloud/#urbackup' # - ARMv6 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 - # - RISC-V: Missing package + # - RISC-V: Missing package: https://www.urbackup.org/download.html#server_debian aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 #------------------ software_id=49 @@ -1148,7 +1146,7 @@ Available commands: aSOFTWARE_CATX[$software_id]=8 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/programming/#docker-compose' aSOFTWARE_DEPS[$software_id]='162' - # - RISC-V: Missing Docker package: https://download.docker.com/linux/debian/dists/ + # - RISC-V: Missing package: https://download.docker.com/linux/debian/dists/ aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 #------------------ software_id=193 @@ -1178,8 +1176,6 @@ Available commands: aSOFTWARE_DESC[$software_id]='Prometheus exporter for hardware and OS metrics' aSOFTWARE_CATX[$software_id]=8 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/system_stats/#prometheus_node_exporter' - # - RISC-V: Missing archive: https://github.com/prometheus/node_exporter/releases - aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 #------------------ software_id=205 aSOFTWARE_NAME[$software_id]='Homer' @@ -3262,7 +3258,7 @@ _EOF_ if To_Install 30 # NoMachine then - local version='8.6.1_3' # https://downloads.nomachine.com/ + local version='8.10.1_1' # https://downloads.nomachine.com/ case $G_HW_ARCH in 1) local url="Raspberry/nomachine_${version}_armv6hf";; 2) local url="Arm/nomachine_${version}_armhf";; @@ -3350,11 +3346,12 @@ _EOF_ 1) local arch='armv6';; 2) local arch='armv7';; 3) local arch='arm64';; + 11) local arch='riscv64';; *) local arch='amd64';; esac # Download binary - local fallback_url="https://github.com/prometheus/node_exporter/releases/download/v1.6.1/node_exporter-1.6.1.linux-$arch.tar.gz" + local fallback_url="https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/prometheus/node_exporter/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/node_exporter-.*\.linux-$arch\.tar\.gz\"$/{print \$4}")" G_EXEC mkdir -p /opt/node_exporter G_EXEC cp --preserve=mode node_exporter*/node_exporter /opt/node_exporter/ @@ -6348,11 +6345,11 @@ _EOF_ 1) local arch='armv6';; 2) local arch='armv7';; 3) local arch='arm64';; - *) local arch='x86_64';; + *) local arch='amd64';; esac - local fallback_url="https://github.com/navidrome/navidrome/releases/download/v0.49.3/navidrome_0.49.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 + local fallback_url="https://github.com/navidrome/navidrome/releases/download/v0.50.0/navidrome_0.50.0_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 G_EXEC mkdir -p /mnt/dietpi_userdata/navidrome @@ -8732,7 +8729,7 @@ _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.2.7'; 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='v4.2.9'; 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"; } Download_Install "https://github.com/Novik/ruTorrent/archive/$version.tar.gz" # - Reinstall freshly with preserved configs and 3rd party plugins @@ -9123,7 +9120,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.26.0/syncthing-linux-$arch-v1.26.0.tar.gz" + local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.26.1/syncthing-linux-$arch-v1.26.1.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 @@ -10102,6 +10099,8 @@ _EOF_ if To_Install 149 nzbget # NZBGet then + local reinstall=0 + [[ -f '/mnt/dietpi_userdata/nzbget/nzbget.conf' ]] && reinstall=1 G_EXEC curl -sSfL 'https://nzbget.net/download/nzbget-latest-bin-linux.run' -o package.run G_EXEC mkdir -p /mnt/dietpi_userdata/nzbget G_EXEC_OUTPUT=1 G_EXEC dash package.run --destdir /mnt/dietpi_userdata/nzbget @@ -10111,38 +10110,41 @@ _EOF_ Create_User -g dietpi -d /mnt/dietpi_userdata/nzbget nzbget # Permissions - G_EXEC chown -R nzbget:root /mnt/dietpi_userdata/nzbget + G_EXEC touch /var/log/nzbget.log + G_EXEC chown -R nzbget:root /mnt/dietpi_userdata/nzbget /var/log/nzbget.log G_EXEC chmod 0600 /mnt/dietpi_userdata/nzbget/nzbget.conf # Config - G_BACKUP_FP /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'MainDir=' 'MainDir=/mnt/dietpi_userdata/downloads' /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'DestDir=' 'DestDir=/mnt/dietpi_userdata/downloads/complete' /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'LogFile=' 'LogFile=/var/log/nzbget.log' /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'ControlUsername=' 'ControlUsername=admin' /mnt/dietpi_userdata/nzbget/nzbget.conf - GCI_PASSWORD=1 G_CONFIG_INJECT 'ControlPassword=' "ControlPassword=$GLOBAL_PW" /mnt/dietpi_userdata/nzbget/nzbget.conf - - # Umask: https://github.com/MichaIng/DietPi/issues/1999 - G_CONFIG_INJECT 'UMask=' 'UMask=0002' /mnt/dietpi_userdata/nzbget/nzbget.conf - - # Optimisations - G_CONFIG_INJECT 'Server1.Cipher=' 'Server1.Cipher=RC4-MD5' /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'CrcCheck=' 'CrcCheck=no' /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'ParScan=' 'ParScan=limited' /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'ParThreads=' "ParThreads=$G_HW_CPU_CORES" /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'DebugTarget=' 'DebugTarget=none' /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'CrashTrace=' 'CrashTrace=no' /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'DetailTarget=' 'DetailTarget=none' /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'ParBuffer=' "ParBuffer=$(Optimise_BitTorrent 0)" /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'ArticleCache=' "ArticleCache=$(Optimise_BitTorrent 0)" /mnt/dietpi_userdata/nzbget/nzbget.conf - G_CONFIG_INJECT 'WriteBuffer=' "WriteBuffer=$(Optimise_BitTorrent 0)" /mnt/dietpi_userdata/nzbget/nzbget.conf + if (( ! $reinstall )) + then + G_CONFIG_INJECT 'MainDir=' 'MainDir=/mnt/dietpi_userdata/downloads' /mnt/dietpi_userdata/nzbget/nzbget.conf + G_CONFIG_INJECT 'DestDir=' 'DestDir=/mnt/dietpi_userdata/downloads/complete' /mnt/dietpi_userdata/nzbget/nzbget.conf + G_CONFIG_INJECT 'LogFile=' 'LogFile=/var/log/nzbget.log' /mnt/dietpi_userdata/nzbget/nzbget.conf + G_CONFIG_INJECT 'ControlUsername=' 'ControlUsername=admin' /mnt/dietpi_userdata/nzbget/nzbget.conf + GCI_PASSWORD=1 G_CONFIG_INJECT 'ControlPassword=' "ControlPassword=$GLOBAL_PW" /mnt/dietpi_userdata/nzbget/nzbget.conf + + # Umask: https://github.com/MichaIng/DietPi/issues/1999 + G_CONFIG_INJECT 'UMask=' 'UMask=0002' /mnt/dietpi_userdata/nzbget/nzbget.conf + + # Optimisations + G_CONFIG_INJECT 'Server1.Cipher=' 'Server1.Cipher=RC4-MD5' /mnt/dietpi_userdata/nzbget/nzbget.conf + G_CONFIG_INJECT 'CrcCheck=' 'CrcCheck=no' /mnt/dietpi_userdata/nzbget/nzbget.conf + G_CONFIG_INJECT 'ParScan=' 'ParScan=limited' /mnt/dietpi_userdata/nzbget/nzbget.conf + G_CONFIG_INJECT 'ParThreads=' "ParThreads=$G_HW_CPU_CORES" /mnt/dietpi_userdata/nzbget/nzbget.conf + G_CONFIG_INJECT 'DebugTarget=' 'DebugTarget=none' /mnt/dietpi_userdata/nzbget/nzbget.conf + G_CONFIG_INJECT 'CrashTrace=' 'CrashTrace=no' /mnt/dietpi_userdata/nzbget/nzbget.conf + G_CONFIG_INJECT 'DetailTarget=' 'DetailTarget=none' /mnt/dietpi_userdata/nzbget/nzbget.conf + G_CONFIG_INJECT 'ParBuffer=' "ParBuffer=$(Optimise_BitTorrent 0)" /mnt/dietpi_userdata/nzbget/nzbget.conf + G_CONFIG_INJECT 'ArticleCache=' "ArticleCache=$(Optimise_BitTorrent 0)" /mnt/dietpi_userdata/nzbget/nzbget.conf + G_CONFIG_INJECT 'WriteBuffer=' "WriteBuffer=$(Optimise_BitTorrent 0)" /mnt/dietpi_userdata/nzbget/nzbget.conf + fi # Service cat << '_EOF_' > /etc/systemd/system/nzbget.service [Unit] Description=NZBGet (DietPi) Wants=network-online.target -After=network-online.target remote-fs.targe +After=network-online.target remote-fs.target [Service] Type=forking @@ -10755,7 +10757,7 @@ _EOF_ *) local arch='arm-6';; esac - local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.20.5/gitea-1.20.5-linux-$arch.xz" + local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.21.0/gitea-1.21.0-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 @@ -14755,13 +14757,9 @@ _EOF_ grep -qi 'vendor_id.*amd' /proc/cpuinfo && G_AGI amd64-microcode # VM: Enable QEMU guest agent if detected - elif (( $G_HW_MODEL == 20 )) && grep -q 'org.qemu.guest_agent.0' /sys/class/virtio-ports/*/name 2> /dev/null + elif (( $G_HW_MODEL == 20 )) then - G_DIETPI-NOTIFY 2 'QEMU VM detected, installing guest agent ...' - G_AGI dbus - G_EXEC systemctl unmask systemd-logind - G_EXEC systemctl start systemd-logind - G_AGI qemu-guest-agent + /boot/dietpi/func/dietpi-set_hardware qga 1 # RPi4 EEPROM update: https://github.com/MichaIng/DietPi/issues/3217 elif (( $G_HW_MODEL == 4 )) diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 8f448e6aaf..886f2ca1f3 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -55,7 +55,7 @@ # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=8 [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=24 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=0 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=1 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch @@ -875,8 +875,7 @@ $grey───────────────────────── [[ $G_EXEC_NOHALT == 1 ]] && break # Prepare error handler menu and GitHub issue template - local fp_error_report='/tmp/G_EXEC_ERROR_REPORT' image_creator preimage_name dietpi_version="v$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC ($G_GITOWNER/$G_GITBRANCH)" last_whip_menu_item sent_bug_report - read -r log_content < "$fp_log" + local fp_error_report='/tmp/G_EXEC_ERROR_REPORT' log_content=$(<"$fp_log") image_creator preimage_name dietpi_version="v$G_DIETPI_VERSION_CORE.$G_DIETPI_VERSION_SUB.$G_DIETPI_VERSION_RC ($G_GITOWNER/$G_GITBRANCH)" last_whip_menu_item sent_bug_report if [[ -f '/boot/dietpi/.prep_info' ]]; then image_creator=$(mawk 'NR==1' /boot/dietpi/.prep_info) diff --git a/dietpi/func/dietpi-obtain_hw_model b/dietpi/func/dietpi-obtain_hw_model index 9a3ba93f8b..c99e6416b5 100755 --- a/dietpi/func/dietpi-obtain_hw_model +++ b/dietpi/func/dietpi-obtain_hw_model @@ -69,6 +69,7 @@ # G_HW_MODEL 12 Odroid C2 # G_HW_MODEL 11 Odroid XU3/XU4/MC1/HC1/HC2 # G_HW_MODEL 10 Odroid C1 + # G_HW_MODEL 5 Raspberry Pi 5 # G_HW_MODEL 4 Raspberry Pi 4/400 # G_HW_MODEL 3 Raspberry Pi 3/3+/Zero 2 # G_HW_MODEL 2 Raspberry Pi 2 @@ -166,6 +167,8 @@ 12) G_HW_MODEL_NAME='RPi Zero 2 W' G_HW_MODEL=3 G_HW_ONBOARD_WIFI=1;; 13) G_HW_MODEL_NAME='RPi 400' G_HW_MODEL=4 G_HW_ONBOARD_WIFI=1;; 14) G_HW_MODEL_NAME='RPi CM 4' G_HW_MODEL=4;; + 15) G_HW_MODEL_NAME='RPi CM 4S' G_HW_MODEL=4;; + 17) G_HW_MODEL_NAME='RPi 5 Model B' G_HW_MODEL=5;; esac # Manufacturer # shellcheck disable=SC2249 @@ -587,7 +590,7 @@ fi # RPi? Detect via ondisk device tree file instead of /proc content, for chroot/systemd-nspawn support - elif for i in /boot/bcm*-rpi-*\.dtb; do [[ -f $i ]] && break; done; then + elif for i in /boot/{,firmware/}bcm*-rpi-*\.dtb; do [[ -f $i ]] && break; done; then # Detect exact RPi model RPi_BoardInfo diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index c411b60d4e..b68e6b9343 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -33,6 +33,7 @@ $FP_SCRIPT rpi3_usb_boot enable $FP_SCRIPT rpi-eeprom Update RPi 4 EEPROM bootloader and USB firmware $FP_SCRIPT vf2-spi-update Update StarFive VisionFive 2 SPI bootloader $FP_SCRIPT gpudriver none|intel|nvidia|amd|custom +$FP_SCRIPT qemu-guest-agent|qga enable/disable " #//////////////////////////////////// # Grab Inputs @@ -81,14 +82,14 @@ $FP_SCRIPT gpudriver none|intel|nvidia|amd|custom Unknown_Input_Name() { - G_DIETPI-NOTIFY 2 "Unknown input name ($INPUT_DEVICE_NAME). Nothing has been applied." + G_DIETPI-NOTIFY 1 "Unknown input name ($INPUT_DEVICE_NAME). Nothing has been applied." echo "$AVAIABLE_COMMANDS" EXIT_CODE=1 } Unknown_Input_Mode() { - G_DIETPI-NOTIFY 2 "Unknown input value ($INPUT_DEVICE_VALUE). Nothing has been applied." + G_DIETPI-NOTIFY 1 "Unknown input value ($INPUT_DEVICE_VALUE). Nothing has been applied." echo "$AVAIABLE_COMMANDS" EXIT_CODE=1 } @@ -216,14 +217,25 @@ _EOF_ } #///////////////////////////////////////////////////////////////////////////////////// - # rpi-eeprom: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#updating-the-bootloader + # rpi-eeprom: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#automaticupdates #///////////////////////////////////////////////////////////////////////////////////// RPi_EEPROM() { (( $G_HW_MODEL == 4 )) || { Unsupported_Input_Name; return 1; } # Exit path for non-RPi4 # Install required APT package - G_AG_CHECK_INSTALL_PREREQ rpi-eeprom + if (( $G_DISTRO > 6 )) + then + if ! dpkg-query -s rpi-eeprom &> /dev/null + then + G_EXEC_OUTPUT=1 G_EXEC curl -fO 'https://dietpi.com/downloads/binaries/rpi/rpi-eeprom.deb' + G_AGI ./rpi-eeprom.deb + G_EXEC rm rpi-eeprom.deb + G_EXEC apt-mark hold rpi-eeprom + fi + else + G_AG_CHECK_INSTALL_PREREQ rpi-eeprom + fi # Update/flash new bootloader and VL805 USB firmware to EEPROM rpi-eeprom-update -a @@ -1124,33 +1136,50 @@ _EOF_ #///////////////////////////////////////////////////////////////////////////////////// # SPI: https://github.com/raspberrypi/documentation/tree/master/hardware/raspberrypi/spi #///////////////////////////////////////////////////////////////////////////////////// - SPI_Main(){ - - (( $G_HW_MODEL > 9 )) && { Unsupported_Input_Name; return 1; } # Exit path for non-RPi - - if [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then - - # config.txt - G_CONFIG_INJECT 'dtparam=spi=' 'dtparam=spi=on' /boot/config.txt + SPI_Main() + { + # RPi + if (( $G_HW_MODEL < 10 )) + then + if [[ $INPUT_DEVICE_VALUE == 'enable' ]] + then + # config.txt + G_CONFIG_INJECT 'dtparam=spi=' 'dtparam=spi=on' /boot/config.txt - # Enable in runtime seems to be possible? - #dtparam spi=on + # Enable in runtime seems to be possible? + #dtparam spi=on - elif [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then + elif [[ $INPUT_DEVICE_VALUE == 'disable' ]] + then + # config.txt + G_CONFIG_INJECT 'dtparam=spi=' 'dtparam=spi=off' /boot/config.txt + G_EXEC sed -i '/^[[:blank:]]*dtoverlay=spi[0-9]-[0-9]cs/d' /boot/config.txt # Alternative SPI interfaces and chip select lines - # config.txt - G_CONFIG_INJECT 'dtparam=spi=' 'dtparam=spi=off' /boot/config.txt - G_EXEC sed -i '/^[[:blank:]]*dtoverlay=spi[0-9]-[0-9]cs/d' /boot/config.txt # Alternative SPI interfaces and chip select lines + # Disable in runtime seems to be possible? + #dtparam spi=off + else + Unknown_Input_Mode + fi - # Disable in runtime seems to be possible? - #dtparam spi=off + # Orange Pi Zero 3 + elif (( $G_HW_MODEL == 83 )) + then + if [[ $INPUT_DEVICE_VALUE == 'enable' ]] + then + # Add overlay to dietpiEnv.txt + grep -Eq '^[[:blank:]]*overlays=(.*[[:blank:]])?spi1-cs1-spidev([[:blank:]]|$)' "$FP_UENV" || G_EXEC sed -i '/^[[:blank:]]*overlays=/s/[[:blank:]]*$/ spi1-cs1-spidev/' "$FP_UENV" + elif [[ $INPUT_DEVICE_VALUE == 'disable' ]] + then + # Remove overlay from dietpiEnv.txt + grep -Eq '^[[:blank:]]*overlays=(.*[[:blank:]])?spi1-cs1-spidev([[:blank:]]|$)' "$FP_UENV" && G_EXEC sed -Ei '/^[[:blank:]]*overlays=/s/[[:blank:]]*spi1-cs1-spidev([[:blank:]]*$)?//g' "$FP_UENV" + else + Unknown_Input_Mode + fi else - - Unknown_Input_Mode - + Unsupported_Input_Name + return 1 fi - } #///////////////////////////////////////////////////////////////////////////////////// @@ -2143,7 +2172,7 @@ _EOF_ if (( $ARMBIAN || $DIETPIENV )) then # Add analogue 3.5mm jack device tree overlay - G_EXEC sed -i '/^[[:blank:]]*overlays=/s/$/ analog-codec/' "$FP_UENV" + G_EXEC sed -i '/^[[:blank:]]*overlays=/s/[[:blank:]]*$/ analog-codec/' "$FP_UENV" # Legacy else @@ -2344,6 +2373,26 @@ _EOF_ G_CONFIG_INJECT 'CONFIG_GPU_DRIVER=' "CONFIG_GPU_DRIVER=$INPUT_DEVICE_VALUE" /boot/dietpi.txt } + QEMU_Guest_Agent_Main() + { + (( $G_HW_MODEL == 20 )) || { Unsupported_Input_Name; return 1; } # VM only + + [[ $INPUT_DEVICE_VALUE == 'disable' ]] && { G_AGP qemu-guest-agent; return 0; } + + [[ $INPUT_DEVICE_VALUE == 'enable' ]] || { Unknown_Input_Mode; return 1; } + + [[ -e '/dev/virtio-ports/org.qemu.guest_agent.0' ]] || { G_DIETPI-NOTIFY 2 'No QEMU Guest Agent node detected, skipping daemon installation ...'; return 1; } # Exit if node is missing + + # Bullseye: logind and hence dbus required + if (( $G_DISTRO == 6 )) + then + G_AG_CHECK_INSTALL_PREREQ dbus + G_EXEC systemctl unmask systemd-logind + G_EXEC systemctl start systemd-logind + fi + G_AG_CHECK_INSTALL_PREREQ qemu-guest-agent + } + #///////////////////////////////////////////////////////////////////////////////////// # Main Loop #///////////////////////////////////////////////////////////////////////////////////// @@ -2371,6 +2420,7 @@ _EOF_ 'vf2-spi-update') VF2_SPI_Update;; 'headless') Headless_Main;; 'gpudriver') GPUDriver_Main;; + 'qemu-guest-agent'|'qga') QEMU_Guest_Agent_Main;; *) Unknown_Input_Name;; esac #-----------------------------------------------------------------------------------