diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 19a6c5e9c3..17f17785dd 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -127,7 +127,7 @@ case $HW_MODEL in 80) iname='OrangePi5' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;; 81) iname='VisionFive2' HW_ARCH=11 root_size=639;; 82) iname='OrangePi5Plus' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;; - 83) iname='OrangePiZero3' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;; + 83) iname='OrangePiZero3' HW_ARCH=3 partition_start=4 root_size=752;; 84) iname='Star64' HW_ARCH=11 root_size=639;; 85) iname='ROCK5A' HW_ARCH=3 PTTYPE='gpt' partition_start=16 root_size=752;; 86) iname='ASUSTB2' HW_ARCH=3 partition_start=16 root_size=752;; @@ -415,7 +415,7 @@ G_EXEC umount rootfs/dev rootfs/run rootfs/var/cache/apt rootfs/var/lib/apt/list cat << '_EOF_' > rootfs/etc/rc.local #!/bin/dash { -infocmp "$TERM" > /dev/null 2>&1 || TERM='dumb' +infocmp "$TERM" > /dev/null 2>&1 || { echo "[ WARN ] Unsupported TERM=\"$TERM\", switching to TERM=\"dumb\""; export TERM=dumb; } echo '[ INFO ] Running DietPi-Installer...' _EOF_ @@ -571,6 +571,25 @@ then # Install Allo GUI via automated first run setup right here G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt + # - Workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 + if (( $DISTRO == 8 && $G_HW_ARCH != $HW_ARCH && ( $G_HW_ARCH > 9 || $G_HW_ARCH < $HW_ARCH ) )) + then + cat << '_EOF_' > rootfs/etc/systemd/system/dietpi-automation.service +[Unit] +Description=DietPi-Automation +After=dietpi-postboot.service + +[Service] +Type=idle +StandardOutput=tty +ExecStart=/bin/dash -c 'infocmp "$TERM" > /dev/null 2>&1 || export TERM=dumb; exec /boot/dietpi/dietpi-login' +ExecStop=/sbin/poweroff + +[Install] +WantedBy=multi-user.target +_EOF_ + G_EXEC ln -s /etc/systemd/system/dietpi-automation.service rootfs/etc/systemd/system/multi-user.target.wants/ + fi G_CONFIG_INJECT 'AUTO_SETUP_INSTALL_SOFTWARE_ID=' 'AUTO_SETUP_INSTALL_SOFTWARE_ID=159' rootfs/boot/dietpi.txt # Revert autostart option, in case Amiberry image was generated before G_CONFIG_INJECT 'AUTO_SETUP_AUTOSTART_TARGET_INDEX=' 'AUTO_SETUP_AUTOSTART_TARGET_INDEX=0' rootfs/boot/dietpi.txt @@ -578,12 +597,15 @@ then # Force ARMv6 arch on Raspbian (( $HW_ARCH == 1 )) && echo 'sed -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 -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 # Workaround invalid TERM on login # shellcheck disable=SC2016 - G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || { echo "[ INFO ] Unsupported TERM=\"$TERM\", switching to TERM=\"dumb\""; export TERM=dumb; }'\'' > rootfs/etc/bashrc.d/00-dietpi-build.sh' + 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' # 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 @@ -652,6 +674,9 @@ _EOF_ # Reset IPv4 network connectivity check setting G_CONFIG_INJECT 'CONFIG_CHECK_CONNECTION_IP=' 'CONFIG_CHECK_CONNECTION_IP=9.9.9.9' rootfs/boot/dietpi.txt + # Revert workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 + (( $DISTRO == 8 )) && G_EXEC rm rootfs/etc/systemd/system/{multi-user.target.wants/,}dietpi-automation.service + [[ -f 'rootfs/success' ]] || { G_DIETPI-NOTIFY 1 'The container setup did not finish successfully, aborting...'; exit 1; } G_EXEC rm rootfs/success G_EXEC sync diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 2a5a5b30af..c105b495c1 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -586,7 +586,7 @@ _EOF_ G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/99-dietpi-uboot" /etc/initramfs/post-update.d/99-dietpi-uboot G_EXEC sed -i 's/arm64/arm/' /etc/initramfs/post-update.d/99-dietpi-uboot - elif [[ $G_HW_MODEL =~ ^(12|15|16|40|42|43|44|45|46|47|48|52|54|55|56|57|58|59|60|62|63|64|65|66|67|68|72|73|74|77|78|80|82|85|86)$ ]] + elif [[ $G_HW_MODEL =~ ^(12|15|16|40|42|43|44|45|46|47|48|52|54|55|56|57|58|59|60|62|63|64|65|66|67|68|72|73|74|77|78|80|82|83|85|86)$ ]] then armbian_repo=1 G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/U-Boot/boot.cmd" /boot/boot.cmd @@ -670,7 +670,7 @@ setenv rootuuid "true"' /boot/boot.cmd G_EXEC sed -i -e 's/ttyAML0/ttyS2/' -e '/^extraargs=/s/$/ systemd.unified_cgroup_hierarchy=0/' /boot/dietpiEnv.txt # Allwinner 64-bit - elif [[ $G_HW_MODEL =~ ^(40|44|45|57|65|67)$ ]] + elif [[ $G_HW_MODEL =~ ^(40|44|45|57|65|67|83)$ ]] then G_EXEC sed -Ei '/^setenv (kernel|fdt)_addr_r/d' /boot/boot.cmd G_CONFIG_INJECT 'setenv scriptaddr ' 'setenv scriptaddr "0x45000000"' /boot/boot.cmd @@ -683,6 +683,7 @@ setenv rootuuid "true"' /boot/boot.cmd 40|44) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-a64' /boot/dietpiEnv.txt;; 45) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-h6' /boot/dietpiEnv.txt;; 57|65|67) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-h5' /boot/dietpiEnv.txt;; + 83) G_CONFIG_INJECT 'overlay_prefix=' 'overlay_prefix=sun50i-h616' /boot/dietpiEnv.txt; armbian_repo=0;; *) :;; esac case $G_HW_MODEL in @@ -793,14 +794,13 @@ setenv rootuuid "true"' /boot/boot.cmd G_EXEC rm keyring.deb fi - # Bookworm: Avoid conflict between RPi repo and Bookworm FFmpeg packages: https://github.com/MichaIng/DietPi/issues/6461 - if (( $DISTRO_TARGET > 6 )) + if (( $DISTRO_TARGET > 7 )) then - G_DIETPI-NOTIFY 2 'Enforcing Debian Bookworm FFmpeg packages over RPi repo ones' + G_DIETPI-NOTIFY 2 'Enforcing Debian Trixie FFmpeg packages over RPi repo ones' cat << '_EOF_' > /etc/apt/preferences.d/dietpi-ffmpeg Package: src:ffmpeg -Pin: version 7:5* -Pin-Priority: 1000 +Pin: origin archive.raspberrypi.org +Pin-Priority: -1 _EOF_ fi fi @@ -1119,7 +1119,7 @@ _EOF_ [[ -f '/boot/.next' ]] && G_EXEC rm /boot/.next [[ -f '/boot/armbianEnv.txt' ]] && G_EXEC rm /boot/armbianEnv.txt [[ -f '/boot/uEnv.txt' ]] && G_EXEC rm /boot/uEnv.txt - # Compile U-Boot config + # Compile U-Boot script [[ -f '/boot/boot.cmd' ]] && G_EXEC mkimage -C none -A "$arch" -T script -d /boot/boot.cmd /boot/boot.scr # Flash U-Boot # shellcheck disable=SC1091 @@ -1186,7 +1186,7 @@ _EOF_ then # ARMv6/7: Add raspi-copies-and-fills local a32bit=() - [[ $G_HW_ARCH == 3 ]] || a32bit=('raspi-copies-and-fills') + (( $G_HW_ARCH == 3 )) || a32bit=('raspi-copies-and-fills') # Install our own raspberrypi-sys-mods G_EXEC curl -sSfO 'https://dietpi.com/downloads/binaries/raspberrypi-sys-mods.deb' G_AGI raspberrypi-bootloader raspberrypi-kernel libraspberrypi0 libraspberrypi-bin ./raspberrypi-sys-mods.deb raspberrypi-archive-keyring "${a32bit[@]}" @@ -1248,6 +1248,43 @@ _EOF_ 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 + # Install firmware and initramfs + G_EXEC curl -fo package1.deb 'https://dietpi.com/downloads/binaries/orangepi-firmware.deb' + G_AGI initramfs-tools u-boot-tools ./package1.deb zstd + [[ ${zstd[0]} ]] && G_CONFIG_INJECT 'COMPRESS=' 'COMPRESS=zstd' /etc/initramfs-tools/initramfs.conf + + # Install kernel and U-Boot packages + G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb 'https://dietpi.com/downloads/binaries/linux-image-next-sun50iw9.deb' + G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb 'https://dietpi.com/downloads/binaries/linux-dtb-next-sun50iw9.deb' + G_EXEC_OUTPUT=1 G_EXEC curl -fo package3.deb 'https://dietpi.com/downloads/binaries/linux-u-boot-orangepizero3-next.deb' + G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb package3.deb + G_EXEC rm package1.deb package2.deb package3.deb + + # Flash U-Boot + # shellcheck disable=SC1091 + . /usr/lib/u-boot/platform_install.sh + # shellcheck disable=SC2154 + write_uboot_platform "$DIR" "$BOOT_DEVICE" + + # Compile U-Boot script + G_EXEC mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr + + # Remove obsolete combined keyring + [[ -f '/etc/apt/trusted.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg + [[ -f '/etc/apt/trusted.gpg~' ]] && G_EXEC rm '/etc/apt/trusted.gpg~' + + # Remove obsolete components from Armbian list and connect via HTTPS + G_EXEC rm -Rf /etc/apt/sources.list.d/{,.??,.[^.]}* + + # Cleanup + [[ -f '/boot/orangepiEnv.txt' ]] && G_EXEC rm /boot/orangepiEnv.txt + + # Load WiFi and Bluetooth modules explicitly, as they do not load automatically, until DietPi v8.24 does it via dietpi-set_hardware + G_EXEC eval 'echo -e '\''sprdwl_ng\nsprdbt_tty'\'' > /etc/modules-load.d/dietpi-enable_wifi.conf' + # Sparky SBC elif (( $G_HW_MODEL == 70 )) then @@ -1389,6 +1426,10 @@ _EOF_ if dpkg-query -s 'armbian-firmware' &> /dev/null then aPACKAGES_REQUIRED_INSTALL+=('armbian-firmware') + + elif dpkg-query -s 'orangepi-firmware' &> /dev/null + then + aPACKAGES_REQUIRED_INSTALL+=('orangepi-firmware') else aPACKAGES_REQUIRED_INSTALL+=('firmware-linux-free') # Free misc aPACKAGES_REQUIRED_INSTALL+=('firmware-misc-nonfree') # Non-free misc incl. Ralink and MediaTek WiFi/BT @@ -1497,6 +1538,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 [[ -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 @@ -1652,6 +1694,9 @@ _EOF_ # - Radxa [[ -e '/etc/systemd/system/systemd-networkd-wait-online.service' || -L '/etc/systemd/system/systemd-networkd-wait-online.service' ]] && G_EXEC rm /etc/systemd/system/systemd-networkd-wait-online.service + # - Orange Pi + [[ -f '/boot/orangepi_first_run.txt.template' ]] && G_EXEC rm /boot/orangepi_first_run.txt.template + #----------------------------------------------------------------------------------- # https://www.debian.org/doc/debian-policy/ch-opersys.html#site-specific-programs G_DIETPI-NOTIFY 2 'Setting modern /usr/local permissions' @@ -1884,8 +1929,8 @@ _EOF_' then /boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyS2 - # PINE A64, Pinebook, PINE H64, NenoPi NEO Plus2, ZeroPi, NanoPi NEO, NanoPi M1, NanoPi NEO Air, NenoPi NEO2, NanoPi M1 Plus, NanoPi K1 Plus, ROCK Pi S, VisionFive 2, Star64 - elif [[ $G_HW_MODEL =~ ^(40|44|45|57|59|60|63|64|65|66|67|73|81|84)$ ]] + # PINE A64, Pinebook, PINE H64, NenoPi NEO Plus2, ZeroPi, NanoPi NEO, NanoPi M1, NanoPi NEO Air, NenoPi NEO2, NanoPi M1 Plus, NanoPi K1 Plus, ROCK Pi S, VisionFive 2, Orange Pi Zero 3, Star64 + elif [[ $G_HW_MODEL =~ ^(40|44|45|57|59|60|63|64|65|66|67|73|81|83|84)$ ]] then /boot/dietpi/func/dietpi-set_hardware serialconsole enable ttyS0 diff --git a/.build/software/Amiberry/build.bash b/.build/software/Amiberry/build.bash index cee0c8ba95..e2f559fb8f 100755 --- a/.build/software/Amiberry/build.bash +++ b/.build/software/Amiberry/build.bash @@ -19,6 +19,12 @@ adeps=('libdrm2' 'libgl1-mesa-dri' 'libgbm1' 'libegl1' 'libudev1' 'libxml2' 'lib G_AGUP G_AGDUG "${adeps_build[@]}" +for i in "${adeps[@]}" +do + dpkg-query -s "$i" &> /dev/null && continue + G_DIETPI-NOTIFY 1 "Expected dependency package was not installed: $i" + exit 1 +done # Build libSDL2 v_sdl=$(curl -sSf 'https://api.github.com/repos/libsdl-org/SDL/releases/latest' | mawk -F\" '/^ "name"/{print $4}') @@ -177,7 +183,7 @@ do done DEPS_APT_VERSIONED=${DEPS_APT_VERSIONED%,} # shellcheck disable=SC2001 -grep -q '^ID=raspbian' /etc/os-release && DEPS_APT_VERSIONED=$(sed 's/+rp[it][0-9]\+[^)]*)/)/g' <<< "$DEPS_APT_VERSIONED") || DEPS_APT_VERSIONED=$(sed 's/+b[0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") +[[ $G_HW_ARCH_NAME == 'armv6l' ]] && DEPS_APT_VERSIONED=$(sed 's/+rp[it][0-9]\+[^)]*)/)/g' <<< "$DEPS_APT_VERSIONED") || DEPS_APT_VERSIONED=$(sed 's/+b[0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") # - Obtain version suffix G_EXEC curl -sSfo package.deb "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/amiberry_$PLATFORM.deb" diff --git a/.build/software/Amiberry/container_build.bash b/.build/software/Amiberry/container_build.bash index ce925bfb94..67c9d5f874 100755 --- a/.build/software/Amiberry/container_build.bash +++ b/.build/software/Amiberry/container_build.bash @@ -4,11 +4,12 @@ ########################################## # Load DietPi-Globals ########################################## +Error_Exit(){ G_DIETPI-NOTIFY 1 "$1, aborting ..."; exit 1; } if [[ -f '/boot/dietpi/func/dietpi-globals' ]] then . /boot/dietpi/func/dietpi-globals else - curl -sSf "https://raw.githubusercontent.com/${G_GITOWNER:=MichaIng}/DietPi/${G_GITBRANCH:=master}/dietpi/func/dietpi-globals" -o /tmp/dietpi-globals || exit 1 + curl -sSf "https://raw.githubusercontent.com/${G_GITOWNER:=MichaIng}/DietPi/${G_GITBRANCH:=master}/dietpi/func/dietpi-globals" -o /tmp/dietpi-globals || Error_Exit 'Failed to download DietPi-Globals' # shellcheck disable=SC1091 . /tmp/dietpi-globals G_EXEC_NOHALT=1 G_EXEC rm /tmp/dietpi-globals @@ -20,7 +21,7 @@ case $G_HW_ARCH_NAME in 'aarch64') export G_HW_ARCH=3;; 'x86_64') export G_HW_ARCH=10;; 'riscv64') export G_HW_ARCH=11;; - *) G_DIETPI-NOTIFY 1 "Unsupported host system architecture \"$G_HW_ARCH_NAME\" detected, aborting..."; exit 1;; + *) Error_Exit "Unsupported host system architecture \"$G_HW_ARCH_NAME\" detected";; esac readonly G_PROGRAM_NAME='DietPi-Amiberry_container_setup' G_CHECK_ROOT_USER @@ -39,23 +40,24 @@ do case $1 in '-d') shift; DISTRO=$1;; '-p') shift; PLATFORM=$1;; - *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; + *) Error_Exit "Invalid input \"$1\"";; esac shift done -[[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1; } +[[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || Error_Exit "Invalid distro \"$DISTRO\" passed" case $PLATFORM in - 'rpi'[1-4]) image="DietPi_Container-ARMv6-${DISTRO^}" arch=1;; - 'c1'|'xu4'|'RK3288'|'sun8i'|'s812') image="DietPi_Container-ARMv7-${DISTRO^}" arch=2;; - 'rpi'[34]'-64-dmx'|'AMLSM1'|'n2'|'a64'|'rk3588') image="DietPi_Container-ARMv8-${DISTRO^}" arch=3;; - 'x86-64') image="DietPi_Container-x86_64-${DISTRO^}" arch=10;; - *) G_DIETPI-NOTIFY 1 "Invalid platform \"$PLATFORM\" passed, aborting..."; exit 1;; + 'rpi1') image="ARMv6-${DISTRO^}" arch=1;; + 'rpi'[234]|'c1'|'xu4'|'RK3288'|'sun8i'|'s812') image="ARMv7-${DISTRO^}" arch=2;; + 'rpi'[34]'-64-dmx'|'AMLSM1'|'n2'|'a64'|'rk3588') image="ARMv8-${DISTRO^}" arch=3;; + 'x86-64') image="x86_64-${DISTRO^}" arch=10;; + *) Error_Exit "Invalid platform \"$PLATFORM\" passed";; esac +image="DietPi_Container-$image.img" ########################################## # Dependencies ########################################## -apackages=('7zip' 'parted' 'fdisk' 'systemd-container') +apackages=('xz-utils' 'parted' 'fdisk' 'systemd-container') (( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || apackages+=('qemu-user-static' 'binfmt-support') G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" @@ -63,14 +65,13 @@ G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" # Prepare container ########################################## # Download -G_EXEC curl -sSfO "https://dietpi.com/downloads/images/$image.7z" -G_EXEC 7zz x "$image.7z" -G_EXEC rm "$image.7z" hash.txt README.md -G_EXEC truncate -s 2G "$image.img" +G_EXEC curl -sSfO "https://dietpi.com/downloads/images/$image.xz" +G_EXEC xz -d "$image.xz" +G_EXEC truncate -s 2G "$image" -# Loop device +# Mount as loop device FP_LOOP=$(losetup -f) -G_EXEC losetup "$FP_LOOP" "$image.img" +G_EXEC losetup "$FP_LOOP" "$image" G_EXEC partprobe "$FP_LOOP" G_EXEC partx -u "$FP_LOOP" G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" @@ -82,31 +83,59 @@ G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" G_EXEC mkdir rootfs G_EXEC mount "${FP_LOOP}p1" rootfs +# Enforce ARMv6 arch on Raspbian +(( $arch > 1 )) || echo 'sed -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 || Error_Exit 'Failed to generate Automation_Custom_PreScript.sh' + # Enable automated setup G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt +# - Workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 +if [[ $DISTRO == 'trixie' ]] && (( $G_HW_ARCH != $arch && ( $G_HW_ARCH > 9 || $G_HW_ARCH < $arch ) )) +then + cat << '_EOF_' > rootfs/etc/systemd/system/dietpi-automation.service +[Unit] +Description=DietPi-Automation +After=dietpi-postboot.service -# Avoid DietPi-Survey uploads to not mess with the statistics -G_EXEC rm rootfs/root/.ssh/known_hosts +[Service] +Type=idle +StandardOutput=tty +ExecStart=/bin/dash -c 'infocmp "$TERM" > /dev/null 2>&1 || { echo "[ WARN ] Unsupported TERM=\"$TERM\", switching to TERM=\"dumb\""; export TERM=dumb; }; exec /boot/dietpi/dietpi-login' +ExecStop=/sbin/poweroff + +[Install] +WantedBy=multi-user.target +_EOF_ + G_EXEC ln -s /etc/systemd/system/dietpi-automation.service rootfs/etc/systemd/system/multi-user.target.wants/ +fi # Workaround invalid TERM on login # shellcheck disable=SC2016 -G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || export TERM=dumb'\'' > rootfs/etc/bashrc.d/00-dietpi-build.sh' +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' -# Workaround for failing IPv4 network connectivity check as GitHub Actions runners do not receive external ICMP echo replies. +# 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 -# - RPi 64-bit: Add RPi repo, ARMv6 container images contain it already -[[ $PLATFORM != 'rpi'[34]'-64-dmx' ]] || cat << _EOF_ > rootfs/boot/Automation_Custom_Script.sh || exit 1 -#!/bin/dash -echo '[ INFO ] Setting up RPi APT repository...' -echo 'deb https://archive.raspberrypi.org/debian/ ${DISTRO/bookworm/bullseye} main' > /etc/apt/sources.list.d/raspi.list -curl -sSf 'https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb' -o /tmp/keyring.deb -dpkg -i /tmp/keyring.deb -rm -v /tmp/keyring.deb +# Avoid DietPi-Survey uploads to not mess with the statistics +G_EXEC rm rootfs/root/.ssh/known_hosts + +# RPi 64-bit: Add RPi repo, ARMv6 container images contain it already +if [[ $PLATFORM == 'rpi'[234]* ]] +then + G_EXEC eval "echo 'deb https://archive.raspberrypi.org/debian/ ${DISTRO/trixie/bookworm} main' > rootfs/etc/apt/sources.list.d/raspi.list" + G_EXEC curl -sSf 'https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb' -o keyring.deb + G_EXEC dpkg --root=rootfs -i keyring.deb + G_EXEC rm keyring.deb + # Enforce Debian Trixie FFmpeg packages over RPi repo ones + [[ $DISTRO != 'trixie' ]] || cat << '_EOF_' > rootfs/etc/apt/preferences.d/dietpi-ffmpeg || exit 1 +Package: src:ffmpeg +Pin: origin archive.raspberrypi.org +Pin-Priority: -1 _EOF_ +fi -cat << _EOF_ >> rootfs/boot/Automation_Custom_Script.sh || exit 1 -echo '[ INFO ] Running Amiberry build script...' +# Automated build +cat << _EOF_ >> rootfs/boot/Automation_Custom_Script.sh || Error_Exit 'Failed to generate Automation_Custom_Script.sh' +echo '[ INFO ] Running Amiberry build script ...' bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/software/Amiberry/build.bash')" -- '$PLATFORM' mv -v '/tmp/amiberry_$PLATFORM.deb' / poweroff @@ -116,5 +145,5 @@ _EOF_ # Boot container ########################################## systemd-nspawn -bD rootfs -[[ -f rootfs/amiberry_$PLATFORM.deb ]] || exit 1 +[[ -f rootfs/amiberry_$PLATFORM.deb ]] || Error_Exit "Failed to build package: amiberry_$PLATFORM.deb" } diff --git a/.build/software/vaultwarden/container_build.bash b/.build/software/dietpi-software-build.bash old mode 100755 new mode 100644 similarity index 50% rename from .build/software/vaultwarden/container_build.bash rename to .build/software/dietpi-software-build.bash index 4f1a6fc0b6..cc05c7d281 --- a/.build/software/vaultwarden/container_build.bash +++ b/.build/software/dietpi-software-build.bash @@ -4,14 +4,15 @@ ########################################## # Load DietPi-Globals ########################################## +Error_Exit(){ G_DIETPI-NOTIFY 1 "$1, aborting ..."; exit 1; } if [[ -f '/boot/dietpi/func/dietpi-globals' ]] then . /boot/dietpi/func/dietpi-globals else - curl -sSf "https://raw.githubusercontent.com/${G_GITOWNER:=MichaIng}/DietPi/${G_GITBRANCH:=master}/dietpi/func/dietpi-globals" -o /tmp/dietpi-globals || exit 1 + curl -sSf "https://raw.githubusercontent.com/${G_GITOWNER:=MichaIng}/DietPi/${G_GITBRANCH:=master}/dietpi/func/dietpi-globals" -o /tmp/dietpi-globals || Error_Exit 'Failed to download DietPi-Globals' # shellcheck disable=SC1091 . /tmp/dietpi-globals - G_EXEC_NOHALT=1 G_EXEC rm /tmp/dietpi-globals + G_EXEC rm /tmp/dietpi-globals export G_GITOWNER G_GITBRANCH G_HW_ARCH_NAME=$(uname -m) fi case $G_HW_ARCH_NAME in @@ -20,9 +21,9 @@ case $G_HW_ARCH_NAME in 'aarch64') export G_HW_ARCH=3;; 'x86_64') export G_HW_ARCH=10;; 'riscv64') export G_HW_ARCH=11;; - *) G_DIETPI-NOTIFY 1 "Unsupported host system architecture \"$G_HW_ARCH_NAME\" detected, aborting..."; exit 1;; + *) Error_Exit "Unsupported host system architecture \"$G_HW_ARCH_NAME\" detected";; esac -readonly G_PROGRAM_NAME='DietPi-vaultwarden_container_setup' +readonly G_PROGRAM_NAME='DietPi-Software build' G_CHECK_ROOT_USER G_CHECK_ROOTFS_RW readonly FP_ORIGIN=$PWD # Store origin dir @@ -32,25 +33,29 @@ G_EXEC cd "$FP_ORIGIN" # Process everything in origin dir instead of /tmp/$G_PRO ########################################## # Process inputs ########################################## +NAME= DISTRO= ARCH= while (( $# )) do case $1 in + '-n') shift; NAME=$1;; '-d') shift; DISTRO=$1;; '-a') shift; ARCH=$1;; - *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; + *) Error_Exit "Invalid input \"$1\"";; esac shift done -[[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1; } +[[ $NAME =~ ^('gmediarender'|'gogs'|'shairport-sync'|'squeezelite'|'vaultwarden'|'ympd')$ ]] || Error_Exit "Invalid software title \"$NAME\" passed" +[[ $NAME == 'gogs' ]] && EXT='7z' || EXT='deb' +[[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || Error_Exit "Invalid distro \"$DISTRO\" passed" case $ARCH in 'armv6l') image="ARMv6-${DISTRO^}" arch=1;; 'armv7l') image="ARMv7-${DISTRO^}" arch=2;; 'aarch64') image="ARMv8-${DISTRO^}" arch=3;; 'x86_64') image="x86_64-${DISTRO^}" arch=10;; - 'riscv64') image='RISC-V-Sid' arch=11;; - *) G_DIETPI-NOTIFY 1 "Invalid architecture \"$ARCH\" passed, aborting..."; exit 1;; + 'riscv64') image='RISC-V-Sid' arch=11; [[ $DISTRO == 'trixie' ]] || Error_Exit "Invalid distro \"$DISTRO\" for arch \"$ARCH\" passed, only \"trixie\" is supported";; + *) Error_Exit "Invalid architecture \"$ARCH\" passed";; esac image="DietPi_Container-$image.img" @@ -67,9 +72,9 @@ G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" # Download G_EXEC curl -sSfO "https://dietpi.com/downloads/images/$image.xz" G_EXEC xz -d "$image.xz" -G_EXEC truncate -s 2G "$image" +G_EXEC truncate -s 8G "$image" -# Loop device +# Mount as loop device FP_LOOP=$(losetup -f) G_EXEC losetup "$FP_LOOP" "$image" G_EXEC partprobe "$FP_LOOP" @@ -83,28 +88,53 @@ G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" G_EXEC mkdir rootfs G_EXEC mount "${FP_LOOP}p1" rootfs +# Enforce ARMv6 arch on Raspbian +(( $arch > 1 )) || echo 'sed -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 || Error_Exit 'Failed to generate Automation_Custom_PreScript.sh' + # Enable automated setup G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt +# - Workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 +if [[ $DISTRO == 'trixie' ]] && (( $G_HW_ARCH != $arch && ( $G_HW_ARCH > 9 || $G_HW_ARCH < $arch ) )) +then + cat << '_EOF_' > rootfs/etc/systemd/system/dietpi-automation.service +[Unit] +Description=DietPi-Automation +After=dietpi-postboot.service -# Force ARMv6 arch on Raspbian -(( $arch == 1 )) && echo 'sed -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 +[Service] +Type=idle +StandardOutput=tty +ExecStart=/bin/dash -c 'infocmp "$TERM" > /dev/null 2>&1 || { echo "[ WARN ] Unsupported TERM=\"$TERM\", switching to TERM=\"dumb\""; export TERM=dumb; }; exec /boot/dietpi/dietpi-login' +ExecStop=/sbin/poweroff -# Avoid DietPi-Survey uploads to not mess with the statistics -G_EXEC rm rootfs/root/.ssh/known_hosts +[Install] +WantedBy=multi-user.target +_EOF_ + G_EXEC ln -s /etc/systemd/system/dietpi-automation.service rootfs/etc/systemd/system/multi-user.target.wants/ +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 || export TERM=dumb'\'' > rootfs/etc/bashrc.d/00-dietpi-build.sh' +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' -# Workaround for failing IPv4 network connectivity check as GitHub Actions runners do not receive external ICMP echo replies. +# 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 +# Avoid DietPi-Survey uploads to not mess with the statistics +G_EXEC rm rootfs/root/.ssh/known_hosts + # Automated build -cat << _EOF_ > rootfs/boot/Automation_Custom_Script.sh || exit 1 +cat << _EOF_ > rootfs/boot/Automation_Custom_Script.sh || Error_Exit 'Failed to generate Automation_Custom_Script.sh' #!/bin/dash -echo '[ INFO ] Running vaultwarden build script...' -bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/software/vaultwarden/build.bash')" -mv -v '/tmp/vaultwarden_$ARCH.deb' / +echo '[ INFO ] Running $NAME build script ...' +bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/software/$NAME/build.bash')" +mkdir -v /output && mv -v /tmp/*.$EXT /output poweroff _EOF_ @@ -112,5 +142,5 @@ _EOF_ # Boot container ########################################## systemd-nspawn -bD rootfs -[[ -f rootfs/vaultwarden_$ARCH.deb ]] || exit 1 +[[ -f rootfs/output/${NAME}_$ARCH.$EXT ]] || Error_Exit "Failed to build package: ${NAME}_$ARCH.$EXT" } diff --git a/.build/software/gmediarender/build.bash b/.build/software/gmediarender/build.bash index 42d46dca50..791313df19 100755 --- a/.build/software/gmediarender/build.bash +++ b/.build/software/gmediarender/build.bash @@ -5,6 +5,14 @@ # Build deps G_AGUP G_AGDUG automake pkg-config gcc libc6-dev make libgstreamer1.0-dev libupnp-dev gstreamer1.0-alsa gstreamer1.0-libav gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly +adeps=('libc6' 'gstreamer1.0-alsa' 'gstreamer1.0-libav' 'gstreamer1.0-plugins-good' 'gstreamer1.0-plugins-bad' 'gstreamer1.0-plugins-ugly') +(( $G_DISTRO > 7 )) && adeps+=('libupnp17') || adeps+=('libupnp13') +for i in "${adeps[@]}" +do + dpkg-query -s "$i" &> /dev/null && continue + G_DIETPI-NOTIFY 1 "Expected dependency package was not installed: $i" + exit 1 +done # Obtain latest version name='gmediarender' @@ -148,8 +156,7 @@ G_EXEC chmod +x "$DIR/DEBIAN/"{postinst,prerm,postrm} # - md5sums find "$DIR" ! \( -path "$DIR/DEBIAN" -prune \) -type f -exec md5sum {} + | sed "s|$DIR/||" > "$DIR/DEBIAN/md5sums" -# - Add dependencies -adeps=('libc6' 'gstreamer1.0-alsa' 'gstreamer1.0-libav' 'gstreamer1.0-plugins-good' 'gstreamer1.0-plugins-bad' 'gstreamer1.0-plugins-ugly' 'libupnp13') +# - Obtain DEB dependency versions DEPS_APT_VERSIONED= for i in "${adeps[@]}" do @@ -157,7 +164,7 @@ do done DEPS_APT_VERSIONED=${DEPS_APT_VERSIONED%,} # shellcheck disable=SC2001 -grep -q 'raspbian' /etc/os-release && DEPS_APT_VERSIONED=$(sed 's/+rp[it][0-9]\+[^)]*)/)/g' <<< "$DEPS_APT_VERSIONED") || DEPS_APT_VERSIONED=$(sed 's/+b[0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") +[[ $G_HW_ARCH_NAME == 'armv6l' ]] && DEPS_APT_VERSIONED=$(sed 's/+rp[it][0-9]\+[^)]*)/)/g' <<< "$DEPS_APT_VERSIONED") || DEPS_APT_VERSIONED=$(sed 's/+b[0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") # - Obtain version suffix G_EXEC curl -sSfo package.deb "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/${name}_$G_HW_ARCH_NAME.deb" diff --git a/.build/software/gmediarender/container_build.bash b/.build/software/gmediarender/container_build.bash deleted file mode 100755 index e0a084a61f..0000000000 --- a/.build/software/gmediarender/container_build.bash +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# Created by MichaIng / micha@dietpi.com / dietpi.com -{ -########################################## -# Load DietPi-Globals -########################################## -if [[ -f '/boot/dietpi/func/dietpi-globals' ]] -then - . /boot/dietpi/func/dietpi-globals -else - curl -sSf "https://raw.githubusercontent.com/${G_GITOWNER:=MichaIng}/DietPi/${G_GITBRANCH:=master}/dietpi/func/dietpi-globals" -o /tmp/dietpi-globals || exit 1 - # shellcheck disable=SC1091 - . /tmp/dietpi-globals - G_EXEC_NOHALT=1 G_EXEC rm /tmp/dietpi-globals - export G_GITOWNER G_GITBRANCH G_HW_ARCH_NAME=$(uname -m) -fi -case $G_HW_ARCH_NAME in - 'armv6l') export G_HW_ARCH=1;; - 'armv7l') export G_HW_ARCH=2;; - 'aarch64') export G_HW_ARCH=3;; - 'x86_64') export G_HW_ARCH=10;; - 'riscv64') export G_HW_ARCH=11;; - *) G_DIETPI-NOTIFY 1 "Unsupported host system architecture \"$G_HW_ARCH_NAME\" detected, aborting..."; exit 1;; -esac -readonly G_PROGRAM_NAME='DietPi-GMediaRender_container_setup' -G_CHECK_ROOT_USER -G_CHECK_ROOTFS_RW -readonly FP_ORIGIN=$PWD # Store origin dir -G_INIT -G_EXEC cd "$FP_ORIGIN" # Process everything in origin dir instead of /tmp/$G_PROGRAM_NAME - -########################################## -# Process inputs -########################################## -DISTRO= -ARCH= -while (( $# )) -do - case $1 in - '-d') shift; DISTRO=$1;; - '-a') shift; ARCH=$1;; - *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; - esac - shift -done -[[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1; } -case $ARCH in - 'armv6l') image="DietPi_Container-ARMv6-${DISTRO^}" arch=1;; - 'armv7l') image="DietPi_Container-ARMv7-${DISTRO^}" arch=2;; - 'aarch64') image="DietPi_Container-ARMv8-${DISTRO^}" arch=3;; - 'x86_64') image="DietPi_Container-x86_64-${DISTRO^}" arch=10;; - 'riscv64') image='DietPi_Container-RISC-V-Sid' arch=11;; - *) G_DIETPI-NOTIFY 1 "Invalid architecture \"$ARCH\" passed, aborting..."; exit 1;; -esac - -########################################## -# Dependencies -########################################## -apackages=('7zip' 'parted' 'fdisk' 'systemd-container') -(( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || apackages+=('qemu-user-static' 'binfmt-support') -G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" - -########################################## -# Prepare container -########################################## -# Download -G_EXEC curl -sSfO "https://dietpi.com/downloads/images/$image.7z" -G_EXEC 7zz e "$image.7z" "$image.img" -G_EXEC rm "$image.7z" -G_EXEC truncate -s 2G "$image.img" - -# Loop device -FP_LOOP=$(losetup -f) -G_EXEC losetup "$FP_LOOP" "$image.img" -G_EXEC partprobe "$FP_LOOP" -G_EXEC partx -u "$FP_LOOP" -G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" -G_EXEC_OUTPUT=1 G_EXEC eval "sfdisk -fN1 '$FP_LOOP' <<< ',+'" -G_EXEC partprobe "$FP_LOOP" -G_EXEC partx -u "$FP_LOOP" -G_EXEC_OUTPUT=1 G_EXEC resize2fs "${FP_LOOP}p1" -G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" -G_EXEC mkdir rootfs -G_EXEC mount "${FP_LOOP}p1" rootfs - -# Enable automated setup -G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt - -# Force ARMv6 arch on Raspbian -(( $arch == 1 )) && echo 'sed -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 - -# Avoid DietPi-Survey uploads to not mess with the statistics -G_EXEC rm rootfs/root/.ssh/known_hosts - -# Workaround invalid TERM on login -# shellcheck disable=SC2016 -G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || export TERM=dumb'\'' > rootfs/etc/bashrc.d/00-dietpi-build.sh' - -# 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 - -# Automated build -cat << _EOF_ > rootfs/boot/Automation_Custom_Script.sh || exit 1 -#!/bin/dash -echo '[ INFO ] Running GMediaRender build script...' -bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/software/gmediarender/build.bash')" -mv -v '/tmp/gmediarender_$ARCH.deb' / -poweroff -_EOF_ - -########################################## -# Boot container -########################################## -systemd-nspawn -bD rootfs -[[ -f rootfs/gmediarender_$ARCH.deb ]] || exit 1 -} diff --git a/.build/software/gogs/build.bash b/.build/software/gogs/build.bash index 184907bd1b..e29b14dc36 100755 --- a/.build/software/gogs/build.bash +++ b/.build/software/gogs/build.bash @@ -3,8 +3,8 @@ . /boot/dietpi/func/dietpi-globals # Build deps -deps=() c7zip='7zr' -(( $G_DISTRO > 6 )) && deps+=('7zip') c7zip='7zz' +(( $G_DISTRO < 7 )) && deps=('p7zip') || deps=('7zip') +(( $G_DISTRO == 7 )) && c7zip='7zz' || c7zip='7zr' # Since Trixie, the 7zip package provides again (only) the 7z/7zr commands, not 7zz G_AGUP G_AGDUG gcc libc6-dev "${deps[@]}" @@ -12,6 +12,8 @@ G_AGDUG gcc libc6-dev "${deps[@]}" # Download & Build # shellcheck disable=SC1091 . /etc/bashrc.d/go.sh +# - Trixie: Workaround for missing HOME, as we run dietpi-login from a systemd service instead of after an actual autologin, so that GOPATH is not defined either: go: go: module cache not found: neither GOMODCACHE nor GOPATH is set +[[ $HOME ]] || export HOME='/root' G_EXEC_OUTPUT=1 G_EXEC go install 'gogs.io/gogs@latest' # Archive diff --git a/.build/software/gogs/container_build.bash b/.build/software/gogs/container_build.bash deleted file mode 100755 index b4c47a3c67..0000000000 --- a/.build/software/gogs/container_build.bash +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash -# Created by MichaIng / micha@dietpi.com / dietpi.com -{ -########################################## -# Load DietPi-Globals -########################################## -if [[ -f '/boot/dietpi/func/dietpi-globals' ]] -then - . /boot/dietpi/func/dietpi-globals -else - curl -sSf "https://raw.githubusercontent.com/${G_GITOWNER:=MichaIng}/DietPi/${G_GITBRANCH:=master}/dietpi/func/dietpi-globals" -o /tmp/dietpi-globals || exit 1 - # shellcheck disable=SC1091 - . /tmp/dietpi-globals - G_EXEC_NOHALT=1 G_EXEC rm /tmp/dietpi-globals - export G_GITOWNER G_GITBRANCH G_HW_ARCH_NAME=$(uname -m) -fi -case $G_HW_ARCH_NAME in - 'armv6l') export G_HW_ARCH=1;; - 'armv7l') export G_HW_ARCH=2;; - 'aarch64') export G_HW_ARCH=3;; - 'x86_64') export G_HW_ARCH=10;; - 'riscv64') export G_HW_ARCH=11;; - *) G_DIETPI-NOTIFY 1 "Unsupported host system architecture \"$G_HW_ARCH_NAME\" detected, aborting..."; exit 1;; -esac -readonly G_PROGRAM_NAME='DietPi-Gogs_container_setup' -G_CHECK_ROOT_USER -G_CHECK_ROOTFS_RW -readonly FP_ORIGIN=$PWD # Store origin dir -G_INIT -G_EXEC cd "$FP_ORIGIN" # Process everything in origin dir instead of /tmp/$G_PROGRAM_NAME - -########################################## -# Process inputs -########################################## -DISTRO= -ARCH= -while (( $# )) -do - case $1 in - '-d') shift; DISTRO=$1;; - '-a') shift; ARCH=$1;; - *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; - esac - shift -done -case $DISTRO in - 5) distro='buster';; - 6) distro='bullseye';; - 7) distro='bookworm';; - 8) distro='trixie';; - *) G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1;; -esac -case $ARCH in - 1) image="DietPi_Container-ARMv6-${distro^}" arch='armv6l';; - 2) image="DietPi_Container-ARMv7-${distro^}" arch='armv7l';; - 3) image="DietPi_Container-ARMv8-${distro^}" arch='aarch64';; - 10) image="DietPi_Container-x86_64-${distro^}" arch='x86_64';; - 11) image='DietPi_Container-RISC-V-Sid' arch='riscv64';; - *) G_DIETPI-NOTIFY 1 "Invalid architecture \"$ARCH\" passed, aborting..."; exit 1;; -esac - -########################################## -# Dependencies -########################################## -apackages=('7zip' 'parted' 'fdisk' 'systemd-container') -(( $G_HW_ARCH == $ARCH || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $ARCH ) )) || apackages+=('qemu-user-static' 'binfmt-support') -G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" - -########################################## -# Prepare container -########################################## -# Download -G_EXEC curl -sSfO "https://dietpi.com/downloads/images/$image.7z" -G_EXEC 7zz e "$image.7z" "$image.img" -G_EXEC rm "$image.7z" -G_EXEC truncate -s 2G "$image.img" - -# Loop device -FP_LOOP=$(losetup -f) -G_EXEC losetup "$FP_LOOP" "$image.img" -G_EXEC partprobe "$FP_LOOP" -G_EXEC partx -u "$FP_LOOP" -G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" -G_EXEC_OUTPUT=1 G_EXEC eval "sfdisk -fN1 '$FP_LOOP' <<< ',+'" -G_EXEC partprobe "$FP_LOOP" -G_EXEC partx -u "$FP_LOOP" -G_EXEC_OUTPUT=1 G_EXEC resize2fs "${FP_LOOP}p1" -G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" -G_EXEC mkdir rootfs -G_EXEC mount "${FP_LOOP}p1" rootfs - -# Enable automated install with Go -G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt -G_CONFIG_INJECT 'AUTO_SETUP_INSTALL_SOFTWARE_ID=' 'AUTO_SETUP_INSTALL_SOFTWARE_ID=188' rootfs/boot/dietpi.txt - -# Force ARMv6 arch on Raspbian -(( $ARCH == 1 )) && echo 'sed -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 - -# Avoid DietPi-Survey uploads to not mess with the statistics -G_EXEC rm rootfs/root/.ssh/known_hosts - -# Workaround invalid TERM on login -# shellcheck disable=SC2016 -G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || export TERM=dumb'\'' > rootfs/etc/bashrc.d/00-dietpi-build.sh' - -# 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 - -# Automated build -cat << _EOF_ > rootfs/boot/Automation_Custom_Script.sh || exit 1 -#!/bin/dash -echo '[ INFO ] Running Gogs build script...' -bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/software/gogs/build.bash')" -mv -v '/tmp/gogs_$arch.7z' / -poweroff -_EOF_ - -########################################## -# Boot container -########################################## -systemd-nspawn -bD rootfs -[[ -f rootfs/gogs_$arch.7z ]] || exit 1 -} diff --git a/.build/software/shairport-sync/build.bash b/.build/software/shairport-sync/build.bash index c20ff263d2..940e13ff1a 100755 --- a/.build/software/shairport-sync/build.bash +++ b/.build/software/shairport-sync/build.bash @@ -12,6 +12,20 @@ G_AGUP G_AGDUG automake pkg-config make g++ libpopt-dev libconfig-dev libssl-dev libsoxr-dev libavahi-client-dev libasound2-dev libglib2.0-dev libmosquitto-dev avahi-daemon git libplist-dev libsodium-dev libgcrypt20-dev libavformat-dev xxd (( $G_DISTRO == 5 )) && G_EXEC systemctl unmask avahi-daemon +adeps=('libc6' 'libasound2' 'libavahi-client3' 'libsoxr0' 'libconfig9' 'libpopt0' 'libglib2.0-0' 'libmosquitto1' 'avahi-daemon') +adeps2=('libplist3' 'libsodium23' 'libgcrypt20') +case $G_DISTRO in + 5|6) adeps+=('libssl1.1'); adeps2+=('libavcodec58');; + 7) adeps+=('libssl3'); adeps2+=('libavcodec59');; + 8) adeps+=('libssl3'); adeps2+=('libavcodec60');; + *) G_DIETPI-NOTIFY 1 "Unsupported distro version: $G_DISTRO_NAME (ID=$G_DISTRO)"; exit 1;; +esac +for i in "${adeps[@]}" "${adeps2[@]}" +do + dpkg-query -s "$i" &> /dev/null && continue + G_DIETPI-NOTIFY 1 "Expected dependency package was not installed: $i" + exit 1 +done # Obtain latest version name='shairport-sync' @@ -329,9 +343,7 @@ G_EXEC chmod +x "$DIR/DEBIAN/"{postinst,prerm,postrm} # - md5sums find "$DIR" ! \( -path "$DIR/DEBIAN" -prune \) -type f -exec md5sum {} + | sed "s|$DIR/||" > "$DIR/DEBIAN/md5sums" -# - Add dependencies -adeps=('libc6' 'libasound2' 'libavahi-client3' 'libsoxr0' 'libconfig9' 'libpopt0' 'libglib2.0-0' 'libmosquitto1' 'avahi-daemon') -(( $G_DISTRO > 6 )) && adeps+=('libssl3') || adeps+=('libssl1.1') +# - Obtain DEB dependency versions DEPS_APT_VERSIONED= for i in "${adeps[@]}" do @@ -339,7 +351,7 @@ do done DEPS_APT_VERSIONED=${DEPS_APT_VERSIONED%,} # shellcheck disable=SC2001 -grep -q 'raspbian' /etc/os-release && DEPS_APT_VERSIONED=$(sed 's/+rp[it][0-9]\+[^)]*)/)/g' <<< "$DEPS_APT_VERSIONED") || DEPS_APT_VERSIONED=$(sed 's/+b[0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") +[[ $G_HW_ARCH_NAME == 'armv6l' ]] && DEPS_APT_VERSIONED=$(sed 's/+rp[it][0-9]\+[^)]*)/)/g' <<< "$DEPS_APT_VERSIONED") || DEPS_APT_VERSIONED=$(sed 's/+b[0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") # - Obtain version suffix G_EXEC curl -sSfo package.deb "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/${name}_$G_HW_ARCH_NAME.deb" @@ -426,6 +438,15 @@ then useradd -rMU -G audio -d /nonexistent -s /usr/sbin/nologin $name fi + if getent passwd nqptp > /dev/null + then + echo 'Configuring NQPTP service user ...' + usermod -d /nonexistent -s /usr/sbin/nologin nqptp + else + echo 'Creating NQPTP service user ...' + useradd -rMU -d /nonexistent -s /usr/sbin/nologin nqptp + fi + echo 'Configuring NQPTP systemd service ...' systemctl unmask nqptp systemctl enable --now nqptp @@ -485,27 +506,31 @@ then echo 'Removing $name_pretty service group ...' groupdel $name fi + + if getent passwd nqptp > /dev/null + then + echo 'Removing NQPTP service user ...' + userdel nqptp + fi + + if getent group nqptp > /dev/null + then + echo 'Removing NQPTP service group ...' + groupdel nqptp + fi fi _EOF_ # - md5sums find "$DIR" ! \( -path "$DIR/DEBIAN" -prune \) -type f -exec md5sum {} + | sed "s|$DIR/||" > "$DIR/DEBIAN/md5sums" -# - Add dependencies -adeps+=('libplist3' 'libsodium23' 'libgcrypt20') -case $G_DISTRO in - 5|6) adeps+=('libavcodec58');; - 7) adeps+=('libavcodec59');; - *) adeps+=('libavcodec60');; -esac -DEPS_APT_VERSIONED= -for i in "${adeps[@]}" +# - Obtain DEB dependency versions +for i in "${adeps2[@]}" do - DEPS_APT_VERSIONED+=" $i (>= $(dpkg-query -Wf '${VERSION}' "$i"))," + DEPS_APT_VERSIONED+=", $i (>= $(dpkg-query -Wf '${VERSION}' "$i"))" done -DEPS_APT_VERSIONED=${DEPS_APT_VERSIONED%,} # shellcheck disable=SC2001 -grep -q 'raspbian' /etc/os-release && DEPS_APT_VERSIONED=$(sed 's/+rp[it][0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") || DEPS_APT_VERSIONED=$(sed 's/+b[0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") +[[ $G_HW_ARCH_NAME == 'armv6l' ]] && DEPS_APT_VERSIONED=$(sed 's/+rp[it][0-9]\+[^)]*)/)/g' <<< "$DEPS_APT_VERSIONED") || DEPS_APT_VERSIONED=$(sed 's/+b[0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") # - control cat << _EOF_ > "$DIR/DEBIAN/control" diff --git a/.build/software/shairport-sync/container_build.bash b/.build/software/shairport-sync/container_build.bash deleted file mode 100755 index 3085acbf5e..0000000000 --- a/.build/software/shairport-sync/container_build.bash +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# Created by MichaIng / micha@dietpi.com / dietpi.com -{ -########################################## -# Load DietPi-Globals -########################################## -if [[ -f '/boot/dietpi/func/dietpi-globals' ]] -then - . /boot/dietpi/func/dietpi-globals -else - curl -sSf "https://raw.githubusercontent.com/${G_GITOWNER:=MichaIng}/DietPi/${G_GITBRANCH:=master}/dietpi/func/dietpi-globals" -o /tmp/dietpi-globals || exit 1 - # shellcheck disable=SC1091 - . /tmp/dietpi-globals - G_EXEC_NOHALT=1 G_EXEC rm /tmp/dietpi-globals - export G_GITOWNER G_GITBRANCH G_HW_ARCH_NAME=$(uname -m) -fi -case $G_HW_ARCH_NAME in - 'armv6l') export G_HW_ARCH=1;; - 'armv7l') export G_HW_ARCH=2;; - 'aarch64') export G_HW_ARCH=3;; - 'x86_64') export G_HW_ARCH=10;; - 'riscv64') export G_HW_ARCH=11;; - *) G_DIETPI-NOTIFY 1 "Unsupported host system architecture \"$G_HW_ARCH_NAME\" detected, aborting..."; exit 1;; -esac -readonly G_PROGRAM_NAME='DietPi-Shairport-Sync_container_setup' -G_CHECK_ROOT_USER -G_CHECK_ROOTFS_RW -readonly FP_ORIGIN=$PWD # Store origin dir -G_INIT -G_EXEC cd "$FP_ORIGIN" # Process everything in origin dir instead of /tmp/$G_PROGRAM_NAME - -########################################## -# Process inputs -########################################## -DISTRO= -ARCH= -while (( $# )) -do - case $1 in - '-d') shift; DISTRO=$1;; - '-a') shift; ARCH=$1;; - *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; - esac - shift -done -[[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1; } -case $ARCH in - 'armv6l') image="ARMv6-${DISTRO^}" arch=1;; - 'armv7l') image="ARMv7-${DISTRO^}" arch=2;; - 'aarch64') image="ARMv8-${DISTRO^}" arch=3;; - 'x86_64') image="x86_64-${DISTRO^}" arch=10;; - 'riscv64') image='RISC-V-Sid' arch=11;; - *) G_DIETPI-NOTIFY 1 "Invalid architecture \"$ARCH\" passed, aborting..."; exit 1;; -esac -image="DietPi_Container-$image.img" - -########################################## -# Dependencies -########################################## -apackages=('xz-utils' 'parted' 'fdisk' 'systemd-container') -(( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || apackages+=('qemu-user-static' 'binfmt-support') -G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" - -########################################## -# Prepare container -########################################## -# Download -G_EXEC curl -sSfO "https://dietpi.com/downloads/images/$image.xz" -G_EXEC xz -d "$image.xz" -G_EXEC truncate -s 2G "$image" - -# Loop device -FP_LOOP=$(losetup -f) -G_EXEC losetup "$FP_LOOP" "$image" -G_EXEC partprobe "$FP_LOOP" -G_EXEC partx -u "$FP_LOOP" -G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" -G_EXEC_OUTPUT=1 G_EXEC eval "sfdisk -fN1 '$FP_LOOP' <<< ',+'" -G_EXEC partprobe "$FP_LOOP" -G_EXEC partx -u "$FP_LOOP" -G_EXEC_OUTPUT=1 G_EXEC resize2fs "${FP_LOOP}p1" -G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" -G_EXEC mkdir rootfs -G_EXEC mount "${FP_LOOP}p1" rootfs - -# Enable automated setup -G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt - -# Force ARMv6 arch on Raspbian -(( $arch == 1 )) && echo 'sed -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 - -# Avoid DietPi-Survey uploads to not mess with the statistics -G_EXEC rm rootfs/root/.ssh/known_hosts - -# Workaround invalid TERM on login -# shellcheck disable=SC2016 -G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || export TERM=dumb'\'' > rootfs/etc/bashrc.d/00-dietpi-build.sh' - -# 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 - -# Automated build -cat << _EOF_ > rootfs/boot/Automation_Custom_Script.sh || exit 1 -#!/bin/dash -echo '[ INFO ] Running Shairport Sync build script...' -bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/software/shairport-sync/build.bash')" -mv -v '/tmp/shairport-sync_$ARCH.deb' '/tmp/shairport-sync-airplay2_$ARCH.deb' / -poweroff -_EOF_ - -########################################## -# Boot container -########################################## -systemd-nspawn -bD rootfs -[[ -f rootfs/shairport-sync_$ARCH.deb ]] || exit 1 -} diff --git a/.build/software/squeezelite/build.bash b/.build/software/squeezelite/build.bash index 9e578c6cba..1acf1e07b0 100755 --- a/.build/software/squeezelite/build.bash +++ b/.build/software/squeezelite/build.bash @@ -9,10 +9,17 @@ G_AGDUG make gcc libc6-dev libasound2-dev libflac-dev libmad0-dev libvorbis-dev # Runtime deps adeps=('libc6' 'libasound2' 'libmad0' 'libvorbisfile3' 'libmpg123-0' 'libsoxr0' 'liblirc-client0' 'libfaad2' 'libopus0') case $G_DISTRO in - [56]) adeps+=('libflac8' 'libavformat58' 'libssl1.1');; + 5|6) adeps+=('libflac8' 'libavformat58' 'libssl1.1');; 7) adeps+=('libflac12' 'libavformat59' 'libssl3');; + 8) adeps+=('libflac12' 'libavformat60' 'libssl3');; *) G_DIETPI-NOTIFY 1 "Unsupported distro version: $G_DISTRO_NAME (ID=$G_DISTRO)"; exit 1;; esac +for i in "${adeps[@]}" +do + dpkg-query -s "$i" &> /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 @@ -136,7 +143,7 @@ do done DEPS_APT_VERSIONED=${DEPS_APT_VERSIONED%,} # shellcheck disable=SC2001 -grep -q 'raspbian' /etc/os-release && DEPS_APT_VERSIONED=$(sed 's/+rp[it][0-9]\+[^)]*)/)/g' <<< "$DEPS_APT_VERSIONED") || DEPS_APT_VERSIONED=$(sed 's/+b[0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") +[[ $G_HW_ARCH_NAME == 'armv6l' ]] && DEPS_APT_VERSIONED=$(sed 's/+rp[it][0-9]\+[^)]*)/)/g' <<< "$DEPS_APT_VERSIONED") || DEPS_APT_VERSIONED=$(sed 's/+b[0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") # - Obtain version version="$(mawk -F\" '/MAJOR_VERSION/{print $2;exit}' squeezelite-master/squeezelite.h).$(mawk -F\" '/MINOR_VERSION/{print $2;exit}' squeezelite-master/squeezelite.h)-$(mawk -F\" '/MICRO_VERSION/{print $2;exit}' squeezelite-master/squeezelite.h)" diff --git a/.build/software/squeezelite/container_build.bash b/.build/software/squeezelite/container_build.bash deleted file mode 100755 index 36d3bde1be..0000000000 --- a/.build/software/squeezelite/container_build.bash +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# Created by MichaIng / micha@dietpi.com / dietpi.com -{ -########################################## -# Load DietPi-Globals -########################################## -if [[ -f '/boot/dietpi/func/dietpi-globals' ]] -then - . /boot/dietpi/func/dietpi-globals -else - curl -sSf "https://raw.githubusercontent.com/${G_GITOWNER:=MichaIng}/DietPi/${G_GITBRANCH:=master}/dietpi/func/dietpi-globals" -o /tmp/dietpi-globals || exit 1 - # shellcheck disable=SC1091 - . /tmp/dietpi-globals - G_EXEC_NOHALT=1 G_EXEC rm /tmp/dietpi-globals - export G_GITOWNER G_GITBRANCH G_HW_ARCH_NAME=$(uname -m) -fi -case $G_HW_ARCH_NAME in - 'armv6l') export G_HW_ARCH=1;; - 'armv7l') export G_HW_ARCH=2;; - 'aarch64') export G_HW_ARCH=3;; - 'x86_64') export G_HW_ARCH=10;; - 'riscv64') export G_HW_ARCH=11;; - *) G_DIETPI-NOTIFY 1 "Unsupported host system architecture \"$G_HW_ARCH_NAME\" detected, aborting..."; exit 1;; -esac -readonly G_PROGRAM_NAME='DietPi-Squeezelite_container_setup' -G_CHECK_ROOT_USER -G_CHECK_ROOTFS_RW -readonly FP_ORIGIN=$PWD # Store origin dir -G_INIT -G_EXEC cd "$FP_ORIGIN" # Process everything in origin dir instead of /tmp/$G_PROGRAM_NAME - -########################################## -# Process inputs -########################################## -DISTRO= -ARCH= -while (( $# )) -do - case $1 in - '-d') shift; DISTRO=$1;; - '-a') shift; ARCH=$1;; - *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; - esac - shift -done -[[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1; } -case $ARCH in - 'armv6l') image="DietPi_Container-ARMv6-${DISTRO^}" arch=1;; - 'armv7l') image="DietPi_Container-ARMv7-${DISTRO^}" arch=2;; - 'aarch64') image="DietPi_Container-ARMv8-${DISTRO^}" arch=3;; - 'x86_64') image="DietPi_Container-x86_64-${DISTRO^}" arch=10;; - 'riscv64') image='DietPi_Container-RISC-V-Sid' arch=11;; - *) G_DIETPI-NOTIFY 1 "Invalid architecture \"$ARCH\" passed, aborting..."; exit 1;; -esac - -########################################## -# Dependencies -########################################## -apackages=('7zip' 'parted' 'fdisk' 'systemd-container') -(( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || apackages+=('qemu-user-static' 'binfmt-support') -G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" - -########################################## -# Prepare container -########################################## -# Download -G_EXEC curl -sSfO "https://dietpi.com/downloads/images/$image.7z" -G_EXEC 7zz e "$image.7z" "$image.img" -G_EXEC rm "$image.7z" -G_EXEC truncate -s 2G "$image.img" - -# Loop device -FP_LOOP=$(losetup -f) -G_EXEC losetup "$FP_LOOP" "$image.img" -G_EXEC partprobe "$FP_LOOP" -G_EXEC partx -u "$FP_LOOP" -G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" -G_EXEC_OUTPUT=1 G_EXEC eval "sfdisk -fN1 '$FP_LOOP' <<< ',+'" -G_EXEC partprobe "$FP_LOOP" -G_EXEC partx -u "$FP_LOOP" -G_EXEC_OUTPUT=1 G_EXEC resize2fs "${FP_LOOP}p1" -G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" -G_EXEC mkdir rootfs -G_EXEC mount "${FP_LOOP}p1" rootfs - -# Enable automated setup -G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt - -# Force ARMv6 arch on Raspbian -(( $arch == 1 )) && echo 'sed -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 - -# Avoid DietPi-Survey uploads to not mess with the statistics -G_EXEC rm rootfs/root/.ssh/known_hosts - -# Workaround invalid TERM on login -# shellcheck disable=SC2016 -G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || export TERM=dumb'\'' > rootfs/etc/bashrc.d/00-dietpi-build.sh' - -# 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 - -# Automated build -cat << _EOF_ > rootfs/boot/Automation_Custom_Script.sh || exit 1 -#!/bin/dash -echo '[ INFO ] Running Squeezelite build script...' -bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/software/squeezelite/build.bash')" -mv -v '/tmp/squeezelite_$ARCH.deb' / -poweroff -_EOF_ - -########################################## -# Boot container -########################################## -systemd-nspawn -bD rootfs -[[ -f rootfs/squeezelite_$ARCH.deb ]] || exit 1 -} diff --git a/.build/software/vaultwarden/build.bash b/.build/software/vaultwarden/build.bash index f5385fc429..d269988f76 100755 --- a/.build/software/vaultwarden/build.bash +++ b/.build/software/vaultwarden/build.bash @@ -9,13 +9,19 @@ adeps=('libc6' 'openssl') (( $G_DISTRO > 6 )) && adeps+=('libssl3') || adeps+=('libssl1.1') G_AGUP G_AGDUG "${adeps_build[@]}" +for i in "${adeps[@]}" +do + dpkg-query -s "$i" &> /dev/null && continue + G_DIETPI-NOTIFY 1 "Expected dependency package was not installed: $i" + exit 1 +done # Install Rust via https://rustup.rs/ # - ARMv7: Needs to be installed in tmpfs, else builds fail in emulated 32-bit ARM environments: https://github.com/rust-lang/cargo/issues/8719 # - ARMv8: Apply workaround for increased RAM usage: https://github.com/rust-lang/cargo/issues/10583 # shellcheck disable=SC2015 export HOME='/tmp/rustup' CARGO_NET_GIT_FETCH_WITH_CLI='true' -[[ -d $HOME ]] || G_EXEC mkdir "$HOME" +G_EXEC mkdir -p "$HOME" G_EXEC cd "$HOME" G_EXEC curl -sSfo rustup-init.sh 'https://sh.rustup.rs' G_EXEC chmod +x rustup-init.sh @@ -33,6 +39,9 @@ version=$(curl -sSf 'https://api.github.com/repos/dani-garcia/vaultwarden/releas wv_url=$(curl -sSf 'https://api.github.com/repos/dani-garcia/bw_web_builds/releases/latest' | mawk -F\" '/^ "browser_download_url".*\.tar\.gz"$/{print $4}') [[ $wv_url ]] || { G_DIETPI-NOTIFY 1 'No latest web vault version found, aborting ...'; exit 1; } +# RISC-V workaround until ring dependency has been raised to v0.17+ +[[ $G_HW_ARCH == 11 && $version == '1.29.2' ]] && version_pkg=$version version='main' + # Build G_DIETPI-NOTIFY 2 "Building vaultwarden version \e[33m$version" G_EXEC cd /tmp @@ -57,6 +66,9 @@ G_EXEC mv "vaultwarden-$version/target/release/vaultwarden" "$DIR/opt/vaultwarde G_EXEC mv "vaultwarden-$version/.env.template" "$DIR/mnt/dietpi_userdata/vaultwarden/vaultwarden.env" G_EXEC rm -R "vaultwarden-$version" +# Revert RISC-V workaround until ring dependency has been raised to v0.17+ +[[ $G_HW_ARCH == 11 && $version_pkg ]] && version=$version_pkg + # - web vault G_DIETPI-NOTIFY 2 "Downloading web vault from \e[33m$wv_url" G_EXEC curl -sSfLo archive.tar.gz "$wv_url" diff --git a/.build/software/ympd/build.bash b/.build/software/ympd/build.bash index db36784dde..202a2660a2 100644 --- a/.build/software/ympd/build.bash +++ b/.build/software/ympd/build.bash @@ -4,6 +4,8 @@ # Build deps G_AGUP +# - ARMv6 Buster: Prevent install of 3.16.3-3~bpo10+1 from RPi repo, which breaks build: "list sub-command REMOVE_ITEM requires two or more arguments." +(( $G_HW_ARCH == 1 && $G_DISTRO == 5 )) && G_EXEC eval 'echo -e '\''Package: cmake cmake-data\nPin: origin archive.raspberrypi.org\nPin-Priority: -1'\'' > /etc/apt/preferences.d/dietpi-cmake' G_AGDUG cmake make gcc libc6-dev pkg-config libmpdclient-dev libssl-dev # Runtime deps @@ -13,6 +15,12 @@ case $G_DISTRO in 7|8) adeps+=('libssl3');; *) G_DIETPI-NOTIFY 1 "Unsupported distro version: $G_DISTRO_NAME (ID=$G_DISTRO)"; exit 1;; esac +for i in "${adeps[@]}" +do + dpkg-query -s "$i" &> /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 @@ -31,8 +39,8 @@ G_DIETPI-NOTIFY 2 'Starting packaging...' # Package dir G_EXEC cd /tmp -grep -q 'raspbian' /etc/os-release && DIR='ympd_armv6l' || DIR="ympd_$G_HW_ARCH_NAME" -G_EXEC rm -Rf "$DIR" +DIR="ympd_$G_HW_ARCH_NAME" +[[ -d $DIR ]] && G_EXEC rm -R "$DIR" G_EXEC mkdir -p "$DIR/"{DEBIAN,lib/systemd/system,usr/{bin,share/man/man1}} # - Binary @@ -134,7 +142,7 @@ do done DEPS_APT_VERSIONED=${DEPS_APT_VERSIONED%,} # shellcheck disable=SC2001 -grep -q 'raspbian' /etc/os-release && DEPS_APT_VERSIONED=$(sed 's/+rp[it][0-9]\+[^)]*)/)/g' <<< "$DEPS_APT_VERSIONED") || DEPS_APT_VERSIONED=$(sed 's/+b[0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") +(( $G_HW_ARCH == 1 )) && DEPS_APT_VERSIONED=$(sed 's/+rp[it][0-9]\+[^)]*)/)/g' <<< "$DEPS_APT_VERSIONED") || DEPS_APT_VERSIONED=$(sed 's/+b[0-9]\+)/)/g' <<< "$DEPS_APT_VERSIONED") # - Obtain version version="$(mawk -F\" '/CPACK_PACKAGE_VERSION_MAJOR/{print $2;exit}' ympd-master/CMakeLists.txt).$(mawk -F\" '/CPACK_PACKAGE_VERSION_MINOR/{print $2;exit}' ympd-master/CMakeLists.txt).$(mawk -F\" '/CPACK_PACKAGE_VERSION_PATCH/{print $2;exit}' ympd-master/CMakeLists.txt)" diff --git a/.build/software/ympd/container_build.bash b/.build/software/ympd/container_build.bash deleted file mode 100644 index 9b1c2de7be..0000000000 --- a/.build/software/ympd/container_build.bash +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# Created by MichaIng / micha@dietpi.com / dietpi.com -{ -########################################## -# Load DietPi-Globals -########################################## -if [[ -f '/boot/dietpi/func/dietpi-globals' ]] -then - . /boot/dietpi/func/dietpi-globals -else - curl -sSf "https://raw.githubusercontent.com/${G_GITOWNER:=MichaIng}/DietPi/${G_GITBRANCH:=master}/dietpi/func/dietpi-globals" -o /tmp/dietpi-globals || exit 1 - # shellcheck disable=SC1091 - . /tmp/dietpi-globals - G_EXEC_NOHALT=1 G_EXEC rm /tmp/dietpi-globals - export G_GITOWNER G_GITBRANCH G_HW_ARCH_NAME=$(uname -m) -fi -case $G_HW_ARCH_NAME in - 'armv6l') export G_HW_ARCH=1;; - 'armv7l') export G_HW_ARCH=2;; - 'aarch64') export G_HW_ARCH=3;; - 'x86_64') export G_HW_ARCH=10;; - 'riscv64') export G_HW_ARCH=11;; - *) G_DIETPI-NOTIFY 1 "Unsupported host system architecture \"$G_HW_ARCH_NAME\" detected, aborting..."; exit 1;; -esac -readonly G_PROGRAM_NAME='DietPi-ympd_container_setup' -G_CHECK_ROOT_USER -G_CHECK_ROOTFS_RW -readonly FP_ORIGIN=$PWD # Store origin dir -G_INIT -G_EXEC cd "$FP_ORIGIN" # Process everything in origin dir instead of /tmp/$G_PROGRAM_NAME - -########################################## -# Process inputs -########################################## -DISTRO= -ARCH= -while (( $# )) -do - case $1 in - '-d') shift; DISTRO=$1;; - '-a') shift; ARCH=$1;; - *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; - esac - shift -done -[[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1; } -case $ARCH in - 'armv6l') image="DietPi_Container-ARMv6-${DISTRO^}" arch=1;; - 'armv7l') image="DietPi_Container-ARMv7-${DISTRO^}" arch=2;; - 'aarch64') image="DietPi_Container-ARMv8-${DISTRO^}" arch=3;; - 'x86_64') image="DietPi_Container-x86_64-${DISTRO^}" arch=10;; - 'riscv64') image='DietPi_Container-RISC-V-Sid' arch=11;; - *) G_DIETPI-NOTIFY 1 "Invalid architecture \"$ARCH\" passed, aborting..."; exit 1;; -esac - -########################################## -# Dependencies -########################################## -apackages=('7zip' 'parted' 'fdisk' 'systemd-container') -(( $G_HW_ARCH == $arch || ( $G_HW_ARCH < 10 && $G_HW_ARCH > $arch ) )) || apackages+=('qemu-user-static' 'binfmt-support') -G_AG_CHECK_INSTALL_PREREQ "${apackages[@]}" - -########################################## -# Prepare container -########################################## -# Download -G_EXEC curl -sSfO "https://dietpi.com/downloads/images/$image.7z" -G_EXEC 7zz e "$image.7z" "$image.img" -G_EXEC rm "$image.7z" -G_EXEC truncate -s 2G "$image.img" - -# Loop device -FP_LOOP=$(losetup -f) -G_EXEC losetup "$FP_LOOP" "$image.img" -G_EXEC partprobe "$FP_LOOP" -G_EXEC partx -u "$FP_LOOP" -G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" -G_EXEC_OUTPUT=1 G_EXEC eval "sfdisk -fN1 '$FP_LOOP' <<< ',+'" -G_EXEC partprobe "$FP_LOOP" -G_EXEC partx -u "$FP_LOOP" -G_EXEC_OUTPUT=1 G_EXEC resize2fs "${FP_LOOP}p1" -G_EXEC_OUTPUT=1 G_EXEC e2fsck -fp "${FP_LOOP}p1" -G_EXEC mkdir rootfs -G_EXEC mount "${FP_LOOP}p1" rootfs - -# Enable automated setup -G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt - -# Force ARMv6 arch on Raspbian -(( $arch == 1 )) && echo 'sed -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 - -# Avoid DietPi-Survey uploads to not mess with the statistics -G_EXEC rm rootfs/root/.ssh/known_hosts - -# Workaround invalid TERM on login -# shellcheck disable=SC2016 -G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || export TERM=dumb'\'' > rootfs/etc/bashrc.d/00-dietpi-build.sh' - -# 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 - -# Automated build -cat << _EOF_ > rootfs/boot/Automation_Custom_Script.sh || exit 1 -#!/bin/dash -echo '[ INFO ] Running ympd build script...' -bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/software/ympd/build.bash')" -mv -v '/tmp/ympd_$ARCH.deb' / -poweroff -_EOF_ - -########################################## -# Boot container -########################################## -systemd-nspawn -bD rootfs -[[ -f rootfs/ympd_$ARCH.deb ]] || exit 1 -} diff --git a/.github/workflows/amiberry.yml b/.github/workflows/amiberry.yml index 2d3546749c..262f0781cc 100644 --- a/.github/workflows/amiberry.yml +++ b/.github/workflows/amiberry.yml @@ -54,9 +54,10 @@ jobs: plat: ${{ fromJson(needs.prep.outputs.plat) }} dist: ${{ fromJson(needs.prep.outputs.dist) }} exclude: + - { plat: rpi1, dist: trixie } - { plat: rk3588, dist: buster } fail-fast: false - name: "Build: ${{ matrix.plat }} - ${{ matrix.dist }}" + name: "${{ matrix.plat }} - ${{ matrix.dist }}" runs-on: ubuntu-22.04 steps: - name: Build diff --git a/.github/workflows/dietpi-build.yml b/.github/workflows/dietpi-build.yml index 5f1bd0a0bc..09b92f26d7 100644 --- a/.github/workflows/dietpi-build.yml +++ b/.github/workflows/dietpi-build.yml @@ -81,7 +81,9 @@ jobs: '"-m 79 -d 6", "-m 79 -d 7", "-m 79 -d 8", '\ '"-m 80 -d 6", "-m 80 -d 7", "-m 80 -d 8", '\ '"-m 81 -d 8", '\ - '"-m 82 -d 6", "-m 82 -d 7", "-m 82 -d 8"]' >> "$GITHUB_OUTPUT" + '"-m 82 -d 6", "-m 82 -d 7", "-m 82 -d 8", '\ + '"-m 85 -d 6", "-m 85 -d 7", "-m 85 -d 8", '\ + '"-m 86 -d 6", "-m 86 -d 7", "-m 86 -d 8"]' >> "$GITHUB_OUTPUT" elif [ "${{ github.event.inputs.buildargs }}" = 'quartz64' ] then echo buildargs=[\ diff --git a/.github/workflows/ympd.yml b/.github/workflows/dietpi-software-build.yml similarity index 56% rename from .github/workflows/ympd.yml rename to .github/workflows/dietpi-software-build.yml index ec63e31fe1..6d8f3010f7 100644 --- a/.github/workflows/ympd.yml +++ b/.github/workflows/dietpi-software-build.yml @@ -1,7 +1,13 @@ -name: ympd +name: DietPi-Software build on: workflow_dispatch: inputs: + name: + description: 'Software title' + type: choice + options: [gmediarender, gogs, shairport-sync, squeezelite, vaultwarden, ympd, all] + default: all + required: true arch: description: 'Target architecture' type: choice @@ -15,7 +21,7 @@ on: default: all required: true concurrency: - group: ${{ github.workflow }}-${{ github.event.inputs.arch }}-${{ github.event.inputs.dist }} + group: ${{ github.workflow }}-${{ github.event.inputs.name }}-${{ github.event.inputs.arch }}-${{ github.event.inputs.dist }} cancel-in-progress: true permissions: {} defaults: @@ -25,11 +31,20 @@ defaults: jobs: prep: outputs: + name: ${{ steps.name.outputs.name }} arch: ${{ steps.arch.outputs.arch }} dist: ${{ steps.dist.outputs.dist }} # https://github.com/actions/runner-images runs-on: ubuntu-22.04 steps: + - id: name + run: | + if [ '${{ github.event.inputs.name }}' = 'all' ] + then + echo 'name=["gmediarender", "gogs", "shairport-sync", "squeezelite", "vaultwarden", "ympd"]' >> "$GITHUB_OUTPUT" + else + echo 'name=["${{ github.event.inputs.name }}"]' >> "$GITHUB_OUTPUT" + fi - id: arch run: | if [ '${{ github.event.inputs.arch }}' = 'all' ] @@ -50,18 +65,24 @@ jobs: needs: prep strategy: matrix: + name: ${{ fromJson(needs.prep.outputs.name) }} arch: ${{ fromJson(needs.prep.outputs.arch) }} dist: ${{ fromJson(needs.prep.outputs.dist) }} exclude: - { arch: riscv64, dist: buster } - { arch: riscv64, dist: bullseye } - { arch: riscv64, dist: bookworm } + - { arch: riscv64, name: vaultwarden } + - { arch: armv6l, dist: trixie } + - { arch: armv7l, name: gogs } + - { arch: aarch64, name: gogs } + - { arch: x86_64, name: gogs } fail-fast: false - name: "Build: ${{ matrix.arch }} - ${{ matrix.dist }}" + name: "${{ matrix.name }} - ${{ matrix.arch }} - ${{ matrix.dist }}" runs-on: ubuntu-22.04 steps: - name: Build - run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=$GITHUB_REF_NAME; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/$GITHUB_REF_NAME/.build/software/ympd/container_build.bash")" -- -a '${{ matrix.arch }}' -d '${{ matrix.dist }}' + run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=$GITHUB_REF_NAME; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/$GITHUB_REF_NAME/.build/software/dietpi-software-build.bash")" -- -n '${{ matrix.name }}' -a '${{ matrix.arch }}' -d '${{ matrix.dist }}' - name: Upload run: | # SSH server and client keys @@ -70,7 +91,18 @@ jobs: echo '${{ secrets.KNOWN_HOSTS }}' > ~/.ssh/known_hosts echo '${{ secrets.SSH_KEY }}' > ~/.ssh/id_ed25519 + # Generate file lists + files= + urls='"https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/"' + cd rootfs/output + for i in * + do + files="$files,$i" + urls="$urls,\"https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/$i\"" + done + files=${files#,} + echo "Uploading file(s) $files to URL(s) $urls ..." + # Upload - curl -T 'rootfs/ympd_${{ matrix.arch }}.deb' --key ~/.ssh/id_ed25519 '${{ secrets.UPLOAD_URL }}${{ matrix.dist }}/' - curl 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache' -H 'Authorization: Bearer ${{ secrets.CF_TOKEN }}' -H 'Content-Type: application/json' \ - --data '{"files":["https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/","https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/ympd_${{ matrix.arch }}.deb"]}' + curl -T "{$files}" --key ~/.ssh/id_ed25519 '${{ secrets.UPLOAD_URL }}${{ matrix.dist }}/' + 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/.github/workflows/dietpi-software.bash b/.github/workflows/dietpi-software.bash index 64a9249ec0..663ea4e861 100644 --- a/.github/workflows/dietpi-software.bash +++ b/.github/workflows/dietpi-software.bash @@ -11,7 +11,7 @@ else curl -sSf "https://raw.githubusercontent.com/${G_GITOWNER:=MichaIng}/DietPi/${G_GITBRANCH:=master}/dietpi/func/dietpi-globals" -o /tmp/dietpi-globals || exit 1 # shellcheck disable=SC1091 . /tmp/dietpi-globals - G_EXEC_NOHALT=1 G_EXEC rm /tmp/dietpi-globals + G_EXEC rm /tmp/dietpi-globals export G_GITOWNER G_GITBRANCH G_HW_ARCH_NAME=$(uname -m) fi case $G_HW_ARCH_NAME in @@ -35,7 +35,8 @@ G_EXEC cd "$FP_ORIGIN" # Process everything in origin dir instead of /tmp/$G_PRO DISTRO= ARCH= SOFTWARE= -RPI= +RPI=false +TEST=false while (( $# )) do case $1 in @@ -43,25 +44,28 @@ do '-a') shift; ARCH=$1;; '-s') shift; SOFTWARE=$1;; '-rpi') shift; RPI=$1;; + '-t') shift; TEST=$1;; *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; esac shift done [[ $DISTRO =~ ^('buster'|'bullseye'|'bookworm'|'trixie')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid distro \"$DISTRO\" passed, aborting..."; exit 1; } case $ARCH in - 'armv6l') image="DietPi_Container-ARMv6-${DISTRO^}.img" arch=1;; - 'armv7l') image="DietPi_Container-ARMv7-${DISTRO^}.img" arch=2;; - 'aarch64') image="DietPi_Container-ARMv8-${DISTRO^}.img" arch=3;; - 'x86_64') image="DietPi_Container-x86_64-${DISTRO^}.img" arch=10;; - 'riscv64') image="DietPi_Container-RISC-V-Sid.img" arch=11;; + 'armv6l') image="ARMv6-${DISTRO^}" arch=1;; + 'armv7l') image="ARMv7-${DISTRO^}" arch=2;; + 'aarch64') image="ARMv8-${DISTRO^}" arch=3;; + 'x86_64') image="x86_64-${DISTRO^}" arch=10;; + 'riscv64') image='RISC-V-Sid' arch=11;; *) G_DIETPI-NOTIFY 1 "Invalid architecture \"$ARCH\" passed, aborting..."; exit 1;; esac +image="DietPi_Container-$image.img" [[ $SOFTWARE =~ ^[0-9\ ]+$ ]] || { G_DIETPI-NOTIFY 1 "Invalid software list \"$SOFTWARE\" passed, aborting..."; exit 1; } -[[ $RPI =~ ^(|'false'|'true')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid RPi flag \"$RPI\" passed, aborting..."; exit 1; } +[[ $RPI =~ ^('false'|'true')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid RPi flag \"$RPI\" passed, aborting..."; exit 1; } +[[ $TEST =~ ^('false'|'true')$ ]] || { G_DIETPI-NOTIFY 1 "Invalid test flag \"$TEST\" passed, aborting..."; exit 1; } # Workaround for "Could not execute systemctl: at /usr/bin/deb-systemd-invoke line 145." during Apache2 DEB postinst in 32-bit ARM Bookworm container: https://lists.ubuntu.com/archives/foundations-bugs/2022-January/467253.html [[ $SOFTWARE =~ (^| )83( |$) && $DISTRO == 'bookworm' ]] && (( $arch < 3 )) && { echo '[ WARN ] Installing Lighttpd instead of Apache due to a bug in 32-bit ARM containers'; SOFTWARE=$(sed -E 's/(^| )83( |$)/\184\2/g' <<< "$SOFTWARE"); } -# Remove Roon Extension Manager and Portainer from test installs as Docker cannot start in systemd containers +# Remove Docker containers from test installs as Docker cannot start in systemd containers [[ $SOFTWARE =~ (^| )(86|142|185)( |$) ]] && { echo '[ WARN ] Removing Roon Extension Manager, MicroK8s and Portainer from test installs as Docker cannot start in systemd containers'; SOFTWARE=$(sed -E 's/(^| )(86|142|186)( |$)/\1\3/g' <<< "$SOFTWARE"); } # Add MariaDB with Allo GUI (non-full/reinstall ID 160), as otherwise the install fails [[ $SOFTWARE =~ (^| )160( |$) ]] && SOFTWARE=$(sed -E 's/(^| )160( |$)/\188 160\2/g' <<< "$SOFTWARE") @@ -295,17 +299,46 @@ then G_EXEC rm rootfs/etc/.dietpi_hw_model_identifier G_EXEC touch rootfs/boot/{bcm-rpi-dummy.dtb,config.txt,cmdline.txt} G_EXEC sed -i "/# Start DietPi-Software/iG_EXEC sed -i -e '/^G_HW_MODEL=/cG_HW_MODEL=$model' -e '/^G_HW_MODEL_NAME=/cG_HW_MODEL_NAME=\"RPi $model ($ARCH)\"' /boot/dietpi/.hw_model" rootfs/boot/dietpi/dietpi-login - G_EXEC curl -sSf 'https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb' -o keyring.deb + G_EXEC curl -sSfo keyring.deb 'https://archive.raspberrypi.org/debian/pool/main/r/raspberrypi-archive-keyring/raspberrypi-archive-keyring_2021.1.1+rpt1_all.deb' G_EXEC dpkg --root=rootfs -i keyring.deb G_EXEC rm keyring.deb + # Enforce Debian Trixie FFmpeg packages over RPi repo ones + [[ $DISTRO != 'trixie' ]] || cat << '_EOF_' > rootfs/etc/apt/preferences.d/dietpi-ffmpeg || exit 1 +Package: src:ffmpeg +Pin: origin archive.raspberrypi.org +Pin-Priority: -1 +_EOF_ fi +# Install test builds from dietpi.com if requested +# shellcheck disable=SC2016 +[[ $TEST == 'true' ]] && G_EXEC sed -i '/# Start DietPi-Software/a\sed -i '\''s|dietpi.com/downloads/binaries/$G_DISTRO_NAME/|dietpi.com/downloads/binaries/$G_DISTRO_NAME/testing/|'\'' /boot/dietpi/dietpi-software' rootfs/boot/dietpi/dietpi-login + # Workaround invalid TERM on login # shellcheck disable=SC2016 G_EXEC eval 'echo '\''infocmp "$TERM" > /dev/null 2>&1 || { echo "[ INFO ] Unsupported TERM=\"$TERM\", switching to TERM=\"dumb\""; export TERM=dumb; }'\'' > rootfs/etc/bashrc.d/00-dietpi-ci.sh' # Enable automated setup G_CONFIG_INJECT 'AUTO_SETUP_AUTOMATED=' 'AUTO_SETUP_AUTOMATED=1' rootfs/boot/dietpi.txt +# - Workaround for skipped autologin in emulated Trixie/Sid containers: https://gitlab.com/qemu-project/qemu/-/issues/1962 +if [[ $DISTRO == 'trixie' ]] && (( $G_HW_ARCH != $arch && ( $G_HW_ARCH > 9 || $G_HW_ARCH < $arch ) )) +then + cat << '_EOF_' > rootfs/etc/systemd/system/dietpi-automation.service +[Unit] +Description=DietPi-Automation +After=dietpi-postboot.service + +[Service] +Type=idle +StandardOutput=tty +ExecStart=/bin/dash -c 'infocmp "$TERM" > /dev/null 2>&1 || export TERM=dumb; exec /boot/dietpi/dietpi-login' +ExecStop=/sbin/poweroff + +[Install] +WantedBy=multi-user.target +_EOF_ + G_EXEC ln -s /etc/systemd/system/dietpi-automation.service rootfs/etc/systemd/system/multi-user.target.wants/ +fi # 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 diff --git a/.github/workflows/dietpi-software.yml b/.github/workflows/dietpi-software.yml index 3be30f25f9..f80c85dec7 100644 --- a/.github/workflows/dietpi-software.yml +++ b/.github/workflows/dietpi-software.yml @@ -1,4 +1,4 @@ -name: DietPi-Software +name: DietPi-Software test on: workflow_dispatch: inputs: @@ -25,14 +25,18 @@ on: description: 'Override target repo branch' owner: description: 'Override target repo owner' + test: + description: 'Install test builds from dietpi.com' + type: boolean + default: false concurrency: group: ${{ github.workflow }}-${{ github.event.inputs.arch }}-${{ github.event.inputs.dist }}-${{ github.event.inputs.soft }} cancel-in-progress: true permissions: {} defaults: run: - #working-directory: /dev/shm # uses too much RAM which can lead to OOM kills shell: sh + #working-directory: /dev/shm # uses too much RAM which can lead to OOM kills jobs: prep: # https://github.com/actions/runner-images @@ -67,6 +71,7 @@ jobs: - { arch: riscv64, dist: buster } - { arch: riscv64, dist: bullseye } - { arch: riscv64, dist: bookworm } + - { arch: armv6l, dist: trixie } fail-fast: false name: "${{ matrix.arch }} - ${{ matrix.dist }} - ${{ github.event.inputs.soft }}" runs-on: ubuntu-22.04 @@ -79,4 +84,4 @@ jobs: [ $branch ] || branch=$GITHUB_REF_NAME sudo systemctl --now mask ssh mono-xsp4 systemd-resolved echo 'nameserver 1.1.1.1' | sudo tee /etc/resolv.conf > /dev/null - sudo bash -c "G_GITOWNER=$owner G_GITBRANCH=$branch; $(curl -sSf "https://raw.githubusercontent.com/$owner/DietPi/$branch/.github/workflows/dietpi-software.bash" || echo false)" -- -a '${{ matrix.arch }}' -d '${{ matrix.dist }}' -s '${{ github.event.inputs.soft }}' -rpi '${{ github.event.inputs.rpi }}' + sudo bash -c "G_GITOWNER=$owner G_GITBRANCH=$branch; $(curl -sSf "https://raw.githubusercontent.com/$owner/DietPi/$branch/.github/workflows/dietpi-software.bash" || echo false)" -- -a '${{ matrix.arch }}' -d '${{ matrix.dist }}' -s '${{ github.event.inputs.soft }}' -rpi '${{ github.event.inputs.rpi }}' -t '${{ github.event.inputs.test }}' diff --git a/.github/workflows/gmediarender.yml b/.github/workflows/gmediarender.yml deleted file mode 100644 index 227a1001e4..0000000000 --- a/.github/workflows/gmediarender.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: gmediarender -on: - workflow_dispatch: - inputs: - arch: - description: 'Target architecture' - type: choice - options: [armv6l, armv7l, aarch64, x86_64, riscv64, all] - default: all - required: true - dist: - description: 'Target Debian version' - type: choice - options: [buster, bullseye, bookworm, trixie, all] - default: all - required: true -concurrency: - group: ${{ github.workflow }}-${{ github.event.inputs.arch }}-${{ github.event.inputs.dist }} - cancel-in-progress: true -permissions: {} -defaults: - run: - shell: sh - working-directory: /dev/shm -jobs: - prep: - outputs: - arch: ${{ steps.arch.outputs.arch }} - dist: ${{ steps.dist.outputs.dist }} - # https://github.com/actions/runner-images - runs-on: ubuntu-22.04 - steps: - - id: arch - run: | - if [ '${{ github.event.inputs.arch }}' = 'all' ] - then - echo 'arch=["armv6l", "armv7l", "aarch64", "x86_64", "riscv64"]' >> "$GITHUB_OUTPUT" - else - echo 'arch=["${{ github.event.inputs.arch }}"]' >> "$GITHUB_OUTPUT" - fi - - id: dist - run: | - if [ '${{ github.event.inputs.dist }}' = 'all' ] - then - echo 'dist=["buster", "bullseye", "bookworm", "trixie"]' >> "$GITHUB_OUTPUT" - else - echo 'dist=["${{ github.event.inputs.dist }}"]' >> "$GITHUB_OUTPUT" - fi - build: - needs: prep - strategy: - matrix: - arch: ${{ fromJson(needs.prep.outputs.arch) }} - dist: ${{ fromJson(needs.prep.outputs.dist) }} - exclude: - - { arch: riscv64, dist: buster } - - { arch: riscv64, dist: bullseye } - - { arch: riscv64, dist: bookworm } - fail-fast: false - name: "Build: ${{ matrix.arch }} - ${{ matrix.dist }}" - runs-on: ubuntu-22.04 - steps: - - name: Build - run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=$GITHUB_REF_NAME; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/$GITHUB_REF_NAME/.build/software/gmediarender/container_build.bash")" -- -a '${{ matrix.arch }}' -d '${{ matrix.dist }}' - - name: Upload - run: | - # SSH server and client keys - mkdir ~/.ssh - umask 377 - echo '${{ secrets.KNOWN_HOSTS }}' > ~/.ssh/known_hosts - echo '${{ secrets.SSH_KEY }}' > ~/.ssh/id_ed25519 - - # Upload - curl -T 'rootfs/gmediarender_${{ matrix.arch }}.deb' --key ~/.ssh/id_ed25519 '${{ secrets.UPLOAD_URL }}${{ matrix.dist }}/' - curl 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache' -H 'Authorization: Bearer ${{ secrets.CF_TOKEN }}' -H 'Content-Type: application/json' \ - --data '{"files":["https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/","https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/gmediarender_${{ matrix.arch }}.deb"]}' diff --git a/.github/workflows/gogs.yml b/.github/workflows/gogs.yml deleted file mode 100644 index ab6ce1742f..0000000000 --- a/.github/workflows/gogs.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: gogs -on: - workflow_dispatch: - inputs: - arch: - description: 'Target architecture index: 1, 2, 3, 10, 11 or all' - required: true - dist: - description: 'Target Debian version index: 5, 6, 7, 8 or all' - required: true -concurrency: - group: ${{ github.workflow }}-${{ github.event.inputs.arch }}-${{ github.event.inputs.dist }} - cancel-in-progress: true -permissions: {} -jobs: - prep: - outputs: - arch: ${{ steps.arch.outputs.arch }} - dist: ${{ steps.dist.outputs.dist }} - # https://github.com/actions/runner-images - runs-on: ubuntu-22.04 - defaults: - run: - shell: sh - steps: - - id: arch - run: | - if [ '${{ github.event.inputs.arch }}' = 'all' ] - then - echo arch='[1, 2, 3, 10, 11]' >> "$GITHUB_OUTPUT" - else - echo arch='[${{ github.event.inputs.arch }}]' >> "$GITHUB_OUTPUT" - fi - - id: dist - run: | - if [ '${{ github.event.inputs.dist }}' = 'all' ] - then - echo dist='[5, 6, 7, 8]' >> "$GITHUB_OUTPUT" - else - echo dist='[${{ github.event.inputs.dist }}]' >> "$GITHUB_OUTPUT" - fi - build: - needs: prep - strategy: - matrix: - arch: ${{ fromJson(needs.prep.outputs.arch) }} - dist: ${{ fromJson(needs.prep.outputs.dist) }} - exclude: - - { arch: 11, dist: 5 } - - { arch: 11, dist: 6 } - - { arch: 11, dist: 7 } - fail-fast: false - name: "Build: ${{ matrix.arch }} - ${{ matrix.dist }}" - runs-on: ubuntu-22.04 - defaults: - run: - working-directory: /dev/shm - steps: - - name: Build - run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=$GITHUB_REF_NAME; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/$GITHUB_REF_NAME/.build/software/gogs/container_build.bash")" 'DietPi-Build_Gogs' -a ${{ matrix.arch }} -d ${{ matrix.dist }} - - name: Upload - run: | - # Build variables - arch=${{ matrix.arch }} - dist=${{ matrix.dist }} - arch_to_name=([1]='armv6l' [2]='armv7l' [3]='aarch64' [10]='x86_64' [11]='riscv64') - dist_to_name=([5]='buster' [6]='bullseye' [7]='bookworm' [8]='trixie') - arch_name=${arch_to_name[$arch]} - dist_name=${dist_to_name[$dist]} - - # SSH server and client keys - mkdir ~/.ssh - umask 377 - echo '${{ secrets.KNOWN_HOSTS }}' > ~/.ssh/known_hosts - echo '${{ secrets.SSH_KEY }}' > ~/.ssh/id_ed25519 - - # Upload - curl -T "rootfs/gogs_$arch_name.7z" --key ~/.ssh/id_ed25519 "${{ secrets.UPLOAD_URL }}$dist_name/" - curl 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache' -H 'Authorization: Bearer ${{ secrets.CF_TOKEN }}' -H 'Content-Type: application/json' \ - --data "{\"files\":[\"https://dietpi.com/downloads/binaries/$dist_name/testing/\",\"https://dietpi.com/downloads/binaries/$dist_name/testing/gogs_$arch_name.7z\"]}" diff --git a/.github/workflows/raspberrypi-sys-mods.yml b/.github/workflows/raspberrypi-sys-mods.yml index 3caabdff27..528c7080f4 100644 --- a/.github/workflows/raspberrypi-sys-mods.yml +++ b/.github/workflows/raspberrypi-sys-mods.yml @@ -1,7 +1,7 @@ name: raspberrypi-sys-mods on: workflow_dispatch concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }} cancel-in-progress: true permissions: {} defaults: @@ -13,14 +13,17 @@ jobs: # https://github.com/actions/runner-images runs-on: ubuntu-22.04 steps: - - name: Build package + - name: Build run: sudo bash -c "$(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/${GITHUB_REF#refs/heads/}/.build/software/raspberrypi-sys-mods/build.bash")" - - name: Upload package + - name: Upload run: | - [ -d ~/.ssh ] || mkdir ~/.ssh + # SSH server and client keys + mkdir ~/.ssh umask 377 echo '${{ secrets.KNOWN_HOSTS }}' > ~/.ssh/known_hosts echo '${{ secrets.SSH_KEY }}' > ~/.ssh/id_ed25519 + + # Upload curl -T raspberrypi-sys-mods.deb --key ~/.ssh/id_ed25519 '${{ secrets.UPLOAD_URL }}all/' curl 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache' -H 'Authorization: Bearer ${{ secrets.CF_TOKEN }}' -H 'Content-Type: application/json' \ --data '{"files":["https://dietpi.com/downloads/binaries/testing/","https://dietpi.com/downloads/binaries/testing/raspberrypi-sys-mods.deb"]}' diff --git a/.github/workflows/shairport-sync.yml b/.github/workflows/shairport-sync.yml deleted file mode 100644 index afb46fe8db..0000000000 --- a/.github/workflows/shairport-sync.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: shairport-sync -on: - workflow_dispatch: - inputs: - arch: - description: 'Target architecture' - type: choice - options: [armv6l, armv7l, aarch64, x86_64, riscv64, all] - default: all - required: true - dist: - description: 'Target Debian version' - type: choice - options: [buster, bullseye, bookworm, trixie, all] - default: all - required: true -concurrency: - group: ${{ github.workflow }}-${{ github.event.inputs.arch }}-${{ github.event.inputs.dist }} - cancel-in-progress: true -permissions: {} -defaults: - run: - shell: sh - working-directory: /dev/shm -jobs: - prep: - outputs: - arch: ${{ steps.arch.outputs.arch }} - dist: ${{ steps.dist.outputs.dist }} - # https://github.com/actions/runner-images - runs-on: ubuntu-22.04 - steps: - - id: arch - run: | - if [ '${{ github.event.inputs.arch }}' = 'all' ] - then - echo 'arch=["armv6l", "armv7l", "aarch64", "x86_64", "riscv64"]' >> "$GITHUB_OUTPUT" - else - echo 'arch=["${{ github.event.inputs.arch }}"]' >> "$GITHUB_OUTPUT" - fi - - id: dist - run: | - if [ '${{ github.event.inputs.dist }}' = 'all' ] - then - echo 'dist=["buster", "bullseye", "bookworm", "trixie"]' >> "$GITHUB_OUTPUT" - else - echo 'dist=["${{ github.event.inputs.dist }}"]' >> "$GITHUB_OUTPUT" - fi - build: - needs: prep - strategy: - matrix: - arch: ${{ fromJson(needs.prep.outputs.arch) }} - dist: ${{ fromJson(needs.prep.outputs.dist) }} - exclude: - - { arch: riscv64, dist: buster } - - { arch: riscv64, dist: bullseye } - - { arch: riscv64, dist: bookworm } - fail-fast: false - name: "Build: ${{ matrix.arch }} - ${{ matrix.dist }}" - runs-on: ubuntu-22.04 - steps: - - name: Build - run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=$GITHUB_REF_NAME; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/$GITHUB_REF_NAME/.build/software/shairport-sync/container_build.bash")" -- -a '${{ matrix.arch }}' -d '${{ matrix.dist }}' - - name: Upload - run: | - # SSH server and client keys - mkdir ~/.ssh - umask 377 - echo '${{ secrets.KNOWN_HOSTS }}' > ~/.ssh/known_hosts - echo '${{ secrets.SSH_KEY }}' > ~/.ssh/id_ed25519 - - # Upload - curl -T 'rootfs/shairport-sync_${{ matrix.arch }}.deb' --key ~/.ssh/id_ed25519 '${{ secrets.UPLOAD_URL }}${{ matrix.dist }}/' - curl -T 'rootfs/shairport-sync-airplay2_${{ matrix.arch }}.deb' --key ~/.ssh/id_ed25519 '${{ secrets.UPLOAD_URL }}${{ matrix.dist }}/' - curl 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache' -H 'Authorization: Bearer ${{ secrets.CF_TOKEN }}' -H 'Content-Type: application/json' \ - --data '{"files":["https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/","https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/shairport-sync_${{ matrix.arch }}.deb","https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/shairport-sync-airplay2_${{ matrix.arch }}.deb"]}' diff --git a/.github/workflows/squeezelite.yml b/.github/workflows/squeezelite.yml deleted file mode 100644 index e795784733..0000000000 --- a/.github/workflows/squeezelite.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: squeezelite -on: - workflow_dispatch: - inputs: - arch: - description: 'Target architecture' - type: choice - options: [armv6l, armv7l, aarch64, x86_64, riscv64, all] - default: all - required: true - dist: - description: 'Target Debian version' - type: choice - options: [buster, bullseye, bookworm, trixie, all] - default: all - required: true -concurrency: - group: ${{ github.workflow }}-${{ github.event.inputs.arch }}-${{ github.event.inputs.dist }} - cancel-in-progress: true -permissions: {} -defaults: - run: - shell: sh - working-directory: /dev/shm -jobs: - prep: - outputs: - arch: ${{ steps.arch.outputs.arch }} - dist: ${{ steps.dist.outputs.dist }} - # https://github.com/actions/runner-images - runs-on: ubuntu-22.04 - steps: - - id: arch - run: | - if [ '${{ github.event.inputs.arch }}' = 'all' ] - then - echo 'arch=["armv6l", "armv7l", "aarch64", "x86_64", "riscv64"]' >> "$GITHUB_OUTPUT" - else - echo 'arch=["${{ github.event.inputs.arch }}"]' >> "$GITHUB_OUTPUT" - fi - - id: dist - run: | - if [ '${{ github.event.inputs.dist }}' = 'all' ] - then - echo 'dist=["buster", "bullseye", "bookworm", "trixie"]' >> "$GITHUB_OUTPUT" - else - echo 'dist=["${{ github.event.inputs.dist }}"]' >> "$GITHUB_OUTPUT" - fi - build: - needs: prep - strategy: - matrix: - arch: ${{ fromJson(needs.prep.outputs.arch) }} - dist: ${{ fromJson(needs.prep.outputs.dist) }} - exclude: - - { arch: riscv64, dist: buster } - - { arch: riscv64, dist: bullseye } - - { arch: riscv64, dist: bookworm } - fail-fast: false - name: "Build: ${{ matrix.arch }} - ${{ matrix.dist }}" - runs-on: ubuntu-22.04 - steps: - - name: Build - run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=$GITHUB_REF_NAME; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/$GITHUB_REF_NAME/.build/software/squeezelite/container_build.bash")" -- -a '${{ matrix.arch }}' -d '${{ matrix.dist }}' - - name: Upload - run: | - # SSH server and client keys - mkdir ~/.ssh - umask 377 - echo '${{ secrets.KNOWN_HOSTS }}' > ~/.ssh/known_hosts - echo '${{ secrets.SSH_KEY }}' > ~/.ssh/id_ed25519 - - # Upload - curl -T 'rootfs/squeezelite_${{ matrix.arch }}.deb' --key ~/.ssh/id_ed25519 '${{ secrets.UPLOAD_URL }}${{ matrix.dist }}/' - curl 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache' -H 'Authorization: Bearer ${{ secrets.CF_TOKEN }}' -H 'Content-Type: application/json' \ - --data '{"files":["https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/","https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/squeezelite_${{ matrix.arch }}.deb"]}' diff --git a/.github/workflows/vaultwarden.yml b/.github/workflows/vaultwarden.yml deleted file mode 100644 index eddb693d35..0000000000 --- a/.github/workflows/vaultwarden.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: vaultwarden -on: - workflow_dispatch: - inputs: - arch: - description: 'Target architecture' - type: choice - options: [armv6l, armv7l, aarch64, x86_64, riscv64, all] - default: all - required: true - dist: - description: 'Target Debian version' - type: choice - options: [buster, bullseye, bookworm, trixie, all] - default: all - required: true -concurrency: - group: ${{ github.workflow }}-${{ github.event.inputs.arch }}-${{ github.event.inputs.dist }} - cancel-in-progress: true -permissions: {} -defaults: - run: - shell: sh - working-directory: /dev/shm -jobs: - prep: - outputs: - arch: ${{ steps.arch.outputs.arch }} - dist: ${{ steps.dist.outputs.dist }} - # https://github.com/actions/runner-images - runs-on: ubuntu-22.04 - steps: - - id: arch - run: | - if [ '${{ github.event.inputs.arch }}' = 'all' ] - then - echo 'arch=["armv6l", "armv7l", "aarch64", "x86_64"]' >> "$GITHUB_OUTPUT" - else - echo 'arch=["${{ github.event.inputs.arch }}"]' >> "$GITHUB_OUTPUT" - fi - - id: dist - run: | - if [ '${{ github.event.inputs.dist }}' = 'all' ] - then - echo 'dist=["buster", "bullseye", "bookworm", "trixie"]' >> "$GITHUB_OUTPUT" - else - echo 'dist=["${{ github.event.inputs.dist }}"]' >> "$GITHUB_OUTPUT" - fi - build: - needs: prep - strategy: - matrix: - arch: ${{ fromJson(needs.prep.outputs.arch) }} - dist: ${{ fromJson(needs.prep.outputs.dist) }} - exclude: - - { arch: riscv64, dist: buster } - - { arch: riscv64, dist: bullseye } - - { arch: riscv64, dist: bookworm } - fail-fast: false - name: "Build: ${{ matrix.arch }} - ${{ matrix.dist }}" - runs-on: ubuntu-22.04 - steps: - - name: Build - run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=$GITHUB_REF_NAME; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/$GITHUB_REF_NAME/.build/software/vaultwarden/container_build.bash")" -- -a '${{ matrix.arch }}' -d '${{ matrix.dist }}' - - name: Upload - run: | - # SSH server and client keys - mkdir ~/.ssh - umask 377 - echo '${{ secrets.KNOWN_HOSTS }}' > ~/.ssh/known_hosts - echo '${{ secrets.SSH_KEY }}' > ~/.ssh/id_ed25519 - - # Upload - curl -T 'rootfs/vaultwarden_${{ matrix.arch }}.deb' --key ~/.ssh/id_ed25519 '${{ secrets.UPLOAD_URL }}${{ matrix.dist }}/' - curl 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache' -H 'Authorization: Bearer ${{ secrets.CF_TOKEN }}' -H 'Content-Type: application/json' \ - --data '{"files":["https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/","https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/vaultwarden_${{ matrix.arch }}.deb"]}' diff --git a/.meta/dietpi-bookworm-upgrade b/.meta/dietpi-bookworm-upgrade index 92e2343d66..03782b09e0 100755 --- a/.meta/dietpi-bookworm-upgrade +++ b/.meta/dietpi-bookworm-upgrade @@ -58,13 +58,11 @@ G_DIETPI-NOTIFY 2 'Migrating package lists to Bookworm suite' G_EXEC sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list (( $G_RASPBIAN )) || G_EXEC sed -i 's/ non-free$/ non-free non-free-firmware/' /etc/apt/sources.list [[ $(find /etc/apt/sources.list.d/*.list 2> /dev/null) ]] && G_EXEC sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list.d/*.list -[[ -f '/etc/apt/sources.list.d/dietpi-mympd.list' ]] && G_EXEC sed -i 's/Debian_11/Debian_Testing/' /etc/apt/sources.list.d/dietpi-mympd.list +[[ -f '/etc/apt/sources.list.d/dietpi-mympd.list' ]] && G_EXEC sed -i 's/Debian_11/Debian_12/' /etc/apt/sources.list.d/dietpi-mympd.list G_DIETPI-NOTIFY 2 'Reverting some package lists to Bullseye which have no Bookworm suite (yet)' -[[ -f '/etc/apt/sources.list.d/raspi.list' ]] && G_EXEC sed -i 's/bookworm/bullseye/' /etc/apt/sources.list.d/raspi.list [[ -f '/etc/apt/sources.list.d/radxa.list' ]] && G_EXEC sed -i 's/bookworm/bullseye/g' /etc/apt/sources.list.d/radxa.list [[ -f '/etc/apt/sources.list.d/dietpi-radxa.list' ]] && G_EXEC sed -i 's/bookworm/bullseye/g' /etc/apt/sources.list.d/dietpi-radxa.list -[[ -f '/etc/apt/sources.list.d/dietpi-mosquitto.list' ]] && G_EXEC sed -i 's/bookworm/bullseye/' /etc/apt/sources.list.d/dietpi-mosquitto.list [[ -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 diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index fcd4d9c8d7..04ebb14276 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -697,13 +697,15 @@ shopt -s extglob aSOFTWARE_NAME8_22[212]='Kavita' aSOFTWARE_NAME8_23=() + aSOFTWARE_NAME8_24=() for i in "${!aSOFTWARE_NAME8_22[@]}" do aSOFTWARE_NAME8_23[i]=${aSOFTWARE_NAME8_22[i]} + aSOFTWARE_NAME8_24[i]=${aSOFTWARE_NAME8_23[i]} done # Pre-create software counter array so that we can see also software (available in newest version) with 0 installs - for i in "${aSOFTWARE_NAME8_23[@]}" + for i in "${aSOFTWARE_NAME8_24[@]}" do aSOFTWARE[$i]=0 done diff --git a/.update/patches b/.update/patches index ea45c2dfc1..1ecef4ad74 100755 --- a/.update/patches +++ b/.update/patches @@ -114,7 +114,7 @@ Patch_7_2() [[ -L '/usr/bin/raspimjpeg' ]] && G_EXEC rm /usr/bin/raspimjpeg fi - # Bitwarden_RS: Rename into vaultwarden: https://github.com/MichaIng/DietPi/issues/4325 + # Bitwarden_RS: Rename to vaultwarden: https://github.com/MichaIng/DietPi/issues/4325 if [[ -d '/mnt/dietpi_userdata/bitwarden_rs' ]] then G_DIETPI-NOTIFY 2 'Migrating Bitwarden_RS which was renamed to "vaultwarden" ...' @@ -893,16 +893,6 @@ _EOF_ G_EXEC sed -i 's/coherent_pool=2M/coherent_pool=2M usbcore.autosuspend=-1/' /boot/boot.cmd G_EXEC mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr fi - - # Inform about available software updates - if [[ -f '/boot/dietpi/.installed' ]] - then - # Shairport Sync - grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[37\]=2' /boot/dietpi/.installed && G_WHIP_MSG '[ INFO ] Shairport Sync update available -\nAn update to Shairport Sync v4.1.1 is available with support for "pipe" and "stdout" audio backends added. Apply it via reinstall: -# dietpi-software reinstall 37 -\nRelease notes: https://github.com/mikebrady/shairport-sync/releases/tag/4.1.1' - fi } Patch_8_13(){ :; } @@ -1365,13 +1355,6 @@ Patch_8_20() G_DIETPI-NOTIFY 2 'Preparing DietPi-Dashboard update to fix CVE-2023-38505 DoS vulnerability ...' G_EXEC eval 'echo 200 >> /var/tmp/dietpi/dietpi-update_reinstalls' fi - - # vaultwarden: Enforce reinstall to fix automount bug: https://dietpi.com/forum/t/automount-option-in-fstab-prevents-automatically-mounting-a-partition-in-due-time-on-bookworm/17463/22 - 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.29.1-dietpi1 - then - G_DIETPI-NOTIFY 2 'Preparing vaultwarden update ...' - G_EXEC eval 'echo 183 >> /var/tmp/dietpi/dietpi-update_reinstalls' - fi fi # Odroid N2: Assure that hardware random generator driver is loaded as early as possible to prevent rngd failures: https://github.com/MichaIng/DietPi/issues/6483 @@ -1522,6 +1505,58 @@ Patch_8_23() fi } +Patch_8_24() +{ + # 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 + then + G_DIETPI-NOTIFY 2 'Updating ROCK 3A kernel package ...' + local apackages=('linux-image-current-rockchip64' 'linux-dtb-current-rockchip64') + dpkg-query -s 'linux-headers-edge-rk35xx' &> /dev/null && apackages+=('linux-headers-current-rockchip64') + G_AGI "${apackages[@]}" + G_EXEC apt-mark auto "${apackages[@]/current-rockchip64/edge-rk35xx}" + + # 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 + if [[ -f '/etc/modprobe.d/dietpi-disable_wifi.conf' ]] + then + G_EXEC rm /etc/modules-load.d/dietpi-enable_wifi.conf + else + G_EXEC eval 'echo '\''sprdwl_ng'\'' > /etc/modules-load.d/dietpi-enable_wifi.conf' + fi + [[ -f '/etc/modprobe.d/dietpi-disable_bluetooth.conf' ]] || G_EXEC eval 'echo '\''sprdbt_tty'\'' > /etc/modules-load.d/dietpi-enable_bluetooth.conf' + fi + + # Software updates and migrations + if [[ -f '/boot/dietpi/.installed' ]] + then + # Shairport Sync + if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[37\]=2' /boot/dietpi/.installed && dpkg --compare-versions "$(dpkg-query -Wf '${Version}' shairport-sync 2> /dev/null)" lt 4.3.2-dietpi2 + then + G_DIETPI-NOTIFY 2 'Updating Shairport Sync package ...' + G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/shairport-sync_$G_HW_ARCH_NAME.deb" + G_AGI ./package.deb + G_EXEC rm package.deb + 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.0-dietpi1 + then + # Pre-v8.7 cleanup + if [[ -f '/opt/vaultwarden/target/release/vaultwarden' ]] + then + G_EXEC rm -R /opt/vaultwarden + [[ -f '/etc/systemd/system/vaultwarden.service' ]] && G_EXEC rm /etc/systemd/system/vaultwarden.service + fi + G_DIETPI-NOTIFY 2 'Updating vaultwarden package ...' + G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb "https://dietpi.com/downloads/binaries/$G_DISTRO_NAME/vaultwarden_$G_HW_ARCH_NAME.deb" + G_AGI ./package.deb + G_EXEC rm package.deb + fi + fi +} + # v6.35 => v7 migration if (( $G_DIETPI_VERSION_CORE == 6 && $G_DIETPI_VERSION_SUB > 34 )) then diff --git a/.update/pre-patches b/.update/pre-patches index b5317d83c2..b6ce0176cf 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -334,5 +334,36 @@ then [[ -f '/etc/apt/trusted.gpg.d/dietpi-sonarr.gpg' ]] && G_EXEC chmod 0644 /etc/apt/trusted.gpg.d/dietpi-sonarr.gpg fi +# v8.24 +if (( $G_DIETPI_VERSION_CORE < 8 || ( $G_DIETPI_VERSION_CORE == 8 && $G_DIETPI_VERSION_SUB < 24 ) )) +then + if [[ $G_DISTRO -ge 7 && -f '/etc/apt/sources.list.d/dietpi-mosquitto.list' ]] + then + G_DIETPI-NOTIFY 2 'Migrating Mosquitto APT repository to Bookworm' + G_EXEC sed -i 's/bullseye/bookworm/' /etc/apt/sources.list.d/dietpi-mosquitto.list + fi + if [[ $G_DISTRO == 7 && -f '/etc/apt/sources.list.d/dietpi-mympd.list' ]] + then + G_DIETPI-NOTIFY 2 'Migrating myMPD APT repository from testing suite to Bookworm suite' + G_EXEC sed -i 's/Debian_Testing/Debian_12/' /etc/apt/sources.list.d/dietpi-mympd.list + fi + if [[ $G_DISTRO == 7 && -f '/etc/apt/sources.list.d/raspi.list' && -f '/etc/apt/preferences.d/dietpi-ffmpeg' ]] + then + G_DIETPI-NOTIFY 2 'Removing obsolete FFmpeg workaround from RPi Bookworm systems' + G_EXEC rm /etc/apt/preferences.d/dietpi-ffmpeg + fi + if [[ -f '/etc/apt/sources.list.d/dietpi-openhab.list' ]] + then + G_DIETPI-NOTIFY 2 'Migrating openHAB APT repository from testing suite to stable suite' + G_EXEC sed -i 's/ testing / stable /' /etc/apt/sources.list.d/dietpi-openhab.list + (( $G_DISTRO < 6 )) && G_EXEC eval 'echo -e '\''Package: openhab*\nPin: version 3.*\nPin-Priority: 501'\'' > /etc/apt/preferences.d/dietpi-openhab' + fi + if [[ $G_DISTRO -ge 7 && -f '/etc/apt/sources.list.d/raspi.list' ]] && dpkg-query -s 'kodi-repository-kodi' &> /dev/null + then + G_DIETPI-NOTIFY 2 'Purging conflicting kodi-repository-kodi package' + G_AGP kodi-repository-kodi + fi +fi + exit 0 } diff --git a/.update/version b/.update/version index e4894e7115..6ae6985c08 100644 --- a/.update/version +++ b/.update/version @@ -2,8 +2,8 @@ # shellcheck disable=SC2034 # Available DietPi version G_REMOTE_VERSION_CORE=8 -G_REMOTE_VERSION_SUB=23 -G_REMOTE_VERSION_RC=3 +G_REMOTE_VERSION_SUB=24 +G_REMOTE_VERSION_RC=0 # 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 33d3fa6e9a..17258ff016 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,25 @@ +v8.24 +(2023-11-18) + +New images: +- ROCK 5A | We added support for this RK3588 SBC from Radxa to DietPi and images to our download page. +- ASUS Tinker Board 2 | We added support for this RK3399 SBC from ASUS to DietPi and images to our download page. +- Orange Pi Zero 3 | We added support for this Allwinner H618 SBC to DietPi and images for testing: https://dietpi.com/downloads/images/testing/. Note that there is currently an issue with the Ethernet adapter being lost on reboots, requiring a power cycle to re-appear: https://github.com/MichaIng/DietPi/issues/6594 + +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 +- 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 + +Bug fixes: +- 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 + +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 + +----------------------------------------------------------------------------------------------------------- + v8.23 (2023-10-21) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index eb7c2097da..fa97e9d8c8 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -2506,7 +2506,7 @@ _EOF_ [[ $target == *'/'* && ! -d ${target%/*} ]] && G_EXEC mkdir -p "${target%/*}" G_EXEC mv "$file" "$target" else - return + return 0 fi [[ -f $file ]] && G_EXEC rm "$file" @@ -3078,31 +3078,30 @@ unix_socket_directories = '/run/postgresql'" > "$i/00dietpi.conf" if To_Install 188 # Go then # https://go.dev/doc/install#install - if (( $G_HW_ARCH == 11 )) - then - G_AGI golang-go - else - case $G_HW_ARCH in - 3) local arch='arm64';; - 10) local arch='amd64';; - *) local arch='armv6l';; - esac + case $G_HW_ARCH in + 3) local arch='arm64';; + 10) local arch='amd64';; + 11) local arch='riscv64';; + *) local arch='armv6l';; + esac + + # Get latest version + local file=$(curl -sSfL 'https://go.dev/dl/?mode=json' | grep -wo "go[0-9.]*\.linux-$arch\.tar\.gz" | head -1) + [[ $file ]] || { file="go1.21.3.linux-$arch.tar.gz"; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. \"$file\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } - # Get latest version - local file=$(curl -sSfL 'https://go.dev/dl/?mode=json' | grep -wo "go[0-9.]*\.linux-$arch\.tar\.gz" | head -1) - [[ $file ]] || { file="go1.20.1.linux-$arch.tar.gz"; G_DIETPI-NOTIFY 1 "Automatic latest ${aSOFTWARE_NAME[$software_id]} version detection failed. \"$file\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + # Reinstall: Remove previous instance + [[ -d '/usr/local/go' ]] && G_EXEC rm -R /usr/local/go - # Reinstall: Remove previous instance - [[ -d '/usr/local/go' ]] && G_EXEC rm -R /usr/local/go + Download_Install "https://dl.google.com/go/$file" /usr/local - Download_Install "https://dl.google.com/go/$file" /usr/local + # Add to PATH, but do not overwrite existing script since we did set GOPATH until v8.9 and do not want to cause a breaking change for existing installs + # shellcheck disable=SC2016 + [[ -f '/etc/bashrc.d/go.sh' ]] || G_EXEC eval 'echo '\''export PATH="$PATH:/usr/local/go/bin"'\'' > /etc/bashrc.d/go.sh' + # shellcheck disable=SC1091 + . /etc/bashrc.d/go.sh - # Add to PATH, but do not overwrite existing script since we did set GOPATH until v8.9 and do not want to cause a breaking change for existing installs - # shellcheck disable=SC2016 - [[ -f '/etc/bashrc.d/go.sh' ]] || G_EXEC eval 'echo '\''export PATH="$PATH:/usr/local/go/bin"'\'' > /etc/bashrc.d/go.sh' - # shellcheck disable=SC1091 - . /etc/bashrc.d/go.sh - fi + # RISC-V pre-v8.24 and general failsafe action: Purge Go APT Package + dpkg-query -s 'golang-go' &> /dev/null && G_AGP golang-go fi if To_Install 170 # UnRAR @@ -3483,7 +3482,7 @@ _EOF_ G_EXEC systemctl stop nfs-kernel-server G_EXEC mkdir -p /etc/exports.d - [[ -f '/etc/exports.d/dietpi.exports' ]] || G_EXEC 'echo '\''/mnt/dietpi_userdata *(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check)'\'' > /etc/exports.d/dietpi.exports' + [[ -f '/etc/exports.d/dietpi.exports' ]] || G_EXEC eval 'echo '\''/mnt/dietpi_userdata *(rw,async,no_root_squash,fsid=0,crossmnt,no_subtree_check)'\'' > /etc/exports.d/dietpi.exports' fi if To_Install 83 apache2 # Apache @@ -5171,7 +5170,7 @@ _EOF_ # - This needs to be done prior to APT install, since this would otherwise install a default config file as well. [[ -f '/etc/mopidy/mopidy.conf' ]] || dps_index=$software_id Download_Install 'mopidy.conf' /etc/mopidy/mopidy.conf - # Install official APT repo whre available + # Install official APT repo where available if (( $G_HW_ARCH != 11 )) then # APT key @@ -6448,7 +6447,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.7.9/kavita-linux-$arch.tar.gz" + local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.7.10.2/kavita-linux-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Kareadita/Kavita/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/kavita-linux-$arch\.tar\.gz\"$/{print \$4}")" G_EXEC chmod +x Kavita/Kavita @@ -6656,7 +6655,7 @@ _EOF_ esac # Download - local fallback_url="https://github.com/fatedier/frp/releases/download/v0.52.1/frp_0.52.1_linux_$arch.tar.gz" + local fallback_url="https://github.com/fatedier/frp/releases/download/v0.52.3/frp_0.52.3_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_* @@ -6834,7 +6833,7 @@ _EOF_ then # Use official APT repository where available: https://repo.mosquitto.org/debian/pool/main/m/mosquitto/ # - Current builds are not ARMv6 compatible: https://github.com/MichaIng/DietPi/issues/5140 - if (( $G_DISTRO < 7 )) && [[ $G_HW_ARCH == 2 || $G_HW_ARCH == 10 ]] + if (( $G_DISTRO < 8 )) && [[ $G_HW_ARCH == 2 || $G_HW_ARCH == 10 ]] then # APT key local url='https://repo.mosquitto.org/debian/mosquitto-repo.gpg.key' @@ -6964,7 +6963,8 @@ _EOF_ if To_Install 124 networkaudiod # NAA Daemon then # Base URL - local url="https://www.signalyst.eu/bins/naa/linux/${G_DISTRO_NAME/bookworm/bullseye}/" + local url="https://www.signalyst.eu/bins/naa/linux/${G_DISTRO_NAME/trixie/bookworm}/" + url=${url/bookworm/bullseye} case $G_HW_ARCH in 3) local arch='arm64';; @@ -7186,7 +7186,7 @@ _EOF_ aDEPS=() else local version=$(curl -sSfL 'https://api.github.com/repos/FreshRSS/FreshRSS/releases/latest' | mawk -F\" '/^ *"tag_name": "[^"]*",$/{print $4}') - [[ $version ]] || { version='1.21.0'; G_DIETPI-NOTIFY 1 "Automatic latest FreshRSS version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + [[ $version ]] || { version='1.22.1'; G_DIETPI-NOTIFY 1 "Automatic latest FreshRSS version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } Download_Install "https://github.com/FreshRSS/FreshRSS/archive/$version.tar.gz" G_EXEC mv "FreshRSS-$version" /opt/FreshRSS fi @@ -7576,7 +7576,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/v1.6.2/komga-1.6.2.jar' + local fallback_url='https://github.com/gotson/komga/releases/download/1.7.2/komga-1.7.2.jar' Download_Install "$(curl -sSfL 'https://api.github.com/repos/gotson/komga/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/komga-[^"\/]*\.jar"$/{print $4}')" /mnt/dietpi_userdata/komga/komga.jar fi @@ -7674,7 +7674,7 @@ _EOF_ # Bullseye+ if (( $G_DISTRO > 5 )) then - local fallback_url="https://github.com/ampache/ampache/releases/download/6.0.3/ampache-6.0.3_all_php$PHP_VERSION.zip" + local fallback_url="https://github.com/ampache/ampache/releases/download/6.1.0/ampache-6.1.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 # Ampache is installed to /mnt/dietpi_userdata/ampache and the "public" directory linked to /var/www/ampache: https://github.com/MichaIng/DietPi/pull/5205 local fp_install='/mnt/dietpi_userdata' fp_public='ampache/public' @@ -8494,8 +8494,8 @@ _EOF_ if To_Install 53 mineos # MineOS then - # https://minecraft.codeemo.com/mineoswiki/index.php?title=MineOS-node_(apt-get) - local url='https://github.com/hexparrot/mineos-node.git' + # https://wiki.codeemo.com/install/debian_10.html + local url='https://github.com/hexparrot/mineos-node' G_CHECK_URL "$url" # APT deps @@ -8509,15 +8509,9 @@ _EOF_ G_EXEC cd /mnt/dietpi_userdata/mineos if [[ -d 'minecraft' ]] then - # https://minecraft.codeemo.com/mineoswiki/index.php?title=Updating_the_Webui + # https://wiki.codeemo.com/maint/webui.html#updating-the-webui G_EXEC cd minecraft - if [[ -x 'update_webui.sh' ]] - then - G_EXEC_OUTPUT=1 G_EXEC ./update_webui.sh - else - G_EXEC_OUTPUT=1 G_EXEC git fetch - G_EXEC_OUTPUT=1 G_EXEC git merge origin/master - fi + G_EXEC_OUTPUT=1 G_EXEC git pull origin master else G_EXEC_OUTPUT=1 G_EXEC git clone "$url" minecraft G_EXEC cd minecraft @@ -8532,19 +8526,17 @@ _EOF_ # Install MineOS G_EXEC_OUTPUT=1 G_EXEC npm i --no-audit - G_EXEC cd "$G_WORKING_DIR" # Config: Preserve existing - [[ -f '/etc/mineos.conf' ]] || G_EXEC cp /mnt/dietpi_userdata/mineos/minecraft/mineos.conf /etc/mineos.conf + [[ -f '/etc/mineos.conf' ]] || G_EXEC cp mineos.conf /etc/mineos.conf # Create symlinks for console and userdata dir G_EXEC ln -sf /mnt/dietpi_userdata/mineos/minecraft/mineos_console.js /usr/local/bin/mineos + G_EXEC mkdir -p /var/games ../serverdata G_EXEC rm -Rf /var/games/minecraft - G_EXEC mkdir -p /var/games /mnt/dietpi_userdata/mineos/serverdata G_EXEC ln -s /mnt/dietpi_userdata/mineos/serverdata /var/games/minecraft # Setup SSL cert - G_EXEC cd /mnt/dietpi_userdata/mineos/minecraft G_EXEC_OUTPUT=1 G_EXEC ./generate-sslcert.sh G_EXEC cd "$G_WORKING_DIR" @@ -8583,7 +8575,7 @@ _EOF_ 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}") + 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" @@ -8740,7 +8732,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.6'; G_DIETPI-NOTIFY 1 "Automatic latest ruTorrent version detection failed. Version \"$version\" will be installed as fallback, but a newer version might be available. Please report this at: https://github.com/MichaIng/DietPi/issues"; } + [[ $version ]] || { version='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"; } Download_Install "https://github.com/Novik/ruTorrent/archive/$version.tar.gz" # - Reinstall freshly with preserved configs and 3rd party plugins @@ -9131,7 +9123,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.25.0/syncthing-linux-$arch-v1.25.0.tar.gz" + local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.26.0/syncthing-linux-$arch-v1.26.0.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/syncthing/syncthing/releases/latest' | mawk -F\" "/\"browser_download_url\": .*\/syncthing-linux-$arch-[^\"\/]*\.tar\.gz\"/{print \$4}")" G_EXEC mv syncthing-* /opt/syncthing fi @@ -9644,9 +9636,7 @@ _EOF_ then # https://sonarr.tv/#downloads-v3-linux-debian # APT key - local url='https://keyserver.ubuntu.com/pks/lookup?search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8&op=get' - G_CHECK_URL "$url" - G_EXEC eval "curl -sSf '$url' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-sonarr.gpg --yes" + G_EXEC eval 'curl -sSf '\''https://keyserver.ubuntu.com/pks/lookup?search=0x2009837CBFFD68F45BC180471F4F90DE2A9B4BF8&op=get'\'' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-sonarr.gpg --yes' # APT list: Buster is the latest available suite: https://apt.sonarr.tv/debian/dists/ G_EXEC eval 'echo '\''deb https://apt.sonarr.tv/debian/ buster main'\'' > /etc/apt/sources.list.d/sonarr.list' @@ -9741,27 +9731,17 @@ _EOF_ aDEPS=() else # ARMv6: Radarr v4 does not support Mono anymore - if (( $G_HW_ARCH == 1 )) - then - local url='https://github.com/Radarr/Radarr/releases/download/v3.2.2.5080/Radarr.master.3.2.2.5080.linux.tar.gz' - - # ARMv7 - else - local url=$(curl -sSfL 'https://api.github.com/repos/Radarr/Radarr/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*linux-core-arm\.tar\.gz"$/{print $4}') - local fallback_url='https://github.com/Radarr/Radarr/releases/download/v5.0.3.8127/Radarr.master.5.0.3.8127.linux-core-arm.tar.gz' - fi - - # ARMv8 - if (( $G_HW_ARCH == 3 )) + local url='https://github.com/Radarr/Radarr/releases/download/v3.2.2.5080/Radarr.master.3.2.2.5080.linux.tar.gz' + if (( $G_HW_ARCH != 1 )) then - url=${url/arm/arm64} - fallback_url=${fallback_url/arm/arm64} + case $G_HW_ARCH in + 2) local arch='arm';; + 3) local arch='arm64';; + *) local arch='x64';; + esac - # x86_64 - elif (( $G_HW_ARCH == 10 )) - then - url=${url/arm/x64} - fallback_url=${fallback_url/arm/x64} + url=$(curl -sSfL 'https://api.github.com/repos/Radarr/Radarr/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}") + local fallback_url="https://github.com/Radarr/Radarr/releases/download/v5.1.3.8246/Radarr.master.5.1.3.8246.linux-core-$arch.tar.gz" fi Download_Install "$url" @@ -9848,27 +9828,17 @@ _EOF_ aDEPS=() else # ARMv6: Lidarr v1 does not support Mono anymore - if (( $G_HW_ARCH == 1 )) - then - local url='https://github.com/Lidarr/Lidarr/releases/download/v0.8.1.2135/Lidarr.master.0.8.1.2135.linux.tar.gz' - - # ARMv7 - else - local url=$(curl -sSfL 'https://api.github.com/repos/Lidarr/Lidarr/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*linux-core-arm\.tar\.gz"$/{print $4}') - local fallback_url='https://github.com/Lidarr/Lidarr/releases/download/v1.4.5.3639/Lidarr.master.1.4.5.3639.linux-core-arm.tar.gz' - fi - - # ARMv8 - if (( $G_HW_ARCH == 3 )) + local url='https://github.com/Lidarr/Lidarr/releases/download/v0.8.1.2135/Lidarr.master.0.8.1.2135.linux.tar.gz' + if (( $G_HW_ARCH != 1 )) then - url=${url/arm/arm64} - fallback_url=${fallback_url/arm/arm64} + case $G_HW_ARCH in + 2) local arch='arm';; + 3) local arch='arm64';; + *) local arch='x64';; + esac - # x86_64 - elif (( $G_HW_ARCH == 10 )) - then - url=${url/arm/x64} - fallback_url=${fallback_url/arm/x64} + url=$(curl -sSfL 'https://api.github.com/repos/Lidarr/Lidarr/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}") + local fallback_url="https://github.com/Lidarr/Lidarr/releases/download/v1.4.5.3639/Lidarr.master.1.4.5.3639.linux-core-$arch.tar.gz" fi Download_Install "$url" @@ -10074,7 +10044,7 @@ _EOF_ *) local arch='LinuxAMDx64';; esac - local fallback_url="https://github.com/Jackett/Jackett/releases/download/v0.20.2444/Jackett.Binaries.$arch.tar.gz" + local fallback_url="https://github.com/Jackett/Jackett/releases/download/v0.21.1138/Jackett.Binaries.$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Jackett/Jackett/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/Jackett\.Binaries\.$arch\.tar\.gz\"$/{print \$4}")" # Move existing configs to unpacked install dir @@ -10285,7 +10255,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.8.2267/Readarr.develop.0.3.8.2267.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.10.2287/Readarr.develop.0.3.10.2287.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 @@ -11320,7 +11290,7 @@ _EOF_ # v3 drops PHP 7.4 support: https://github.com/TasmoAdmin/TasmoAdmin/releases/tag/v3.0.0 if (( $G_DISTRO > 6 )) then - local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v3.1.1/tasmoadmin_v3.1.1.tar.gz' + local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v3.2.0/tasmoadmin_v3.2.0.tar.gz' Download_Install "$(curl -sSfL 'https://api.github.com/repos/TasmoAdmin/TasmoAdmin/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*\/tasmoadmin_v[^"\/]*\.tar\.gz"$/{print $4}')" # v2 drops PHP <7.4 support: https://github.com/TasmoAdmin/TasmoAdmin/releases/tag/v2.0.0 @@ -11389,13 +11359,15 @@ _EOF_ # APT list # - Enable RISC-V support by explicitly defining arch=all, which contains exactly the same packages (well, it's Java...) - # - Use testing suite == openHAB 4 from Bullseye on since openHAB 3 does not fully support Java 17: https://github.com/MichaIng/DietPi/pull/6334#issuecomment-1528729163 - local arch='' suite='testing' + local arch= (( $G_HW_ARCH == 11 )) && arch=' [arch=all]' - (( $G_DISTRO < 6 )) && suite='stable' - G_EXEC eval "echo 'deb$arch https://openhab.jfrog.io/artifactory/openhab-linuxpkg $suite main' > /etc/apt/sources.list.d/dietpi-openhab.list" + G_EXEC eval "echo 'deb$arch https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable main' > /etc/apt/sources.list.d/dietpi-openhab.list" G_AGUP + # Buster: Limit to v3, as v4 requires Java 17 + (( $G_DISTRO < 6 )) && G_EXEC eval 'echo -e '\''Package: openhab*\nPin: version 3.*\nPin-Priority: 501'\'' > /etc/apt/preferences.d/dietpi-openhab' + [[ $G_DISTRO -ge 6 && -f '/etc/apt/preferences.d/dietpi-openhab' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-openhab + # APT package G_AGI openhab G_EXEC systemctl stop openhab @@ -11900,7 +11872,7 @@ _EOF_ *) local arch='amd64';; esac - local fallback_url="https://github.com/filebrowser/filebrowser/releases/download/v2.25.0/linux-$arch-filebrowser.tar.gz" + local fallback_url="https://github.com/filebrowser/filebrowser/releases/download/v2.26.0/linux-$arch-filebrowser.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/filebrowser/filebrowser/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/linux-$arch-filebrowser\.tar\.gz\"$/{print \$4}")" ./filebrowser/ # Reinstall @@ -12608,6 +12580,7 @@ If no WireGuard (auto)start is included, but you require it, please do the follo G_AGP openhab [[ -f '/etc/apt/sources.list.d/dietpi-openhab.list' ]] && G_EXEC rm /etc/apt/sources.list.d/dietpi-openhab.list [[ -f '/etc/apt/trusted.gpg.d/dietpi-openhab.gpg' ]] && G_EXEC rm /etc/apt/trusted.gpg.d/dietpi-openhab.gpg + [[ -f '/etc/apt/preferences.d/dietpi-openhab' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-openhab fi if To_Uninstall 83 # Apache @@ -13648,7 +13621,7 @@ _EOF_ if To_Uninstall 53 # MineOS then - Remove_Service mineos 1 1 # user and group for pre-v6.34 + Remove_Service mineos 1 1 # User and group for pre-v6.34 [[ -d '/mnt/dietpi_userdata/mineos' ]] && G_EXEC rm -R /mnt/dietpi_userdata/mineos [[ -f '/etc/mineos.conf' ]] && G_EXEC rm /etc/mineos.conf G_EXEC rm -Rf /var/games/minecraft /usr/local/bin/mineos # Symlinks @@ -14543,7 +14516,7 @@ _EOF_ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Applying initial first run setup steps' # Get settings - AUTOINSTALL_ENABLED=$(sed -n '/^[[:blank:]]*AUTO_SETUP_AUTOMATED=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + AUTOINSTALL_ENABLED=$(grep -cm1 '^[[:blank:]]*AUTO_SETUP_AUTOMATED=1' /boot/dietpi.txt) AUTOINSTALL_AUTOSTARTTARGET=$(sed -n '/^[[:blank:]]*AUTO_SETUP_AUTOSTART_TARGET_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) local AUTOINSTALL_SSHINDEX=$(sed -n '/^[[:blank:]]*AUTO_SETUP_SSH_SERVER_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) local AUTOINSTALL_FILESERVERINDEX=$(sed -n '/^[[:blank:]]*AUTO_SETUP_FILE_SERVER_INDEX=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) # pre-v7.9 @@ -14552,10 +14525,9 @@ _EOF_ local AUTOINSTALL_TIMESYNCMODE=$(sed -n '/^[[:blank:]]*CONFIG_NTP_MODE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) local AUTOINSTALL_RESTORE=$(sed -n '/^[[:blank:]]*AUTO_SETUP_BACKUP_RESTORE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) local AUTOINSTALL_RAMLOG_SIZE=$(sed -n '/^[[:blank:]]*AUTO_SETUP_RAMLOG_MAXSIZE=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) - AUTO_SETUP_DHCP_TO_STATIC=$(sed -n '/^[[:blank:]]*AUTO_SETUP_DHCP_TO_STATIC=/{s/^[^=]*=//p;q}' /boot/dietpi.txt) + AUTO_SETUP_DHCP_TO_STATIC=$(grep -cm1 '^[[:blank:]]*AUTO_SETUP_DHCP_TO_STATIC=1' /boot/dietpi.txt) # Else set defaults - [[ $AUTOINSTALL_ENABLED ]] || AUTOINSTALL_ENABLED=0 [[ $AUTOINSTALL_AUTOSTARTTARGET ]] || AUTOINSTALL_AUTOSTARTTARGET=0 [[ $AUTOINSTALL_SSHINDEX ]] || AUTOINSTALL_SSHINDEX=-1 [[ $AUTOINSTALL_FILESERVERINDEX ]] || AUTOINSTALL_FILESERVERINDEX=0 # pre-v7.9 @@ -14564,7 +14536,6 @@ _EOF_ [[ $AUTOINSTALL_TIMESYNCMODE ]] || AUTOINSTALL_TIMESYNCMODE=2 [[ $AUTOINSTALL_RESTORE ]] || AUTOINSTALL_RESTORE=0 [[ $AUTOINSTALL_RAMLOG_SIZE ]] || AUTOINSTALL_RAMLOG_SIZE=50 - [[ $AUTO_SETUP_DHCP_TO_STATIC == 1 ]] || AUTO_SETUP_DHCP_TO_STATIC=0 # Restore DietPi-Backup if (( $AUTOINSTALL_RESTORE )); then @@ -14733,7 +14704,7 @@ _EOF_ G_DIETPI-NOTIFY 0 'Applied initial first run setup steps' # Automated installs - (( $AUTOINSTALL_ENABLED > 0 )) || return 0 + (( $AUTOINSTALL_ENABLED )) || return 0 G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" 'Running automated install' diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index d4aa436f61..8f448e6aaf 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -54,8 +54,8 @@ [[ -f '/boot/dietpi/.version' ]] && . /boot/dietpi/.version # - Assign defaults/code version as fallback [[ $G_DIETPI_VERSION_CORE ]] || G_DIETPI_VERSION_CORE=8 - [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=23 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=3 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=24 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=0 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch diff --git a/dietpi/func/dietpi-set_hardware b/dietpi/func/dietpi-set_hardware index 42726a1b37..c411b60d4e 100755 --- a/dietpi/func/dietpi-set_hardware +++ b/dietpi/func/dietpi-set_hardware @@ -1165,8 +1165,8 @@ _EOF_ 'btbcm' # RPi3 Broadcom onboard 'rfcomm' # BPi Pro/M2+ and others 'hidp' # BPi Pro/M2+ and others + 'sprdbt_tty' # Orange Pi Zero 3 'hci_uart' - ) if [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then @@ -1193,11 +1193,15 @@ _EOF_ systemctl -q is-enabled bluetooth 2> /dev/null || systemctl -q is-active bluetooth && G_EXEC systemctl disable --now bluetooth + # Remove explicit Bluetooth module loads + [[ -f '/etc/modules-load.d/dietpi-enable_bluetooth.conf' ]] && G_EXEC rm /etc/modules-load.d/dietpi-enable_bluetooth.conf + # Unload and blacklist kernel modules, bluetooth last + [[ -d '/etc/modprobe.d' ]] || G_EXEC mkdir /etc/modprobe.d > /etc/modprobe.d/dietpi-disable_bluetooth.conf for ((i=$(( ${#aBLUETOOTH_MODULES[@]} - 1 )); i>=0; i--)) do - modprobe -r "${aBLUETOOTH_MODULES[$i]}" 2> /dev/null + modprobe -rf "${aBLUETOOTH_MODULES[$i]}" 2> /dev/null echo "blacklist ${aBLUETOOTH_MODULES[$i]}" >> /etc/modprobe.d/dietpi-disable_bluetooth.conf done @@ -1235,7 +1239,7 @@ Do you want to continue and disable the serial login console?' || return 1 # bluez-firmware: BCM203x dongles: https://packages.debian.org/bluez-firmware # - Conflicts with armbian-firmware: https://dietpi.com/forum/t/upgrading-dietpi-from-bullseye-to-bookworm/15963/16 - dpkg-query -s armbian-firmware &> /dev/null || firmware+=('bluez-firmware') + dpkg-query -s armbian-firmware &> /dev/null || dpkg-query -s orangepi-firmware &> /dev/null || firmware+=('bluez-firmware') G_AG_CHECK_INSTALL_PREREQ bluez "${firmware[@]}" fi @@ -1255,7 +1259,15 @@ Do you want to continue and disable the serial login console?' || return 1 G_EXEC systemctl enable --now bluetooth # RPi - (( $G_HW_MODEL > 9 )) || (( ! $G_HW_ONBOARD_WIFI )) || G_EXEC systemctl enable hciuart + if (( $G_HW_MODEL > 9 )) + then + (( $G_HW_ONBOARD_WIFI )) && G_EXEC systemctl enable hciuart + + # Orange Pi Zero 3 + elif (( $G_HW_MODEL == 83 )) + then + G_EXEC eval 'echo '\''sprdbt_tty'\'' > /etc/modules-load.d/dietpi-enable_bluetooth.conf' + fi else @@ -1328,25 +1340,29 @@ Do you want to continue and disable the serial login console?' || return 1 local aWIFI_MODULES=('cfg80211') # + RPi with onboard WiFi and NanoPi NEO Air - if (( ${G_HW_ONBOARD_WIFI:-0} || $G_HW_MODEL == 64 )); then - + if (( ${G_HW_ONBOARD_WIFI:-0} || $G_HW_MODEL == 64 )) + then aWIFI_MODULES+=('brcmfmac' 'brcmutil') # + NanoPi K1 Plus - elif (( $G_HW_MODEL == 67 )); then - + elif (( $G_HW_MODEL == 67 )) + then aWIFI_MODULES+=('8189es') # + PINE A64 / Pinebook / ASUS Tinker Board (onboard) - elif (( $G_HW_MODEL == 40 || $G_HW_MODEL == 44 || $G_HW_MODEL == 52 )); then - + elif (( $G_HW_MODEL == 40 || $G_HW_MODEL == 44 || $G_HW_MODEL == 52 )) + then aWIFI_MODULES+=('8723bs') # + NanoPi M3/T3/Fire3 - elif (( $G_HW_MODEL == 62 )); then - + elif (( $G_HW_MODEL == 62 )) + then aWIFI_MODULES+=('bcmdhd') + # + Orange Pi Zero 3 + elif (( $G_HW_MODEL == 83 )) + then + aWIFI_MODULES+=('sprdwl_ng') fi if [[ $INPUT_DEVICE_VALUE == 'disable' ]]; then @@ -1354,8 +1370,11 @@ Do you want to continue and disable the serial login console?' || return 1 # Disable onboard WiFi as well (( $G_HW_ONBOARD_WIFI )) && INPUT_DEVICE_VALUE='onboard_disable' Wifi_Modules_Main + # Remove explicit WiFi module loads + [[ -f '/etc/modules-load.d/dietpi-enable_wifi.conf' ]] && G_EXEC rm /etc/modules-load.d/dietpi-enable_wifi.conf + # Remove powersaving setting - [[ -f '/etc/modprobe.d/dietpi-disable_wifi_powersaving.conf' ]] && rm /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf + [[ -f '/etc/modprobe.d/dietpi-disable_wifi_powersaving.conf' ]] && G_EXEC rm /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf # Reset blacklists [[ -d '/etc/modprobe.d' ]] || G_EXEC mkdir /etc/modprobe.d @@ -1364,37 +1383,48 @@ Do you want to continue and disable the serial login console?' || return 1 # cfg80211 last for ((i=$(( ${#aWIFI_MODULES[@]} - 1 )); i>=0; i--)) do - echo "blacklist ${aWIFI_MODULES[$i]}" >> /etc/modprobe.d/dietpi-disable_wifi.conf - modprobe -rf "${aWIFI_MODULES[$i]}" 2> /dev/null + G_EXEC eval "echo 'blacklist ${aWIFI_MODULES[$i]}' >> /etc/modprobe.d/dietpi-disable_wifi.conf" + G_EXEC_NOFAIL=1 G_EXEC modprobe -rf "${aWIFI_MODULES[$i]}" done elif [[ $INPUT_DEVICE_VALUE == 'enable' ]]; then # Disable known powersaving options for specific chipsets [[ -d '/etc/modprobe.d' ]] || G_EXEC mkdir /etc/modprobe.d - cat << _EOF_ > /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf -# NanoPi K1 Plus -options 8189es rtw_power_mgnt=0 -# PINE A64 -options 8723bs rtw_power_mgnt=0 -# Sparky SBC -options wlan_8192eu rtw_power_mgnt=0 -# - https://github.com/sparky-sbc/sparky-test/tree/master/rtl8812au -options wlan_8812au rtw_power_mgnt=0 -_EOF_ + # - NanoPi K1 Plus + if (( $G_HW_MODEL == 67 )) + then + G_EXEC eval 'echo '\''options 8189es rtw_power_mgnt=0'\'' > /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf' + + # - PINE A64 / Pinebook / ASUS Tinker Board (onboard) + elif (( $G_HW_MODEL == 40 || $G_HW_MODEL == 44 || $G_HW_MODEL == 52 )) + then + G_EXEC eval 'echo '\''options 8723bs rtw_power_mgnt=0'\'' > /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf' + + # - Sparky SBC + elif (( $G_HW_MODEL == 70 )) + then + G_EXEC eval 'echo -e '\''options wlan_8192eu rtw_power_mgnt=0\noptions wlan_8812au rtw_power_mgnt=0'\'' > /etc/modprobe.d/dietpi-disable_wifi_powersaving.conf' + + # - Orange Pi Zero 3: Module does not load automatically + elif (( $G_HW_MODEL == 83 )) + then + G_EXEC eval 'echo '\''sprdwl_ng'\'' > /etc/modules-load.d/dietpi-enable_wifi.conf' + fi + # Remove blacklists - [[ -f '/etc/modprobe.d/dietpi-disable_wifi.conf' ]] && rm /etc/modprobe.d/dietpi-disable_wifi.conf + [[ -f '/etc/modprobe.d/dietpi-disable_wifi.conf' ]] && G_EXEC rm /etc/modprobe.d/dietpi-disable_wifi.conf G_DIETPI-NOTIFY 2 'Please wait, enabling WiFi modules...' # cfg80211 first for i in "${aWIFI_MODULES[@]}" do - modprobe "$i" 2> /dev/null + G_EXEC_NOFAIL=1 G_EXEC modprobe "$i" done # Delay to allow modules + WPA2-Enterprise being fully loaded and avoid device not found error - G_SLEEP 8 + G_SLEEP 5 # Failsafe, unblock all WiFi adapters: https://github.com/MichaIng/DietPi/issues/1627 command -v rfkill > /dev/null && rfkill unblock wifi