diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 349502467c..2464c916d4 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -47,7 +47,6 @@ EDITION= SUFFIX= ADD_DOS_PART=1 SIGN_PASS= -RPI_NEW=0 while (( $# )) do case $1 in @@ -64,7 +63,6 @@ do '-s') shift; SUFFIX=$1;; '--no-dos-part') ADD_DOS_PART=0;; '--sign') shift; SIGN_PASS=$1;; - '--rpi-new') RPI_NEW=1;; *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; esac shift @@ -85,31 +83,31 @@ case $HW_MODEL in 5) iname='RPi5' HW_ARCH=3 boot_size=128 root_size=895;; 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=764;; - 12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=892;; - 15) iname='OdroidN2' HW_ARCH=3 partition_start=4 root_size=892;; - 16) iname='OdroidC4' HW_ARCH=3 partition_start=4 root_size=892;; + 12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=1020;; + 15) iname='OdroidN2' HW_ARCH=3 partition_start=4 root_size=1020;; + 16) iname='OdroidC4' HW_ARCH=3 partition_start=4 root_size=1020;; 20) iname='VM' HW_ARCH=${HW_ARCH:-10} VMTYPE=${VMTYPE:-raw};; - 21) iname='NativePC-BIOS' HW_ARCH=10 root_size=1215;; + 21) iname='NativePC-BIOS' HW_ARCH=10 root_size=1663;; 40) iname='PINEA64' HW_ARCH=3 partition_start=4 root_size=892;; - 42) iname='ROCKPro64' HW_ARCH=3 partition_start=16 root_size=880;; - 43) iname='ROCK64' HW_ARCH=3 partition_start=16 root_size=880;; + 42) iname='ROCKPro64' HW_ARCH=3 partition_start=16 root_size=1008;; + 43) iname='ROCK64' HW_ARCH=3 partition_start=16 root_size=1008;; 44) iname='Pinebook' HW_ARCH=3 partition_start=4 root_size=892;; 45) iname='PINEH64' HW_ARCH=3 partition_start=4 root_size=892;; - 46) iname='PinebookPro' HW_ARCH=3 partition_start=16 root_size=880;; - 47) iname='NanoPiR4S' HW_ARCH=3 partition_start=16 root_size=880;; + 46) iname='PinebookPro' HW_ARCH=3 partition_start=16 root_size=1008;; + 47) iname='NanoPiR4S' HW_ARCH=3 partition_start=16 root_size=1008;; 48) iname='NanoPiR1' HW_ARCH=2 partition_start=4 root_size=764;; '49.1') iname='Quartz64A' HW_ARCH=3 partition_start=16 root_size=752;; '49.2') iname='Quartz64B' HW_ARCH=3 partition_start=16 root_size=752;; '49.3') iname='SOQuartz' HW_ARCH=3 partition_start=16 root_size=752;; 52) iname='ASUSTB' HW_ARCH=2 partition_start=4 root_size=764;; - 54) iname='NanoPiK2' HW_ARCH=3 partition_start=4 root_size=892;; - 55) iname='NanoPiR2S' HW_ARCH=3 partition_start=16 root_size=880;; - 56) iname='NanoPiNEO3' HW_ARCH=3 partition_start=16 root_size=880;; + 54) iname='NanoPiK2' HW_ARCH=3 partition_start=4 root_size=1020;; + 55) iname='NanoPiR2S' HW_ARCH=3 partition_start=16 root_size=1008;; + 56) iname='NanoPiNEO3' HW_ARCH=3 partition_start=16 root_size=1008;; 57) iname='NanoPiNEOPlus2' HW_ARCH=3 partition_start=4 root_size=892;; - 58) iname='NanoPiM4V2' HW_ARCH=3 partition_start=16 root_size=880;; + 58) iname='NanoPiM4V2' HW_ARCH=3 partition_start=16 root_size=1008;; 59) iname='ZeroPi' HW_ARCH=2 partition_start=4 root_size=764;; 60) iname='NanoPiNEO' HW_ARCH=2 partition_start=4 root_size=764;; - 61) iname='NanoPiM2' HW_ARCH=2 partition_start=4 boot_size=64 root_size=572 boot_fstype='ext4';; + 61) iname='NanoPiM2' HW_ARCH=2 partition_start=4 boot_size=64 root_size=700 boot_fstype='ext4';; '62.1') iname='NanoPiM3' HW_ARCH=3 partition_start=4 root_size=700;; '62.2') iname='NanoPiFire3' HW_ARCH=3 partition_start=4 root_size=700;; 63) iname='NanoPiM1' HW_ARCH=2 partition_start=4 root_size=764;; @@ -118,31 +116,31 @@ case $HW_MODEL in '65.2') iname='NanoPiNEO2Black' HW_ARCH=3 partition_start=4 root_size=892;; 66) iname='NanoPiM1Plus' HW_ARCH=2 partition_start=4 root_size=764;; 67) iname='NanoPiK1Plus' HW_ARCH=3 partition_start=4 root_size=892;; - '68.1') iname='NanoPiM4' HW_ARCH=3 partition_start=16 root_size=880;; - '68.2') iname='NanoPCT4' HW_ARCH=3 partition_start=16 root_size=880;; - '68.3') iname='NanoPiNEO4' HW_ARCH=3 partition_start=16 root_size=880;; + '68.1') iname='NanoPiM4' HW_ARCH=3 partition_start=16 root_size=1008;; + '68.2') iname='NanoPCT4' HW_ARCH=3 partition_start=16 root_size=1008;; + '68.3') iname='NanoPiNEO4' HW_ARCH=3 partition_start=16 root_size=1008;; 70) iname='SparkySBC' HW_ARCH=2 partition_start=8 boot_size=48 root_size=712 boot_fstype='fat16';; '72.1') iname='ROCKPi4' HW_ARCH=3 partition_start=16 root_size=1008;; '72.2') iname='ROCK4SE' HW_ARCH=3 partition_start=16 root_size=1008;; - 73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=880;; - 74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=892;; - 75) iname='Container' HW_ARCH=${HW_ARCH:-10} root_size=447;; - '76.1') iname='NanoPiR5S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; - '76.2') iname='NanoPiR5C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; - 77) iname='ROCK3A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; - 78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; - '79.1') iname='NanoPiR6S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; - '79.2') iname='NanoPiR6C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; - '79.3') iname='NanoPCT6' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; - 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; + 73) iname='ROCKPiS' HW_ARCH=3 partition_start=16 root_size=1008;; + 74) iname='RadxaZero' HW_ARCH=3 partition_start=4 root_size=1020;; + 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=1008;; + 78) iname='ROCK5B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; + '79.1') iname='NanoPiR6S' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; + '79.2') iname='NanoPiR6C' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; + '79.3') iname='NanoPCT6' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; + 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; 81) iname='VisionFive2' HW_ARCH=11 root_size=639;; - 82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; - '83.1') iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=1020;; - '83.2') iname='OrangePiZero3-1.5G' HW_ARCH=3 partition_start=4 root_size=1020;; + 82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; + '83.1') iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=1148;; + '83.2') iname='OrangePiZero3-1.5G' 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=880;; - 86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=880;; - 87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=880;; + 85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; + 86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=1008;; + 87) iname='OrangePi3B' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=1008;; *) G_DIETPI-NOTIFY 1 "Invalid hardware model \"$HW_MODEL\" passed, aborting..."; exit 1;; esac @@ -166,22 +164,13 @@ case $HW_ARCH in *) G_DIETPI-NOTIFY 1 "Invalid architecture \"$HW_ARCH\" passed, aborting..."; exit 1;; esac -exclude= case $DISTRO in - 6) distro='bullseye' exclude=',gcc-8-base,gcc-9-base';; - 7|8) - exclude=',gcc-8-base,gcc-9-base,gcc-10-base,gcc-11-base' - [[ $DISTRO == 7 ]] && distro='bookworm' || distro='trixie' exclude+=',gcc-12-base,gcc-13-base' - [[ $HW_ARCH == 11 ]] && distro='sid' # RISC-V architecture is available on Sid only - # Raise root size where required - case $HW_MODEL in - 1[256]|54|61|7[4569]) ((root_size+=128));; - 21) ((root_size+=448));; - *) [[ $partition_start == 16 ]] && ((root_size+=128));; # 64-bit Rockchip SoCs - esac - ;; + 6) distro='bullseye';; + 7) distro='bookworm';; + 8) distro='trixie';; *) G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1;; esac +[[ $HW_ARCH == 11 ]] && distro='sid' # RISC-V architecture is available on Sid only case $PTTYPE in 'msdos') :;; @@ -189,16 +178,6 @@ case $PTTYPE in *) G_DIETPI-NOTIFY 1 "Invalid partition table type \"$PTTYPE\" passed, aborting..."; exit 1;; esac -if (( $RPI_NEW )) -then - (( $HW_MODEL < 10 && $DISTRO > 6 )) || { G_DIETPI-NOTIFY 1 "Invalid flag \"--rpi-new\" passed for hardware model \"$HW_MODEL\" or distro \"$DISTRO\" (${distro^}), aborting..."; exit 1; } - -elif (( $HW_MODEL && $HW_MODEL < 10 )) -then - G_DIETPI-NOTIFY 1 "Invalid hardware model \"$HW_MODEL\" passed without flag \"--rpi-new\", aborting..." - exit 1 -fi - # Do not add trailing FAT partitions for VM, container and (Clonezilla) installer images, and if there is a boot FAT partition already [[ $HW_MODEL == 20 || $HW_MODEL == 75 || $ITYPE == 'Installer' ]] && ADD_DOS_PART=0 [[ $boot_size -gt 0 && $boot_fstype == 'fat'* ]] && ADD_DOS_PART=0 @@ -361,7 +340,7 @@ then G_EXEC "mkfs.$FSTYPE" "${afs_opts[@]}" "${FP_LOOP}p2" G_EXEC mount "${FP_LOOP}p2" rootfs fp_boot='boot' - (( $RPI_NEW )) && fp_boot+='/firmware' + [[ $HW_MODEL == [1245] ]] && fp_boot+='/firmware' G_EXEC mkdir -p "rootfs/$fp_boot" G_EXEC mount "${FP_LOOP}p1" "rootfs/$fp_boot" G_EXEC mkdir rootfs/etc @@ -399,8 +378,8 @@ G_EXEC mount -o X-mount.mkdir -t tmpfs tmpfs rootfs/var/lib/apt/lists G_EXEC mount -o X-mount.mkdir -t tmpfs tmpfs rootfs/var/log packages='apt,bash-completion,bzip2,ca-certificates,cron,curl,fdisk,gnupg,htop,iputils-ping,locales,nano,p7zip,parted,procps,psmisc,sudo,systemd-sysv,tzdata,udev,unzip,wget,whiptail,' [[ $HW_MODEL == 75 ]] && packages+='iproute2' || packages+='console-setup,dropbear,ethtool,fake-hwclock,ifupdown,isc-dhcp-client,kmod,rfkill,systemd-timesyncd,usbutils' -G_EXEC_POST_FUNC(){ [[ $exit_code == 0 ]] || cat /dev/shm/rootfs/debootstrap/debootstrap.log; } -G_EXEC_OUTPUT=1 G_EXEC debootstrap --variant=minbase --exclude="gcc-7-base$exclude" --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo" +G_EXEC_POST_FUNC(){ [[ $exit_code == 0 ]] || cat rootfs/debootstrap/debootstrap.log; } +G_EXEC_OUTPUT=1 G_EXEC debootstrap --variant=minbase --include="$packages" --arch="$parch" --keyring="$keyring" "$distro" ./rootfs "$repo" G_EXEC umount rootfs/dev rootfs/run rootfs/var/cache/apt rootfs/var/lib/apt/lists rootfs/var/log ########################################## @@ -465,7 +444,7 @@ G_EXEC losetup -d "$FP_LOOP" export FP_ROOT_DEV CLONING_TOOL OUTPUT_IMG_NAME MOUNT_IT='Off' SKIP_ARCHIVE SKIP_FIRSTBOOT_RESIZE=1 IMAGER_ARGS=("$OUTPUT_IMG_NAME.img") (( $ADD_DOS_PART )) && IMAGER_ARGS+=('--add-dos-part') -(( $RPI_NEW )) && IMAGER_ARGS+=('--configs-to-boot') +[[ $HW_MODEL == [1245] ]] && IMAGER_ARGS+=('--configs-to-boot') [[ $SIGN_PASS ]] && IMAGER_ARGS+=('--sign' "$SIGN_PASS") if [[ ! $EDITION || $EDITION == 'all' ]] then @@ -497,7 +476,7 @@ then # Mount filesystems G_EXEC mkdir rootfs - if (( $RPI_NEW )) + if [[ $HW_MODEL == [1245] ]] then G_EXEC mount "${FP_LOOP}p2" rootfs @@ -559,9 +538,10 @@ then # Mount filesystems G_EXEC mkdir rootfs - if (( $RPI_NEW )) + if [[ $HW_MODEL == [1245] ]] then G_EXEC mount "${FP_LOOP}p2" rootfs + G_EXEC mount "${FP_LOOP}p1" rootfs/boot/firmware elif (( $boot_size )) then @@ -599,9 +579,6 @@ _EOF_ # Force ARMv6 arch on Raspbian (( $HW_ARCH == 1 )) && echo 'sed --follow-symlinks -i -e '\''/^G_HW_ARCH=/c\G_HW_ARCH=1'\'' -e '\''/^G_HW_ARCH_NAME=/c\G_HW_ARCH_NAME=armv6l'\'' /boot/dietpi/.hw_model' > rootfs/boot/Automation_Custom_PreScript.sh - # Temporary fix for failing NAA Daemon install on Trixie - (( $DISTRO == 8 )) && G_EXEC sed --follow-symlinks -i '\|www.signalyst.eu|s|bookworm/bullseye|trixie/bullseye|' rootfs/boot/dietpi/dietpi-software - # 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-installer b/.build/images/dietpi-installer index f61c460084..7254702d51 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1151,7 +1151,8 @@ _EOF_ G_AGI initramfs-tools u-boot-tools armbian-firmware "${zstd[@]}" [[ ${zstd[0]} ]] && G_CONFIG_INJECT 'COMPRESS=' 'COMPRESS=zstd' /etc/initramfs-tools/initramfs.conf # Download and pre-install kernel hosted on dietpi.com where the Armbian APT repo provides a too old version - if [[ ( $G_HW_MODEL == 72 && $HW_VARIANT == 2 ) || $G_HW_MODEL =~ ^(76|83)$ ]] + # - NanoPi R4S: Solve Ethernet adapter disappearing on soft reboot: https://github.com/MichaIng/DietPi/issues/6342 + if [[ ( $G_HW_MODEL == 72 && $HW_VARIANT == 2 ) || $G_HW_MODEL =~ ^(47|76|83)$ ]] then G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb "https://dietpi.com/downloads/binaries/linux-image-$branch-$kernel.deb" G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb "https://dietpi.com/downloads/binaries/linux-dtb-$branch-$kernel.deb" @@ -1537,16 +1538,11 @@ _EOF_ # Replace usrmerge with usr-is-merged again, in case of dist-upgraded systems dpkg-query -s usrmerge &> /dev/null && G_AGP usrmerge - # Remove old gcc-*-base packages, e.g. accumulated on Raspberry Pi OS images + # Bullseye: Remove old gcc-*-base packages, e.g. accumulated on Raspberry Pi OS images and installed by debootstrap, which are not autoremoved due to "Priority: required" # shellcheck disable=SC2015 - case $G_DISTRO in - 5) mapfile -t apackages < <(dpkg --get-selections 'gcc-*-base' | mawk '$1!~/^gcc-8-/{print $1}');; - 6) mapfile -t apackages < <(dpkg --get-selections 'gcc-*-base' | mawk '$1!~/^gcc-10-/{print $1}');; - 7) mapfile -t apackages < <(dpkg --get-selections 'gcc-*-base' | mawk '$1!~/^gcc-12-/{print $1}');; - 8) dpkg-query -s 'gcc-14-base' &> /dev/null && mapfile -t apackages < <(dpkg --get-selections 'gcc-*-base' | mawk '$1!~/^gcc-14-/{print $1}') || mapfile -t apackages < <(dpkg --get-selections 'gcc-*-base' | mawk '$1!~/^gcc-13-/{print $1}');; # Temporary workaround for Raspbian Trixie not shipping gcc-14-base yet - *) :;; - esac + (( $G_DISTRO == 6 )) && mapfile -t apackages < <(dpkg --get-selections 'gcc-*-base' | mawk '$1!~/^gcc-10-/{print $1}') [[ ${apackages[0]} ]] && G_AGP "${apackages[@]}" + unset -v apackages G_DIETPI-NOTIFY 2 'Restoring default base files:' # shellcheck disable=SC2114 @@ -2174,6 +2170,7 @@ _EOF_ 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_ # NanoPi R6S elif [[ $G_HW_MODEL == 79 && $HW_VARIANT == 1 ]] @@ -2191,8 +2188,9 @@ _EOF_ G_DIETPI-NOTIFY 2 'Enabling 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; /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; /bin/ip l s down dev eth1" +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_ # Orange Pi 3B/Zero 3: Module does not load automatically, but we want it loaded on first boot in case firstrun setup is done via WiFi elif [[ $G_HW_MODEL =~ ^(83|87)$ ]] @@ -2224,7 +2222,7 @@ _EOF_ then G_CONFIG_INJECT 'CONFIG_NTP_MODE=' 'CONFIG_NTP_MODE=0' /boot/dietpi.txt else - G_EXEC_DESC='Enable Dropbear autostart' G_EXEC sed --follow-symlinks -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear + (( $G_DISTRO < 7 )) && G_EXEC_DESC='Enable Dropbear autostart' G_EXEC sed --follow-symlinks -i '/NO_START=1/c\NO_START=0' /etc/default/dropbear G_EXEC systemctl unmask dropbear G_EXEC systemctl enable dropbear fi diff --git a/.build/software/Amiberry/build.bash b/.build/software/Amiberry/build.bash index fadbbc3d75..e238897a82 100755 --- a/.build/software/Amiberry/build.bash +++ b/.build/software/Amiberry/build.bash @@ -21,7 +21,8 @@ G_AGUP G_AGDUG "${adeps_build[@]}" for i in "${adeps[@]}" do - dpkg-query -s "$i" &> /dev/null && continue + # Temporarily allow lib*t64 packages, while the 64-bit time_t transition is ongoing on Sid: https://bugs.debian.org/1065394 + dpkg-query -s "$i" &> /dev/null || dpkg-query -s "${i}t64" &> /dev/null && continue G_DIETPI-NOTIFY 1 "Expected dependency package was not installed: $i" exit 1 done @@ -185,6 +186,8 @@ find "$DIR" ! \( -path "$DIR/DEBIAN" -prune \) -type f -exec md5sum {} + | sed " DEPS_APT_VERSIONED= for i in "${adeps[@]}" do + # Temporarily allow lib*t64 packages, while the 64-bit time_t transition is ongoing on Sid: https://bugs.debian.org/1065394 + dpkg-query -s "$i" &> /dev/null || i+='t64' DEPS_APT_VERSIONED+=" $i (>= $(dpkg-query -Wf '${VERSION}' "$i"))," done DEPS_APT_VERSIONED=${DEPS_APT_VERSIONED%,} diff --git a/.build/software/dietpi-software-build.bash b/.build/software/dietpi-software-build.bash index 1ee510ef4a..b29492cb9c 100644 --- a/.build/software/dietpi-software-build.bash +++ b/.build/software/dietpi-software-build.bash @@ -116,9 +116,6 @@ fi # Install Go for Gogs [[ $NAME == 'gogs' ]] && G_CONFIG_INJECT 'AUTO_SETUP_INSTALL_SOFTWARE_ID=' 'AUTO_SETUP_INSTALL_SOFTWARE_ID=188' rootfs/boot/dietpi.txt -# Gogs on RISC-V: Temporarily switch to dev branch until DietPi v8.24 has been released, installing Go from go.dev instead of APT -[[ $NAME == 'gogs' && $ARCH == 'riscv64' ]] && G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=dev' rootfs/boot/dietpi.txt - # Workaround invalid TERM on login # shellcheck disable=SC2016 G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || { echo "[ WARN ] Unsupported TERM=\"$TERM\", switching to TERM=\"dumb\""; export TERM=dumb; }'\'' > rootfs/etc/bashrc.d/00-dietpi-build.sh' @@ -126,6 +123,9 @@ G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || { echo "[ WARN ] Unsup # Workaround for failing IPv4 network connectivity check as GitHub Actions runners do not receive external ICMP echo replies G_CONFIG_INJECT 'CONFIG_CHECK_CONNECTION_IP=' 'CONFIG_CHECK_CONNECTION_IP=127.0.0.1' rootfs/boot/dietpi.txt +# Shutdown on failures before the custom script is executed +G_EXEC sed --follow-symlinks -i 's|Prompt_on_Failure$|{ journalctl -n 50; ss -tulpn; df -h; free -h; poweroff; }|' rootfs/boot/dietpi/dietpi-login + # Avoid DietPi-Survey uploads to not mess with the statistics G_EXEC rm rootfs/root/.ssh/known_hosts diff --git a/.build/software/squeezelite/build.bash b/.build/software/squeezelite/build.bash index bb4e40835e..ab6c717d89 100755 --- a/.build/software/squeezelite/build.bash +++ b/.build/software/squeezelite/build.bash @@ -16,20 +16,19 @@ case $G_DISTRO in esac for i in "${adeps[@]}" do - dpkg-query -s "$i" &> /dev/null && continue + # Temporarily allow lib*t64 packages, while the 64-bit time_t transition is ongoing on Sid: https://bugs.debian.org/1065394 + dpkg-query -s "$i" &> /dev/null || dpkg-query -s "${i}t64" &> /dev/null && continue G_DIETPI-NOTIFY 1 "Expected dependency package was not installed: $i" exit 1 done G_DIETPI-NOTIFY 2 'Downloading source code...' G_EXEC cd /tmp -# Freeze commit: https://github.com/ralph-irving/squeezelite/issues/206 -G_EXEC curl -sSfLO 'https://github.com/ralph-irving/squeezelite/archive/6de9e229aa4cc7c3131ff855f3ead39581127090.tar.gz' +G_EXEC curl -sSfLO 'https://github.com/ralph-irving/squeezelite/archive/master.tar.gz' [[ -d 'squeezelite-master' ]] && G_EXEC rm -R squeezelite-master -G_EXEC tar xf 6de9e229aa4cc7c3131ff855f3ead39581127090.tar.gz -G_EXEC rm 6de9e229aa4cc7c3131ff855f3ead39581127090.tar.gz +G_EXEC tar xf master.tar.gz +G_EXEC rm master.tar.gz G_DIETPI-NOTIFY 2 'Compiling binary...' -G_EXEC mv squeezelite-{6de9e229aa4cc7c3131ff855f3ead39581127090,master} G_EXEC cd squeezelite-master G_EXEC_OUTPUT=1 G_EXEC make CFLAGS='-g0 -O3' OPTS='-DDSD -DFFMPEG -DRESAMPLE -DVISEXPORT -DLINKALL -DIR -DUSE_SSL' G_EXEC strip --remove-section=.comment --remove-section=.note squeezelite @@ -143,6 +142,8 @@ find "$DIR" ! \( -path "$DIR/DEBIAN" -prune \) -type f -exec md5sum {} + | sed " DEPS_APT_VERSIONED= for i in "${adeps[@]}" do + # Temporarily allow lib*t64 packages, while the 64-bit time_t transition is ongoing on Sid: https://bugs.debian.org/1065394 + dpkg-query -s "$i" &> /dev/null || i+='t64' DEPS_APT_VERSIONED+=" $i (>= $(dpkg-query -Wf '${VERSION}' "$i"))," done DEPS_APT_VERSIONED=${DEPS_APT_VERSIONED%,} diff --git a/.build/software/vaultwarden/build.bash b/.build/software/vaultwarden/build.bash index b141a2314d..ce68c4bc55 100755 --- a/.build/software/vaultwarden/build.bash +++ b/.build/software/vaultwarden/build.bash @@ -11,7 +11,8 @@ G_AGUP G_AGDUG "${adeps_build[@]}" for i in "${adeps[@]}" do - dpkg-query -s "$i" &> /dev/null && continue + # Temporarily allow lib*t64 packages, while the 64-bit time_t transition is ongoing on Sid: https://bugs.debian.org/1065394 + dpkg-query -s "$i" &> /dev/null || dpkg-query -s "${i}t64" &> /dev/null && continue G_DIETPI-NOTIFY 1 "Expected dependency package was not installed: $i" exit 1 done @@ -205,6 +206,8 @@ find "$DIR" ! \( -path "$DIR/DEBIAN" -prune \) -type f -exec md5sum {} + | sed " DEPS_APT_VERSIONED= for i in "${adeps[@]}" do + # Temporarily allow lib*t64 packages, while the 64-bit time_t transition is ongoing on Sid: https://bugs.debian.org/1065394 + dpkg-query -s "$i" &> /dev/null || i+='t64' DEPS_APT_VERSIONED+=" $i (>= $(dpkg-query -Wf '${VERSION}' "$i"))," done DEPS_APT_VERSIONED=${DEPS_APT_VERSIONED%,} diff --git a/.conf/desktop/lxqt/lxqt-buster.7z b/.conf/desktop/lxqt/lxqt-buster.7z deleted file mode 100644 index 185acb2b9e..0000000000 Binary files a/.conf/desktop/lxqt/lxqt-buster.7z and /dev/null differ diff --git a/.conf/desktop/lxqt/lxqt-trixie.7z b/.conf/desktop/lxqt/lxqt-trixie.7z new file mode 100644 index 0000000000..3d61376afa Binary files /dev/null and b/.conf/desktop/lxqt/lxqt-trixie.7z differ diff --git a/.github/workflows/dietpi-build.yml b/.github/workflows/dietpi-build.yml index 0e22d4fc7b..cb92edee03 100644 --- a/.github/workflows/dietpi-build.yml +++ b/.github/workflows/dietpi-build.yml @@ -24,6 +24,10 @@ jobs: '"-m 0 -a 1 -d 6 -e all", "-m 0 -a 2 -d 6 -e all", "-m 0 -a 3 -d 6 -e all", '\ '"-m 0 -a 1 -d 7 -e all", "-m 0 -a 2 -d 7 -e all", "-m 0 -a 3 -d 7 -e all", '\ '"-m 0 -a 1 -d 8 -e all", "-m 0 -a 2 -d 8 -e all", "-m 0 -a 3 -d 8 -e all", '\ + '"-m 1 -d 7 -e all", "-m 1 -d 8 -e all", '\ + '"-m 2 -d 7 -e all", "-m 2 -d 8 -e all", '\ + '"-m 4 -d 7 -e all", "-m 4 -d 8 -e all", '\ + '"-m 5 -d 7 -e all", "-m 5 -d 8 -e all", '\ '"-m 10 -d 6", "-m 10 -d 7", "-m 10 -d 8", '\ '"-m 11 -d 6", "-m 11 -d 7", "-m 11 -d 8", '\ '"-m 12 -d 6", "-m 12 -d 7", "-m 12 -d 8", '\ diff --git a/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 69225e7e84..f10f4e2687 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -162,7 +162,7 @@ Process_Software() 132) aSERVICES[i]='aria2' aTCP[i]='6800';; # aTCP[i]+=' 6881-6999';; # Listens on random port 133) (( $arch == 2 || $arch == 11 )) || aSERVICES[i]='yacy' aTCP[i]='8090'; (( $arch == 10 )) && aDELAY[i]=30; (( $arch == 10 || $arch == 2 || $arch == 11)) || aDELAY[i]=60;; 134) aCOMMANDS[i]='docker compose version';; - 135) aSERVICES[i]='icecast2 darkice' aTCP[i]='8000';; + 135) aSERVICES[i]='icecast2' aTCP[i]='8000' aCOMMANDS[i]='darkice -h | grep '\''^DarkIce'\';; # darkice service cannot start in container as is requires audio recording device access 136) aSERVICES[i]='motioneye' aTCP[i]='8765';; 137) aCOMMANDS[i]='/opt/mjpg-streamer/mjpg_streamer -v';; # aSERVICES[i]='mjpg-streamer' aTCP[i]='8082' Service does not start without an actual video device 138) aSERVICES[i]='virtualhere' aTCP[i]='7575';; @@ -413,9 +413,9 @@ done # Success flag and shutdown # shellcheck disable=SC2016 -G_EXEC eval 'echo '\''[ $exit_code = 0 ] && > /success || { journalctl -n 50; ss -tlpn; df -h; free -h; poweroff; }; poweroff'\'' >> rootfs/boot/Automation_Custom_Script.sh' +G_EXEC eval 'echo '\''[ $exit_code = 0 ] && > /success || { journalctl -n 50; ss -tulpn; df -h; free -h; }; poweroff'\'' >> rootfs/boot/Automation_Custom_Script.sh' -# Shutdown as well on failure +# Shutdown as well on failures before the custom script is executed G_EXEC sed --follow-symlinks -i 's|Prompt_on_Failure$|{ journalctl -n 50; ss -tulpn; df -h; free -h; poweroff; }|' rootfs/boot/dietpi/dietpi-login ########################################## diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 4467f6be2d..4e5e3b3ccc 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -703,6 +703,7 @@ shopt -s extglob aSOFTWARE_NAME8_25=() aSOFTWARE_NAME9_0=() aSOFTWARE_NAME9_1=() + aSOFTWARE_NAME9_2=() for i in "${!aSOFTWARE_NAME8_22[@]}" do aSOFTWARE_NAME8_23[i]=${aSOFTWARE_NAME8_22[i]} @@ -710,10 +711,11 @@ shopt -s extglob aSOFTWARE_NAME8_25[i]=${aSOFTWARE_NAME8_24[i]} aSOFTWARE_NAME9_0[i]=${aSOFTWARE_NAME8_25[i]} aSOFTWARE_NAME9_1[i]=${aSOFTWARE_NAME9_0[i]} + aSOFTWARE_NAME9_2[i]=${aSOFTWARE_NAME9_1[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_1[@]}" + for i in "${aSOFTWARE_NAME9_2[@]}" do aSOFTWARE[$i]=0 done diff --git a/.update/patches b/.update/patches index 61c6925a4a..9083c42eef 100755 --- a/.update/patches +++ b/.update/patches @@ -1238,44 +1238,6 @@ Release notes: https://github.com/hzeller/gmrender-resurrect/releases Patch_8_20() { - # NanoPi R5S/6 kernel upgrade - case $G_HW_MODEL in - 76) local series=5 version='5.10.160-dietpi1';; - 79) local series=6 version='5.10.160-dietpi1';; - *) local series='';; - esac - - if [[ $series ]] && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' "firmware-nanopi$series" 2> /dev/null)" lt-nl "$version" - then - G_DIETPI-NOTIFY 2 "Updating NanoPi $series series kernel ..." - G_EXEC curl -sSfO "https://dietpi.com/downloads/nanopi$series.7z" - G_EXEC 7zr x "nanopi$series.7z" - G_EXEC rm "nanopi$series.7z" - local loopdev=$(losetup -f) rootdev=$(lsblk -npo PKNAME "$G_ROOTFS_DEV") - G_EXEC losetup "$loopdev" "nanopi$series.img" - G_EXEC partprobe "$loopdev" - G_EXEC partx -u "$loopdev" - if [[ ! -b ${loopdev}p8 ]] - then - G_DIETPI-NOTIFY 1 "Image invalid: ${loopdev}p8 does not exist, aborting kernel upgrade ..." - - elif [[ ${rootdev}p8 != "$G_ROOTFS_DEV" ]] - then - G_DIETPI-NOTIFY 1 "Unsupported system: ${rootdev}p8 != $G_ROOTFS_DEV, aborting kernel upgrade ..." - else - G_EXEC curl -sSfO "https://dietpi.com/downloads/binaries/firmware-nanopi$series.deb" - G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold "firmware-nanopi$series.deb" - for i in {1..7} - do - G_EXEC dd if="${loopdev}p$i" of="${rootdev}p$i" bs=1M - done - G_EXEC sync - G_EXEC rm "firmware-nanopi$series.deb" - fi - G_EXEC losetup -d "$loopdev" - G_EXEC rm "nanopi$series.img" - fi - # Software updates and migrations if [[ -f '/boot/dietpi/.installed' ]] then @@ -1510,8 +1472,57 @@ Patch_9_1() G_EXEC rm /etc/kernel/postinst.d/dietpi-USBridgeSig fi + # Software updates and migrations + if [[ -f '/boot/dietpi/.installed' ]] + then + # Nextcloud + # - Nginx + if [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' ]] + then + # shellcheck disable=SC2016 + echo '# Set the "immutable" cache control option for assets with a cache busting "v=" argument +map $arg_v $asset_immutable { + "" ""; + default ", immutable"; +}' > /etc/nginx/conf.d/dietpi-nextcloud.conf + G_EXEC mv /etc/nginx/sites-dietpi/dietpi-nextcloud.conf /etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-old + G_EXEC curl -sSfo /etc/nginx/sites-dietpi/dietpi-nextcloud.conf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_114/nginx.nextcloud.conf" + [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-new' ]] && G_EXEC rm /etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-new + fi + + # GMediaRender: https://dietpi.com/forum/t/gmediarender-default-args-on-allo-image-for-raspberry-pi/19205 + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[163\]=2' /boot/dietpi/.installed && grep -q ' -f -I ' /etc/default/gmediarender + then + G_DIETPI-NOTIFY 2 'Fixing default GMediaRender command arguments' + G_EXEC sed -i "s/ -f -I / -f $HOSTNAME -I /" /etc/default/gmediarender + fi + + # OctoPrint: https://github.com/MichaIng/DietPi/issues/6915 + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[153\]=2' /boot/dietpi/.installed && grep -q ', reboot, poweroff' /etc/sudoers.d/octoprint + then + G_DIETPI-NOTIFY 2 'Fixing OctoPrint sudoers rule' + # shellcheck disable=SC2230 + G_EXEC sed -i "s|, reboot, poweroff|, $(which reboot), $(which poweroff)|" /etc/sudoers.d/octoprint + fi + fi +} + +Patch_9_2() +{ + # NanoPi R4S: Solve Ethernet adapter disappearing on soft reboot: https://github.com/MichaIng/DietPi/issues/6342 + if (( $G_HW_MODEL == 47 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-current-rockchip64 2> /dev/null)" lt-nl 24.2.0 + then + G_DIETPI-NOTIFY 2 'Updating NanoPi R4S kernel ...' + G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb 'https://dietpi.com/downloads/binaries/linux-image-current-rockchip64.deb' + G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb 'https://dietpi.com/downloads/binaries/linux-dtb-current-rockchip64.deb' + G_EXEC_OUTPUT=1 G_EXEC curl -fo package3.deb 'https://dietpi.com/downloads/binaries/armbian-firmware.deb' + local headers=() + dpkg-query -s 'linux-headers-current-rockchip64' &> /dev/null && { G_EXEC_OUTPUT=1 G_EXEC curl -fo package4.deb 'https://dietpi.com/downloads/binaries/linux-headers-current-rockchip64.deb'; headers=('package4.deb'); } + G_EXEC_OUTPUT=1 G_EXEC dpkg -i --force-confdef,confold package1.deb package2.deb package3.deb "${headers[@]}" + G_EXEC rm package1.deb package2.deb package3.deb "${headers[@]}" + # Quartz64 - if (( $G_HW_MODEL == 49 )) + elif (( $G_HW_MODEL == 49 )) then for i in quartz64{a,b} soquartz do @@ -1524,7 +1535,7 @@ Patch_9_1() done # VisionFive 2 - elif (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.78-dietpi1 + elif (( $G_HW_MODEL == 81 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-visionfive2 2> /dev/null)" lt-nl 6.1.81-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' @@ -1532,7 +1543,7 @@ Patch_9_1() G_EXEC rm package.deb # Star64 - elif (( $G_HW_MODEL == 84 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-star64 2> /dev/null)" lt-nl 6.1.78-dietpi1 + elif (( $G_HW_MODEL == 84 )) && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' linux-image-star64 2> /dev/null)" lt-nl 6.1.81-dietpi1 then G_DIETPI-NOTIFY 2 'Updating RISC-V PINE64 Star64 kernel ...' G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/linux-image-star64.deb' @@ -1545,36 +1556,29 @@ Patch_9_1() then # Nextcloud # - Nginx - if [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' ]] - then - # shellcheck disable=SC2016 - echo '# Set the "immutable" cache control option for assets with a cache busting "v=" argument -map $arg_v $asset_immutable { - "" ""; - default ", immutable"; -}' > /etc/nginx/conf.d/dietpi-nextcloud.conf - G_EXEC mv /etc/nginx/sites-dietpi/dietpi-nextcloud.conf /etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-old - G_EXEC curl -sSfo /etc/nginx/sites-dietpi/dietpi-nextcloud.conf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.conf/dps_114/nginx.nextcloud.conf" - [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-new' ]] && G_EXEC rm /etc/nginx/sites-dietpi/dietpi-nextcloud.conf.dietpi-new - fi - - # GMediaRender: https://dietpi.com/forum/t/gmediarender-default-args-on-allo-image-for-raspberry-pi/19205 - if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[163\]=2' /boot/dietpi/.installed && grep -q ' -f -I ' /etc/default/gmediarender + if [[ -f '/etc/nginx/sites-dietpi/dietpi-nextcloud.conf' ]] && ! grep -q 'include mime.types;' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf then - G_DIETPI-NOTIFY 2 'Fixing default GMediaRender command arguments' - G_EXEC sed -i "s/ -f -I / -f $HOSTNAME -I /" /etc/default/gmediarender + G_DIETPI-NOTIFY 2 'Fixing Nextclound Nginx config ...' + G_EXEC sed -i '/types {/i\\tinclude mime.types;' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf fi - # OctoPrint: https://github.com/MichaIng/DietPi/issues/6915 - if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[153\]=2' /boot/dietpi/.installed && grep -q ', reboot, poweroff' /etc/sudoers.d/octoprint + # PaperMC + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[36\]=2' /boot/dietpi/.installed then - G_DIETPI-NOTIFY 2 'Fixing OctoPrint sudoers rule' - # shellcheck disable=SC2230 - G_EXEC sed -i "s|, reboot, poweroff|, $(which reboot), $(which poweroff)|" /etc/sudoers.d/octoprint + if [[ -f '/mnt/dietpi_userdata/papermc/plugins/floodgate-bukkit.jar' ]] + then + G_DIETPI-NOTIFY 2 'Renaming Floodgate plugin file to correct Spigot edition name ...' + G_EXEC mv /mnt/dietpi_userdata/papermc/plugins/floodgate-{bukkit,spigot}.jar + fi + if [[ -f '/mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot/config.yml' ]] && grep -q '^auth-type: floodgate' /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot/config.yml + then + G_DIETPI-NOTIFY 2 'Fixing Geyser plugin config ...' + G_EXEC sed -i 's/^auth-type: floodgate/ auth-type: floodgate/' /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot/config.yml + fi fi # Squeezelite - if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[36\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' squeezelite 2> /dev/null)" lt 2.0.0-1465-dietpi1 + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[36\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' squeezelite 2> /dev/null)" lt 2.0.0-1468-dietpi1 then G_DIETPI-NOTIFY 2 'Updating Squeezelite package ...' G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/squeezelite_$G_HW_ARCH_NAME.deb" @@ -1582,15 +1586,8 @@ map $arg_v $asset_immutable { G_EXEC rm package.deb fi - # Amiberry - if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[108\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' amiberry 2> /dev/null)" lt 5.6.6-dietpi1 - then - G_DIETPI-NOTIFY 2 'Preparing Amiberry upgrade to v5.6.6, including migration for RPi systems from fake KMS DispmanX to full KMS SDL2 graphics backend' - echo 108 >> /var/tmp/dietpi/dietpi-update_reinstalls - fi - # vaultwarden - if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[183\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' vaultwarden 2> /dev/null)" lt 1.30.3-dietpi2 + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[183\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' vaultwarden 2> /dev/null)" lt 1.30.5-dietpi1 then # Pre-v8.7 cleanup if [[ -f '/opt/vaultwarden/target/release/vaultwarden' ]] @@ -1603,6 +1600,13 @@ map $arg_v $asset_immutable { G_AGI ./package.deb G_EXEC rm package.deb fi + + # Amiberry + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[108\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' amiberry 2> /dev/null)" lt 5.6.8-dietpi1 + then + G_DIETPI-NOTIFY 2 'Preparing Amiberry upgrade to v5.6.8' + echo 108 >> /var/tmp/dietpi/dietpi-update_reinstalls + fi fi } diff --git a/.update/version b/.update/version index 2ed96d2b8b..a19ad9e36f 100644 --- a/.update/version +++ b/.update/version @@ -2,7 +2,7 @@ # shellcheck disable=SC2034 # Available DietPi version G_REMOTE_VERSION_CORE=9 -G_REMOTE_VERSION_SUB=1 +G_REMOTE_VERSION_SUB=2 G_REMOTE_VERSION_RC=1 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=7 @@ -14,6 +14,6 @@ G_MIN_DEBIAN=6 # Alternative Git branch to automatically migrate to when Debian version is too low G_OLD_DEBIAN_BRANCH='8' # Live patches -G_LIVE_PATCH_DESC=('Fix Nextcloud Nginx config, serving wrong MIME types') -G_LIVE_PATCH_COND=('[[ -f /etc/nginx/sites-dietpi/dietpi-nextcloud.conf ]] && ! grep -q '\''include mime.types;'\'' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf') -G_LIVE_PATCH=('sed -i '\''/types {/i\\tinclude mime.types;'\'' /etc/nginx/sites-dietpi/dietpi-nextcloud.conf; systemctl -q is-active nginx && systemctl restart nginx') +G_LIVE_PATCH_DESC=() +G_LIVE_PATCH_COND=() +G_LIVE_PATCH=() diff --git a/BRANCH_SYSTEM.md b/BRANCH_SYSTEM.md index 57c7836b22..d67502152b 100644 --- a/BRANCH_SYSTEM.md +++ b/BRANCH_SYSTEM.md @@ -14,12 +14,11 @@ By joining the Beta and reporting issues, you will be assisting DietPi (and all 1. Recommended: Backup your system with `dietpi-backup` (or backup quickly with `dietpi-backup 1`). 2. Run the following command to switch to "beta" branch: ```sh - G_CONFIG_INJECT 'DEV_GITBRANCH=' 'DEV_GITBRANCH=beta' /boot/dietpi.txt + G_DEV_BRANCH beta ``` -3. Run `dietpi-update` to update the system, then reboot (or update quickly with `dietpi-update 1`). -4. Test away, please report any issues on our GitHub page. Also ensure you mention "beta branch" in your post: https://github.com/MichaIng/DietPi/issues -5. If you want to return the system to the previous restore state, run `dietpi-backup` to restore (or restore quickly with `dietpi-backup -1`). +3. Test away, please report any issues on our GitHub page. Also ensure you mention "beta branch" in your post: https://github.com/MichaIng/DietPi/issues +4. If you want to return the system to the previous restore state, run `dietpi-backup` to restore (or restore quickly with `dietpi-backup -1`). ## Steps to use the DietPi "dev" branch #### This is the active development branch. It is potentially unstable, unsupported and should not be used by end users. -1. Same as above, however, use `DEV_GITBRANCH=dev` instead. +1. Same as above, however, use `G_DEV_BRANCH dev` instead. diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 45d278fb6c..3d333f37e3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,8 +1,31 @@ +v9.2 +(2024-03-16) + +Enhancements: +- DietPi-Banner | Support for showing the current RAM usage was added. Many thanks to @Andr3Carvalh0 for the implementation: https://github.com/MichaIng/DietPi/pull/6844 +- DietPi-Software | It is now possible to run "dietpi-software list" concurrent to other dietpi-software instances, and as non-root user. This avoids an issue in DietPi-Dashboard, where opening dietpi-software in the Terminal and switching to the Software page, caused an infinite hang. +- DietPi-Software | Gogs/Gitea: Using repositories via SSH should now work OOTB with new installs and reinstalls. If pull or push operations via SSH fail in your case, try to give the respective user a default shell: "sudo usermod -s /bin/dash gogs" respectively "sudo usermod -s /bin/dash gitea". This is now included in our default setup. Many thanks to @din14970 for reporting this missing feature: https://github.com/MichaIng/DietPi/discussions/6964#discussioncomment-8813390 + +Bug fixes: +- NanoPi R4S | Resolved an issue where Ethernet adapter of the "LAN" port could disappear after a soft reboot. Many thanks to @idaanx for reporting this issue: https://github.com/MichaIng/DietPi/issues/6342 +- DietPi-Globals | Resolved an issue where a concurrent DietPi script detection could have prevented the start of a script, if a previous instance was killed via SIGKILL. +- DietPi-Config | Resolved an issue where a WiFi connection, configured for the first time via dietpi-config from a local terminal session, was automatically stopped when exiting or logging out from the terminal session. +- DietPi-Config | Resolved an issue on RPi systems, where HDMI audio did not work if full KMS was enabled. The firmware/bcm2835 HDMI audio driver conflicts with the full KMS display driver, hence the VC4 HDMI driver needs to be used instead. That one however only supports the IEC958 audio format, which requires a complex ALSA config. This config is shipped with the "libasound2-data" package of the RPi APT repository, but it was overwritten by our /etc/asound.conf. For HDMI audio to work with KMS, the "default" or "sysdefault" ALSA PCM needs to be used by players. This is usually the case, but some allow to select a specific sound card, in which case the ALSA config and plugin for IEC958 conversion is bypassed, breaking HDMI audio. Many thanks to @Lollly2997 for reporting this issue. We are working with Amiberry on a solution for Amiberry in particular. This fix is for the underlying system level: https://dietpi.com/forum/t/19568 +- DietPi-Software | PaperMC: Resolved an issue where installing the Geyser and Floodgate plugins failed due to changed download URLs, and a false syntax in the Geyser config file. Many thanks to @boterocamilo for reporting this issue: https://github.com/MichaIng/DietPi/issues/6898 +- DietPi-Software | Nextcloud: Resolved an issue with the updated Nginx config where assets were served with the wrong MIME type. This fix was backported to v9.1 and a live patch offered. Many thanks to @howardroark for reporting this issue: https://dietpi.com/forum/t/nextcloud-theme-broken-after-upgrade-v9-1-1/19372 +- DietPi-Software | Home Assistant: Resolved an issue on x86_64 and ARMv8 systems where some core integrations did not work if no C++ compiler was installed. If you are affected by this, "apt install g++ && systemctl restart home-assistant" will fix it. Many thanks to @pdsakurai for fixing this issue in our install code: https://github.com/MichaIng/DietPi/pull/6931 +- DietPi-Software | DarkIce: Resolved an issue where the service failed to start due to false config file permissions. +- DietPi-Software | LXQt: Resolved an issue where the installation failed on Trixie and RISC-V systems, since we did not host a config archive for those Debian versions yet. Many thanks to @jtmoon79 for reporting this issue: https://github.com/MichaIng/DietPi/issues/6939 + +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/6955 + +----------------------------------------------------------------------------------------------------------- + v9.1 -(2024-02-17) +(2024-02-19) New images: -- Raspberry Pi 5 | Images for Raspberry Pi 5 and other Raspberry Pi models, based on the new Bookworm kernel and firmware package set from Raspberry Pi Ltd, are now available for testing. Note that some features, like changing screen resolution and camera module support, are not working yet: https://dietpi.com/downloads/binaries/testing/ +- Raspberry Pi 5 | Images for Raspberry Pi 5 and other Raspberry Pi models, based on the new Bookworm kernel and firmware package set from Raspberry Pi Ltd, are now available for testing. Note that some features, like changing screen resolution and camera module support, are not working yet: https://dietpi.com/downloads/images/testing/ - ROCK 4 SE | Since our Radxa ROCK 4 image has become incompatible with the ROCK 4 SE variant, we provide a new image for this particular variant. Many thanks to @janno for reporting failing boot on this SBC: https://dietpi.com/forum/t/radxa-rock-4-se-supported-not-booting/19263 - NanoPi R5S/R5C/R6S/R6C/T6 | Our new images for these SBCs use kernel and bootloader builds generated with the Armbian build system. This means that they have a single ext4 partition with kernel image, overlays and boot configuration located below /boot as usual. The kernel command-line arguments can hence be adjusted, kernel headers installed for compiling modules, and the kernel features are more streamlined with other SBCs. The R5S/R5C images ship with a much newer mainline Linux build, which means more modern kernel features and better code quality. But some edge case hardware features which have not been upstreamed may not work, like support for Rockchip's Media Process Platform (MPP) module, used for hardware-accelerated video encoding/decoding by some media servers/players. We are also testing the migration from our old images to the new kernel and bootloader packages, and will likely offer this with next DietPi update. diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index 28231fd14c..e93be67e13 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1930,23 +1930,26 @@ If unsure, set any value, 'Ondemand Down Factor' option on the next screen will \nThis will free up space, but an internet-capable Ethernet connection is required to re-enable WiFi functionality. \nAffected packages: iw wireless-tools wpasupplicant wireless-regdb crda' && G_AGP 'iw' 'wireless-tools' 'wpasupplicant' 'wireless-regdb' 'crda' - # Drop connections - G_DIETPI-NOTIFY 2 'Dropping network connections, please wait...' - ifdown --force "$ETH_DEV_IFACE" 2> /dev/null - ifdown --force "$WIFI_DEV_IFACE" 2> /dev/null - - # Kill DHCP client - killall dhclient 2> /dev/null - # Restart network G_DIETPI-NOTIFY 2 'Restarting network connections, please wait...' G_EXEC systemctl daemon-reload - - # Manually bring up adapters - (( $ETH_DISABLED )) || ifup --force "$ETH_DEV_IFACE" - if (( ! $WIFI_DISABLED )) + # - Ethernet + if (( ! $ETH_DISABLED )) then - (( $WIFI_HOTSPOT )) || grep -q '^network=' /etc/wpa_supplicant/wpa_supplicant.conf && ifup --force "$WIFI_DEV_IFACE" + journalctl -fn 0 -u "ifup@$ETH_DEV_IFACE" & + G_EXEC_NOHALT=1 G_EXEC_OUTPUT=1 G_EXEC systemctl restart "ifup@$ETH_DEV_IFACE" + kill -15 %% + else + ifdown --force "$ETH_DEV_IFACE" 2> /dev/null + fi + # - WiFi: Only try to configure if this is either a hotspot or an SSID has been configured + if (( ! $WIFI_DISABLED )) && { (( $WIFI_HOTSPOT )) || grep -q '^network=' /etc/wpa_supplicant/wpa_supplicant.conf; } + then + journalctl -fn 0 -u "ifup@$WIFI_DEV_IFACE" & + G_EXEC_NOHALT=1 G_EXEC_OUTPUT=1 G_EXEC systemctl restart "ifup@$WIFI_DEV_IFACE" + kill -15 %% + else + ifdown --force "$WIFI_DEV_IFACE" 2> /dev/null fi # Start WiFi hotspot @@ -2287,14 +2290,14 @@ NB: All Ethernet connections will be temporarily dropped!' && Network_ApplyChang do if (( $i < $full_octets )) then - mask+=255 + mask+='255' elif (( $i == $full_octets )) then mask+=$(( 256 - 2 ** ( 8 - $partial_octet ) )) else - mask+=0 + mask+='0' fi (( $i < 3 )) && mask+=. done diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 29332d9748..4bab90acda 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -26,9 +26,12 @@ Available commands: # Import DietPi-Globals --------------------------------------------------------------- . /boot/dietpi/func/dietpi-globals readonly G_PROGRAM_NAME='DietPi-Software' - G_CHECK_ROOT_USER - G_CHECK_ROOTFS_RW - G_INIT + if [[ $1 != 'list' ]] + then + G_CHECK_ROOT_USER + G_CHECK_ROOTFS_RW + G_INIT + fi # Import DietPi-Globals --------------------------------------------------------------- [[ $1 == 'list' && $2 == '--machine-readable' ]] && MACHINE_READABLE=1 || MACHINE_READABLE= @@ -460,7 +463,7 @@ Available commands: aSOFTWARE_DEPS[$software_id]='88 89 128 195 webserver' #------------------ software_id=135 - aSOFTWARE_NAME[$software_id]='IceCast' + aSOFTWARE_NAME[$software_id]='Icecast' aSOFTWARE_DESC[$software_id]='Shoutcast streaming server (+DarkIce)' aSOFTWARE_CATX[$software_id]=2 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/media/#icecast' @@ -3146,7 +3149,11 @@ _EOF_ if To_Install 173 # LXQt then - G_AGI lxqt qterminal xarchiver lxde-icon-theme upower xscreensaver featherpad speedcrunch + # SpeedCrunch is currently not present on Trixie: https://tracker.debian.org/pkg/speedcrunch + local speedcrunch=('speedcrunch') + (( $G_DISTRO == 8 )) && speedcrunch=() + # lxqt-archiver is the default dependency from Trixie on, but our config uses Archiver=xarchiver. + G_AGI lxqt xarchiver xscreensaver "${speedcrunch[@]}" # Configs Download_Install "https://github.com/$G_GITOWNER/DietPi/raw/$G_GITBRANCH/.conf/desktop/lxqt/lxqt-$G_DISTRO_NAME.7z" /etc/xdg/ @@ -3224,12 +3231,12 @@ _EOF_ if To_Install 30 # NoMachine then - local version='8.10.1_1' # https://downloads.nomachine.com/ + 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";; - *) local url="Linux/nomachine_${version}_amd64";; + *) version='8.11.3_4'; local url="Linux/nomachine_${version}_amd64";; esac Download_Install "https://download.nomachine.com/download/${version%.*}/$url.deb" aSTART_SERVICES+=('nxserver') @@ -5538,20 +5545,38 @@ _EOF_ G_EXEC chown -R www-data:www-data /var/www/ompd/{tmp,stream,cache} fi - if To_Install 135 icecast2 darkice # IceCast + DarkIce + if To_Install 135 icecast2 darkice # Icecast + DarkIce then G_AGI darkice icecast2 G_EXEC systemctl stop darkice icecast2 - # IceCast: Set passwords if not yet done (default found) + # Icecast + # - Config: Set passwords if not yet done (default found) sed --follow-symlinks -i "/hackme/c\ $GLOBAL_PW" /etc/icecast2/icecast.xml sed --follow-symlinks -i "/hackme/c\ $GLOBAL_PW" /etc/icecast2/icecast.xml sed --follow-symlinks -i "/hackme/c\ $GLOBAL_PW" /etc/icecast2/icecast.xml - # - Remove default service config - [[ -f '/etc/default/icecast2' ]] && G_EXEC rm /etc/default/icecast2 + # - Service: Replace init.d service with native systemd service + Remove_SysV icecast2 1 + cat << _EOF_ > /etc/systemd/system/icecast2.service +[Unit] +Description=Icecast (DietPi) +Wants=network-online.target +After=network-online.target +[Service] +User=icecast2 +Group=icecast +ExecStart=/usr/bin/icecast2 -c /etc/icecast2/icecast.xml + +[Install] +WantedBy=multi-user.target +_EOF_ # DarkIce + # - User + Create_User -g audio -G dietpi darkice + # - Config [[ -f '/etc/darkice.cfg' ]] || > /etc/darkice.cfg + G_EXEC chown darkice:root /etc/darkice.cfg G_EXEC chmod 0600 /etc/darkice.cfg local input_device_index=$(arecord -l | mawk -F'[ :]' '/card/{print $2;exit}') cat << _EOF_ > /etc/darkice.cfg @@ -5561,7 +5586,7 @@ bufferSecs = 3 reconnect = yes [input] -device = hw:$input_device_index,0 +device = hw:${input_device_index:-0},0 sampleRate = 44100 bitsPerSample = 16 channel = 1 @@ -5581,17 +5606,17 @@ genre = none public = no #localDumpFile = /mnt/dietpi_userdata/darkice_recording.ogg _EOF_ + # - Service: Replace init.d service with native systemd service Remove_SysV darkice 1 cat << _EOF_ > /etc/systemd/system/darkice.service [Unit] Description=DarkIce (DietPi) -Requires=icecast2.service After=icecast2.service [Service] -User=nobody -Group=dietpi -ExecStart=$(command -v darkice) +User=darkice +AmbientCapabilities=CAP_SYS_NICE +ExecStart=/usr/bin/darkice [Install] WantedBy=multi-user.target @@ -6147,6 +6172,7 @@ SyslogIdentifier=Airsonic User=airsonic WorkingDirectory=/mnt/dietpi_userdata/airsonic ExecStart=/usr/bin/java -Xmx${memory_limit}m -Dairsonic.home=/mnt/dietpi_userdata/airsonic -Dserver.servlet.context-path=/airsonic -Dserver.port=8080 -jar /mnt/dietpi_userdata/airsonic/airsonic.war +SuccessExitStatus=143 [Install] WantedBy=multi-user.target @@ -6475,7 +6501,7 @@ _EOF_ esac # Download - local fallback_url="https://github.com/fatedier/frp/releases/download/v0.54.0/frp_0.54.0_linux_$arch.tar.gz" + local fallback_url="https://github.com/fatedier/frp/releases/download/v0.55.1/frp_0.55.1_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_* @@ -6769,6 +6795,7 @@ User=blynk LogsDirectory=blynk WorkingDirectory=/mnt/dietpi_userdata/blynk ExecStart=/usr/bin/java$log4shell -jar /mnt/dietpi_userdata/blynk/blynkserver.jar +SuccessExitStatus=143 # Hardening PrivateTmp=true @@ -6835,7 +6862,7 @@ _EOF_ # Cleanup G_EXEC rm -R WebIOPi-master - # On fresh installs, change port to 8002 to avoid conflict with IceCast + # On fresh installs, change port to 8002 to avoid conflict with Icecast (( $reinstall )) || G_EXEC sed --follow-symlinks -i 's/^port = 8000$/port = 8002/' /etc/webiopi/config # Service @@ -7080,7 +7107,7 @@ _EOF_ G_AGI realvnc-vnc-server libraspberrypi0 # Depends on libbcm_host.so but does not pull libraspberrypi0 as dependency fi - # TigerVNC/RealVNC Server - Shared setup + # TigerVNC/RealVNC Server: Shared setup if (( ${aSOFTWARE_INSTALL_STATE[28]} == 1 || ${aSOFTWARE_INSTALL_STATE[120]} == 1 )) then # Service @@ -7104,9 +7131,6 @@ WantedBy=multi-user.target _EOF_ aSTART_SERVICES+=('vncserver') - # RealVNC: Assure that its services are disabled when ours is enabled - (( ${aSOFTWARE_INSTALL_STATE[120]} == 1 )) && G_EXEC systemctl --no-reload disable vncserver-virtuald vncserver-x11-serviced - cat << '_EOF_' > /usr/local/bin/vncserver #!/bin/dash @@ -7120,8 +7144,7 @@ elif [ -f '/usr/bin/tigervncserver' ] then echo '[ OK ] TigerVNC detected' FP_BINARY='/usr/bin/tigervncserver' - [ -f '/usr/bin/X0tigervnc' ] && FP_SHARED='/usr/bin/X0tigervnc' || FP_SHARED='/usr/bin/x0tigervncserver' - FP_SHARED="$FP_SHARED -display :0 -rfbauth $HOME/.vnc/passwd" + FP_SHARED="/usr/bin/X0tigervnc -display :0 -rfbauth $HOME/.vnc/passwd" else echo '[FAILED] No supported VNC server installed' exit 1 @@ -7150,9 +7173,9 @@ case "$1" in WIDTH=$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_WIDTH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) HEIGHT=$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_HEIGHT=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) DEPTH=$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DEPTH=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - echo "[ INFO ] Starting virtual desktop at display :${DISPLAY:-1} in ${WIDTH:-1280}x${HEIGHT:-720}x${DEPTH:-16}" + echo "[ INFO ] Starting virtual desktop at display :${DISPLAY:=1} in ${WIDTH:=1280}x${HEIGHT:=720}x${DEPTH:=16}" export SHELL='/bin/bash' - exec $FP_BINARY ":${DISPLAY:-1}" -geometry "${WIDTH:-1280}x${HEIGHT:-720}" -depth "${DEPTH:-16}" + exec $FP_BINARY ":$DISPLAY" -geometry "${WIDTH}x$HEIGHT" -depth "$DEPTH" fi ;; @@ -7161,13 +7184,13 @@ case "$1" in if grep -q '^[[:blank:]]*SOFTWARE_VNCSERVER_SHARE_DESKTOP=1' /boot/dietpi.txt then echo '[ INFO ] Disconnecting from shared desktop' - killall -qw vncserver-x11-core x0tigervncserver X0tigervnc + killall -qw vncserver-x11-core X0tigervnc # Virtual desktop mode else DISPLAY=$(sed -n '/^[[:blank:]]*SOFTWARE_VNCSERVER_DISPLAY_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - echo "[ INFO ] Stopping virtual desktop at display :${DISPLAY:-1}" - $FP_BINARY -kill ":${DISPLAY:-1}" + echo "[ INFO ] Stopping virtual desktop at display :${DISPLAY:=1}" + $FP_BINARY -kill ":$DISPLAY" fi ;; @@ -7182,26 +7205,38 @@ exit 0 _EOF_ G_EXEC chmod +x /usr/local/bin/vncserver - # TigerVNC: Permit remote connections which implies TLSVnc authentications being enabled additionally - # shellcheck disable=SC2016 - (( ${aSOFTWARE_INSTALL_STATE[28]} == 1 )) && GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/tigervnc/vncserver-config-defaults - - # TigerVNC: Set control + read-only passwords - if [[ ${aSOFTWARE_INSTALL_STATE[28]} == 1 && ! -f '/root/.vnc/passwd' ]] + # TigerVNC + if (( ${aSOFTWARE_INSTALL_STATE[28]} == 1 )) then - G_EXEC mkdir -p /root/.vnc - tigervncpasswd -f <<< "$GLOBAL_PW + # TigerVNC: Permit remote connections which implies TLSVnc authentications being enabled additionally + # shellcheck disable=SC2016 + GCI_PRESERVE=1 G_CONFIG_INJECT '\$localhost[[:blank:]]*=' '$localhost = "no";' /etc/tigervnc/vncserver-config-defaults + + # Set control + read-only passwords + if [[ ! -f '/root/.vnc/passwd' ]] + then + G_EXEC mkdir -p /root/.vnc + tigervncpasswd -f <<< "$GLOBAL_PW $GLOBAL_PW" > /root/.vnc/passwd - G_EXEC chmod 600 /root/.vnc/passwd + G_EXEC chmod 600 /root/.vnc/passwd + fi fi - # RealVNC: Set virtual + shared desktop passwords, repeat virtual password command two times: https://github.com/MichaIng/DietPi/pull/4679#issuecomment-908196511 - if [[ ${aSOFTWARE_INSTALL_STATE[120]} == 1 && ! -s '/root/.vnc/config.d/Xvnc' ]] + # RealVNC + if (( ${aSOFTWARE_INSTALL_STATE[120]} == 1 )) then - vncpasswd -virtual <<< "$GLOBAL_PW + # Assure that its services are disabled when ours is enabled + G_EXEC systemctl --no-reload disable vncserver-virtuald vncserver-x11-serviced + + # Set (+verify) virtual + shared desktop passwords: https://github.com/MichaIng/DietPi/pull/4679#issuecomment-908196511 + if [[ ! -s '/root/.vnc/config.d/Xvnc' ]] + then + vncpasswd -virtual <<< "$GLOBAL_PW $GLOBAL_PW" - vncpasswd -service <<< "$GLOBAL_PW + vncpasswd -service <<< "$GLOBAL_PW $GLOBAL_PW" + fi + [[ -f '/root/.vnc/config.d/.Xvnc-v5-marker' ]] || > /root/.vnc/config.d/.Xvnc-v5-marker fi fi @@ -7371,6 +7406,7 @@ User=ubooquity LogsDirectory=ubooquity WorkingDirectory=/mnt/dietpi_userdata/ubooquity ExecStart=/usr/bin/java -Xmx${memory_limit}m -jar /mnt/dietpi_userdata/ubooquity/Ubooquity.jar --headless --remoteadmin --adminport 2038 --libraryport 2039 +SuccessExitStatus=143 [Install] WantedBy=multi-user.target @@ -7389,7 +7425,7 @@ _EOF_ then Download_Install 'https://github.com/gotson/komga/releases/download/v0.165.0/komga-0.165.0.jar' /mnt/dietpi_userdata/komga/komga.jar else - local fallback_url='https://github.com/gotson/komga/releases/download/1.10.3/komga-1.10.3.jar' + local fallback_url='https://github.com/gotson/komga/releases/download/1.10.4/komga-1.10.4.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 @@ -7432,6 +7468,7 @@ SyslogIdentifier=Komga User=komga WorkingDirectory=/mnt/dietpi_userdata/komga ExecStart=/usr/bin/java -Xmx${memory_limit}m -jar komga.jar +SuccessExitStatus=143 [Install] WantedBy=multi-user.target @@ -7484,7 +7521,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.2.1/ampache-6.2.1_all_php$PHP_VERSION.zip" + local fallback_url="https://github.com/ampache/ampache/releases/download/6.3.0/ampache-6.3.0_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 @@ -8364,68 +8401,6 @@ Environment="SHELL=/bin/bash" "HOME=/root" ExecStart=$(command -v node) webui.js KillMode=process -[Install] -WantedBy=multi-user.target -_EOF_ - fi - - if To_Install 49 gogs # Gogs - then - # ARMv6/RISC-V: No pre-compiled binaries available, so we host our own. - if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 11 )) - then - local url="https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/gogs_$G_HW_ARCH_NAME.7z" - - # Else install latest binaries from GitHub - else - case $G_HW_ARCH in - 2) local arch='armv7';; - 3) local arch='armv8';; - *) local arch='amd64';; - esac - - local fallback_url="https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_$arch.tar.gz" - local url=$(curl -sSfL 'https://api.github.com/repos/gogs/gogs/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/gogs_[^\"\/]*_linux_$arch.tar.gz\"$/{print \$4}") - fi - - Download_Install "$url" - G_EXEC mkdir -p /etc/gogs - G_EXEC mv gogs/gogs /etc/gogs/gogs - G_EXEC rm -R gogs - - # Pre-v8.14: Remove unnecessary init scripts - [[ -d '/etc/gogs/scripts' ]] && G_EXEC rm -R /etc/gogs/scripts - - # User - Create_User -d /etc/gogs gogs - - # Directories + permissions - G_EXEC mkdir -p /mnt/dietpi_userdata/gogs-repo - G_EXEC chown -R gogs:gogs /etc/gogs /mnt/dietpi_userdata/gogs-repo - - # Database - /boot/dietpi/func/create_mysql_db gogs gogs "$GLOBAL_PW" - - # Service: https://github.com/gogs/gogs/blob/main/scripts/systemd/gogs.service - cat << '_EOF_' > /etc/systemd/system/gogs.service -[Unit] -Description=Gogs (DietPi) -Wants=network-online.target -After=network-online.target mariadb.service - -[Service] -User=gogs -LogsDirectory=gogs -WorkingDirectory=/etc/gogs -ExecStart=/etc/gogs/gogs web - -# Hardening -ProtectSystem=full -PrivateDevices=yes -PrivateTmp=yes -NoNewPrivileges=true -ReadWritePaths=-/etc/gogs - [Install] WantedBy=multi-user.target _EOF_ @@ -8539,7 +8514,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.10'; 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.11'; 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 @@ -8930,7 +8905,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.27.3/syncthing-linux-$arch-v1.27.3.tar.gz" + local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.27.4/syncthing-linux-$arch-v1.27.4.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 @@ -9404,7 +9379,7 @@ _EOF_ G_EXEC_OUTPUT=1 G_EXEC sudo -u koel "php$PHP_VERSION" artisan koel:sync G_EXEC cd "$G_WORKING_DIR" - # Service: Run on port 8003 by default to avoid conflict with IceCast + # Service: Run on port 8003 by default to avoid conflict with Icecast cat << _EOF_ > /etc/systemd/system/koel.service [Unit] Description=Koel (DietPi) @@ -10051,7 +10026,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.19.2437/Readarr.develop.0.3.19.2437.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.20.2452/Readarr.develop.0.3.20.2452.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 @@ -10537,6 +10512,69 @@ After=network-online.target SyslogIdentifier=Nukkit WorkingDirectory=/usr/local/bin/nukkit ExecStart=/usr/bin/java -jar /usr/local/bin/nukkit/nukkit.jar +SuccessExitStatus=143 + +[Install] +WantedBy=multi-user.target +_EOF_ + fi + + if To_Install 49 gogs # Gogs + then + # ARMv6/RISC-V: No pre-compiled binaries available, so we host our own. + if (( $G_HW_ARCH == 1 || $G_HW_ARCH == 11 )) + then + local url="https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/gogs_$G_HW_ARCH_NAME.7z" + + # Else install latest binaries from GitHub + else + case $G_HW_ARCH in + 2) local arch='armv7';; + 3) local arch='armv8';; + *) local arch='amd64';; + esac + + local fallback_url="https://github.com/gogs/gogs/releases/download/v0.13.0/gogs_0.13.0_linux_$arch.tar.gz" + local url=$(curl -sSfL 'https://api.github.com/repos/gogs/gogs/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/gogs_[^\"\/]*_linux_$arch.tar.gz\"$/{print \$4}") + fi + + Download_Install "$url" + G_EXEC mkdir -p /etc/gogs + G_EXEC mv gogs/gogs /etc/gogs/gogs + G_EXEC rm -R gogs + + # Pre-v8.14: Remove unnecessary init scripts + [[ -d '/etc/gogs/scripts' ]] && G_EXEC rm -R /etc/gogs/scripts + + # User + Create_User -d /etc/gogs -s /bin/dash gogs + + # Directories + permissions + G_EXEC mkdir -p /mnt/dietpi_userdata/gogs-repo + G_EXEC chown -R gogs:gogs /etc/gogs /mnt/dietpi_userdata/gogs-repo + + # Database + /boot/dietpi/func/create_mysql_db gogs gogs "$GLOBAL_PW" + + # Service: https://github.com/gogs/gogs/blob/main/scripts/systemd/gogs.service + cat << '_EOF_' > /etc/systemd/system/gogs.service +[Unit] +Description=Gogs (DietPi) +Wants=network-online.target +After=network-online.target mariadb.service + +[Service] +User=gogs +LogsDirectory=gogs +WorkingDirectory=/etc/gogs +ExecStart=/etc/gogs/gogs web + +# Hardening +ProtectSystem=full +PrivateDevices=yes +PrivateTmp=yes +NoNewPrivileges=true +ReadWritePaths=-/etc/gogs [Install] WantedBy=multi-user.target @@ -10552,11 +10590,11 @@ _EOF_ *) local arch='arm-6';; esac - local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.21.5/gitea-1.21.5-linux-$arch.xz" + local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.21.8/gitea-1.21.8-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 - Create_User -d /mnt/dietpi_userdata/gitea gitea + Create_User -d /mnt/dietpi_userdata/gitea -s /bin/dash gitea # Permissions G_EXEC chown -R gitea:gitea /mnt/dietpi_userdata/gitea @@ -11205,8 +11243,8 @@ _EOF_ local custom_apt_deps=$(sed -n '/^[[:blank:]]*SOFTWARE_HOMEASSISTANT_APT_DEPS=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) local custom_pip_deps=$(sed -n '/^[[:blank:]]*SOFTWARE_HOMEASSISTANT_PIP_DEPS=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) # - All: gcc, libc6-dev, make, libssl-dev, zlib1g-dev for Python build and libbz2-dev, libreadline-dev, libsqlite3-dev, liblzma-dev to suppress warnings - # - All: libffi-dev to solve "ModuleNotFoundError: No module named '_ctypes'", for python-slugify==4.0.1 build on ARMv8/x86_64 and cffi build on ARMv6/7/RISC-V - aDEPS=('gcc' 'libc6-dev' 'make' 'libssl-dev' 'zlib1g-dev' 'libbz2-dev' 'libreadline-dev' 'libsqlite3-dev' 'liblzma-dev' 'libffi-dev') + # - All: libffi-dev to solve "ModuleNotFoundError: No module named '_ctypes'", for python-slugify==4.0.1 build on ARMv8/x86_64 and cffi build on ARMv6/7/RISC-V, g++ for webrtc-noise-gain + aDEPS=('gcc' 'g++' 'libc6-dev' 'make' 'libssl-dev' 'zlib1g-dev' 'libbz2-dev' 'libreadline-dev' 'libsqlite3-dev' 'liblzma-dev' 'libffi-dev') mapfile -t -d' ' -O "${#aDEPS[@]}" aDEPS < <(echo -n "$custom_apt_deps") # - ARMv6/7/RISC-V G_EXEC mkdir -p "$ha_home" @@ -11214,7 +11252,7 @@ _EOF_ if [[ $G_HW_ARCH =~ ^(1|2|11)$ ]] then # libjpeg62-turbo-dev for Pillow, libopenblas-dev and pkg-config for numpy, pkg-config for cryptography, g++ for PyTurboJPEG, SQLAlchemy and ninja > PyTurboJPEG, libavdevice-dev for ha-av, cmake for ninja > PyTurboJPEG, automake for patchelf > PyTurboJPEG - aDEPS+=('libjpeg62-turbo-dev' 'libopenblas-dev' 'pkg-config' 'g++' 'libavdevice-dev' 'cmake' 'automake') + aDEPS+=('libjpeg62-turbo-dev' 'libopenblas-dev' 'pkg-config' 'libavdevice-dev' 'cmake' 'automake') # Rust for cryptography and bcrypt G_EXEC curl -sSf 'https://sh.rustup.rs/' -o rustup-init.sh G_EXEC chmod +x rustup-init.sh @@ -11333,8 +11371,8 @@ _EOF_ G_WHIP_BUTTON_CANCEL_TEXT='Skip' if G_WHIP_YESNO 'Would you like to install the Geyser and Floodgate plugins for compatibility with Bedrock Edition?\n\nNote that this may be buggy.' then - Download_Install 'https://ci.opencollab.dev/job/GeyserMC/job/Geyser/job/master/lastStableBuild/artifact/bootstrap/spigot/build/libs/Geyser-Spigot.jar' /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot.jar - Download_Install 'https://ci.opencollab.dev/job/GeyserMC/job/Floodgate/job/master/lastStableBuild/artifact/spigot/build/libs/floodgate-spigot.jar' /mnt/dietpi_userdata/papermc/plugins/floodgate-bukkit.jar + Download_Install 'https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot' /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot.jar + Download_Install 'https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot' /mnt/dietpi_userdata/papermc/plugins/floodgate-spigot.jar fi # Minecraft rcon client for remote administration and server maintenance scripts @@ -11378,15 +11416,16 @@ User=papermc LogsDirectory=papermc WorkingDirectory=/mnt/dietpi_userdata/papermc ExecStart=/usr/bin/java -Xmx${heap_size}m -jar /opt/papermc/paperclip.jar --nogui --noconsole +SuccessExitStatus=143 [Install] WantedBy=multi-user.target _EOF_ # Config - if [[ -f '/mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot.jar' && -f '/mnt/dietpi_userdata/papermc/plugins/floodgate-bukkit.jar' ]] + if [[ -f '/mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot.jar' ]] then Create_Config /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot/config.yml papermc 1800 1 && - G_CONFIG_INJECT 'auth-type:[[:blank:]]' 'auth-type: floodgate' /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot/config.yml + G_CONFIG_INJECT 'auth-type:[[:blank:]]' ' auth-type: floodgate' /mnt/dietpi_userdata/papermc/plugins/Geyser-Spigot/config.yml else Create_Config /mnt/dietpi_userdata/papermc/permissions.yml papermc 1800 1 fi @@ -11395,7 +11434,7 @@ _EOF_ else aSOFTWARE_INSTALL_STATE[$software_id]=0 - G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} install aborted due to outstanding EULA agreement" + G_DIETPI-NOTIFY 2 "${aSOFTWARE_NAME[$software_id]} install skipped due to outstanding EULA agreement" fi fi @@ -11545,7 +11584,7 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/rclone/rclone/releases/download/v1.65.2/rclone-v1.65.2-linux-$arch.deb" + local fallback_url="https://github.com/rclone/rclone/releases/download/v1.66.0/rclone-v1.66.0-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 @@ -11559,7 +11598,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/restic/restic/releases/download/v0.15.2/restic_0.15.2_linux_$arch.bz2" + local fallback_url="https://github.com/restic/restic/releases/download/v0.16.4/restic_0.16.4_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 @@ -12153,7 +12192,7 @@ If no WireGuard (auto)start is included, but you require it, please do the follo then apt-mark auto qterminal xarchiver lxde-icon-theme upower xscreensaver leafpad featherpad speedcrunch 2> /dev/null G_AGP lxqt - rm -Rf /{root,home/*}/.config/lxqt + G_EXEC rm -Rf /{root,home/*}/.config/lxqt fi if To_Uninstall 174 # GIMP @@ -12192,6 +12231,7 @@ If no WireGuard (auto)start is included, but you require it, please do the follo if To_Uninstall 30 # NoMachine then G_AGP nomachine + G_EXEC rm -Rf /{root,home/*}/NoMachine fi if To_Uninstall 29 # XRDP @@ -13636,7 +13676,7 @@ _EOF_ Remove_Service docker # Packages, repo and key - G_AGP docker-ce docker-ce-cli docker-engine + G_AGP docker-ce docker-ce-cli docker.io [[ -f '/etc/apt/sources.list.d/docker.list' ]] && G_EXEC rm /etc/apt/sources.list.d/docker.list [[ -f '/etc/apt/trusted.gpg.d/dietpi-docker.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-docker.gpg @@ -14540,13 +14580,13 @@ _EOF_ do if (( $i < $full_octets )) then - mask+=255 + mask+='255' elif (( $i == $full_octets )) then mask+=$(( 256 - 2 ** ( 8 - $partial_octet ) )) else - mask+=0 + mask+='0' fi (( $i < 3 )) && mask+=. done @@ -15436,7 +15476,7 @@ List of installed software and their online documentation URLs: # Main Loop #///////////////////////////////////////////////////////////////////////////////////// # Abort if a reboot is required as of missing kernel modules - if (( $G_DIETPI_INSTALL_STAGE == 2 )) && ! G_CHECK_KERNEL + if [[ $1 != 'list' && $G_DIETPI_INSTALL_STAGE == 2 ]] && ! G_CHECK_KERNEL then G_WHIP_BUTTON_CANCEL_TEXT='Abort' G_WHIP_YESNO "[ INFO ] A reboot is required \nKernel modules for the loaded kernel at /lib/modules/$(uname -r) are missing. This is most likely the case as of a recently applied kernel upgrade where a reboot is required to load the new kernel. diff --git a/dietpi/func/dietpi-banner b/dietpi/func/dietpi-banner index c77958bc4b..e119656403 100755 --- a/dietpi/func/dietpi-banner +++ b/dietpi/func/dietpi-banner @@ -57,14 +57,15 @@ 'Large hostname' 'Print credits' 'Let'\''s Encrypt cert status' + 'RAM usage' ) # Set defaults: Disable CPU temp by default in VMs if (( $G_HW_MODEL == 20 )) then - aENABLED=(1 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 0) + aENABLED=(1 0 0 0 0 1 0 1 0 0 0 1 1 0 0 1 0 0) else - aENABLED=(1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0) + aENABLED=(1 0 1 0 0 1 0 0 0 0 0 1 1 0 0 1 0 0) fi COLOUR_RESET='\e[0m' @@ -237,6 +238,8 @@ $GREEN_LINE" (( ${aENABLED[1]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[1]} $GREEN_SEPARATOR $(uptime -p 2>&1)" # CPU temp (( ${aENABLED[2]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[2]} $GREEN_SEPARATOR $(print_full_info=1 G_OBTAIN_CPU_TEMP 2>&1)" + # RAM usage + (( ${aENABLED[17]} == 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[17]} $GREEN_SEPARATOR $(free -b | mawk 'NR==2 {CONVFMT="%.0f"; print $3/1024^2" of "$2/1024^2" MiB ("$3/$2*100"%)"}')" # Hostname (( ${aENABLED[3]} == 1 && ${aENABLED[14]} != 1 )) && echo -e "$GREEN_BULLET ${aCOLOUR[1]}${aDESCRIPTION[3]} $GREEN_SEPARATOR $( /boot/dietpi/.version readonly G_WORKING_DIR="/tmp/${G_PROGRAM_NAME}_$i" else # Concurrency not allowed: Use existing working directory as flag - local limit=${G_INIT_WAIT_CONCURRENT:-5} + readonly G_WORKING_DIR="/tmp/$G_PROGRAM_NAME" + G_INIT_WAIT_CONCURRENT=${G_INIT_WAIT_CONCURRENT:=5} - while [[ -d /tmp/$G_PROGRAM_NAME ]] + while [[ -d $G_WORKING_DIR ]] do - if (( $i < $limit )) + # SIGKILL prevents the exit trap from removing this dir. Remove it in this case and proceed. + [[ $(pidof -x "$0") == *' '* ]] || { rm -R "$G_WORKING_DIR"; break; } + if (( $i < $G_INIT_WAIT_CONCURRENT )) then ((i++)) - G_DIETPI-NOTIFY 2 "Concurrent execution of $G_PROGRAM_NAME detected, retrying... ($i/$limit)" + G_DIETPI-NOTIFY 2 "Concurrent execution of $G_PROGRAM_NAME detected, retrying... ($i/$G_INIT_WAIT_CONCURRENT)" G_SLEEP 1 else G_WHIP_BUTTON_OK_TEXT='Retry' @@ -121,14 +124,12 @@ Please check if one of the following applies: - You started this script from within another DietPi program, causing a loop.\n Please assure that the concurrent execution has finished, before retrying, otherwise cancel this instance.\n The following info might help: -$(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')" && continue +$(ps f -eo pid,user,tty,cmd | grep -i 'dietpi')" && continue G_DIETPI-NOTIFY 1 "Cancelled $G_PROGRAM_NAME due to concurrent execution" exit 1 fi done - - readonly G_WORKING_DIR="/tmp/$G_PROGRAM_NAME" fi # Declare exit trap which runs on EXIT signals, including SIGINT and SIGTERM but not SIGKILL! @@ -148,13 +149,8 @@ $(ps f -eo pid,user,tty,cmd | grep -i '[d]ietpi')" && continue # Create and navigate to scripts working directory or users home if available: https://github.com/MichaIng/DietPi/issues/905#issuecomment-298223705 mkdir -p "$G_WORKING_DIR" && cd "$G_WORKING_DIR" && return - G_DIETPI-NOTIFY 1 "Failed to create or enter scripts working directory: $G_WORKING_DIR" - if [[ $HOME && -d $HOME ]] - then - cd "$HOME" && { G_DIETPI-NOTIFY 2 "Entered users home directory: $HOME"; return; } - G_DIETPI-NOTIFY 1 "Failed to enter users home directory: $HOME" - fi - G_DIETPI-NOTIFY 2 "Will stay in current directory: $PWD" + G_DIETPI-NOTIFY 1 "Failed to create or enter scripts working directory: $G_WORKING_DIR. Aborting ..." + exit 1 } diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 597bf3b683..42b75dc796 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -609,7 +609,7 @@ _EOF_ # Fake KMS supports CMA params only [[ $params ]] && params=$(mawk -F, '{for(i=1; i<=NF; i++) {if($i~/^cma-*/){print $i;exit}}}' <<< "$params") else - # Disable full KMS HDMI audio if onboard HDMI is disabled + # Disable VC4 HDMI audio if onboard HDMI is disabled [[ $params != *',noaudio'* ]] && { ! grep -q '^[[:blank:]]*dtparam=audio=on' /boot/config.txt || grep -Eq '(^|[[:blank:]])snd_bcm2835.enable_hdmi=0([[:blank:]]|$)' /boot/cmdline.txt; } && params+=',noaudio' fi @@ -1725,7 +1725,7 @@ _EOF_ # Remove kernel module options G_EXEC sed --follow-symlinks -Ei '/root=/s/[[:blank:]]*snd_bcm2835.enable_[^[:blank:]]*([[:blank:]]*$)?//g' /boot/cmdline.txt - # Disable full KMS HDMI audio + # Disable VC4 HDMI audio local kms=$(grep -Em1 '^[[:blank:]]*dtoverlay=vc4-kms-v3d(-pi4)?(,|$)' /boot/config.txt) [[ $kms && ! $kms =~ ',noaudio'(,|$) ]] && G_EXEC sed --follow-symlinks -Ei '/^[[:blank:]]*dtoverlay=vc4-kms-v3d(-pi4)?(,|$)/s/$/,noaudio/' /boot/config.txt @@ -1943,33 +1943,42 @@ _EOF_ # rpi-bcm2835-hdmi 'rpi-bcm2835-'*) - # Remove blacklist for onboard audio kernel module - G_EXEC rm /etc/modprobe.d/dietpi-disable_rpi_audio.conf - - # Enable onboard audio - G_CONFIG_INJECT 'dtparam=audio=' 'dtparam=audio=on' /boot/config.txt - - # Force 3.5mm output? - if [[ $INPUT_DEVICE_VALUE == *'3.5mm' ]] - then - # Disable HDMI audio via kernel module option - G_EXEC sed --follow-symlinks -i '/root=/s/$/ snd_bcm2835.enable_hdmi=0/' /boot/cmdline.txt - - # Force HDMI output? - elif [[ $INPUT_DEVICE_VALUE == *'hdmi' ]] + # Enable VC4 HDMI audio if onboard HDMI is enabled and KMS used, as the bcm2835 HDMI audio driver and KMS conflict: https://dietpi.com/forum/t/19568, https://github.com/raspberrypi/linux/issues/4651 + if [[ $INPUT_DEVICE_VALUE != *'3.5mm' ]] && grep -Eq '^[[:blank:]]*dtoverlay=vc4-kms-v3d(-pi4)?,(noaudio|.+,noaudio)(,|$)' /boot/config.txt then - # Disable headphones via kernel module option - G_EXEC sed --follow-symlinks -i '/root=/s/$/ snd_bcm2835.enable_headphones=0/' /boot/cmdline.txt - # Force HDMI audio via config.txt option - G_CONFIG_INJECT 'hdmi_drive=' 'hdmi_drive=2' /boot/config.txt - (( $G_HW_MODEL > 3 )) && G_CONFIG_INJECT 'hdmi_drive:1=' 'hdmi_drive:1=2' /boot/config.txt 'hdmi_drive=' + G_EXEC sed --follow-symlinks -Ei '/^[[:blank:]]*dtoverlay=vc4-kms-v3d(-pi4)?,/s/,noaudio(,|$)/\1/' /boot/config.txt fi - # Enable full KMS HDMI audio if onboard HDMI is not disabled - if [[ $INPUT_DEVICE_VALUE != *'3.5mm' ]] + # Enable bcm2835 audio driver if 3.5mm is enabled or no VC4 used + if [[ $INPUT_DEVICE_VALUE != *'hdmi' ]] || ! grep -Eq '^[[:blank:]]*dtoverlay=vc4-kms-v3d(-pi4)?(,|$)' /boot/config.txt then - local kms=$(grep -Em1 '^[[:blank:]]*dtoverlay=vc4-kms-v3d(-pi4)?,(noaudio|.+,noaudio)(,|$)' /boot/config.txt) - [[ $kms ]] && G_EXEC sed --follow-symlinks -Ei '/^[[:blank:]]*dtoverlay=vc4-kms-v3d(-pi4)?,/s/,noaudio(,|$)/\1/' /boot/config.txt + # Remove blacklist for bcm2835 audio kernel module + G_EXEC rm /etc/modprobe.d/dietpi-disable_rpi_audio.conf + + # Enable bcm2835 audio via device tree parameter + G_CONFIG_INJECT 'dtparam=audio=' 'dtparam=audio=on' /boot/config.txt + + # Force 3.5mm output? + if [[ $INPUT_DEVICE_VALUE == *'3.5mm' ]] + then + # Disable HDMI audio via kernel module option + G_EXEC sed --follow-symlinks -i '/root=/s/$/ snd_bcm2835.enable_hdmi=0/' /boot/cmdline.txt + + # Force HDMI output? + elif [[ $INPUT_DEVICE_VALUE == *'hdmi' ]] + then + # Disable headphones via kernel module option + G_EXEC sed --follow-symlinks -i '/root=/s/$/ snd_bcm2835.enable_headphones=0/' /boot/cmdline.txt + + # Force HDMI audio via config.txt option + G_CONFIG_INJECT 'hdmi_drive=' 'hdmi_drive=2' /boot/config.txt + (( $G_HW_MODEL > 3 )) && G_CONFIG_INJECT 'hdmi_drive:1=' 'hdmi_drive:1=2' /boot/config.txt 'hdmi_drive=' + fi + + # If only VC4 HDMI audio is used, return here to skip /etc/asound.conf generation and remove potential root user config: https://dietpi.com/forum/t/19568 + else + [[ -f '/root/.asoundrc' ]] && G_EXEC rm /root/.asoundrc + return 0 fi ;;