From 5cc326b1e26781ff84039300c34d9334c93c0530 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 2 Feb 2024 14:22:51 +0100 Subject: [PATCH 1/6] v9.1 - CI | DietPi-Software build: Do not run builds in tmpfs and do not enforce bourne shell. Both has no performance advantage on the GitHub Action runners, and the additional RAM usage causes issues with vaultwarden builds by times. Also try again RISC-V vaultwarden builds. --- .github/workflows/dietpi-software-build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/dietpi-software-build.yml b/.github/workflows/dietpi-software-build.yml index 2b253b404f..f8fcdb2c05 100644 --- a/.github/workflows/dietpi-software-build.yml +++ b/.github/workflows/dietpi-software-build.yml @@ -24,10 +24,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.inputs.name }}-${{ github.event.inputs.arch }}-${{ github.event.inputs.dist }} cancel-in-progress: true permissions: {} -defaults: - run: - shell: sh - working-directory: /dev/shm jobs: prep: outputs: @@ -71,7 +67,6 @@ jobs: exclude: - { arch: riscv64, dist: bullseye } - { arch: riscv64, dist: bookworm } - - { arch: riscv64, name: vaultwarden } - { arch: armv6l, dist: trixie } - { arch: armv7l, name: gogs } - { arch: aarch64, name: gogs } From 9e63b8abe983cfc9b569f27499051aa3586a123e Mon Sep 17 00:00:00 2001 From: MichaIng Date: Fri, 2 Feb 2024 19:14:05 +0100 Subject: [PATCH 2/6] v9.1 - DietPi-FS_partition_resize | The lsblk MOUNTPOINTS field is not available on Bullseye, but MOUNTPOINT instead. It shows a single mount point only, but this is okay for this information use case. --- rootfs/var/lib/dietpi/services/fs_partition_resize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh index 86df6c110a..b76f9fdb96 100755 --- a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh +++ b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh @@ -59,7 +59,7 @@ sfdisk --no-reread --no-tell-kernel --delete "$ROOT_DRIVE" "${SETUP_PART: -1}" else echo "[ INFO ] No DietPi setup partition found, last partition is: \"$LAST_PART\"" - lsblk -po NAME,LABEL,SIZE,TYPE,FSTYPE,MOUNTPOINTS "$ROOT_DRIVE" + lsblk -po NAME,LABEL,SIZE,TYPE,FSTYPE,MOUNTPOINT "$ROOT_DRIVE" fi # Only increase partition size if not yet done on first boot From 5fa8bab7f20982516316a33cc89d736a49faad50 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sat, 3 Feb 2024 18:10:27 +0100 Subject: [PATCH 3/6] v9.1 - DietPi-Installer | Fix filesystem resizing for images without setup partition on Bullseye, until v9.1 has been released --- .build/images/dietpi-installer | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index ad503a6ae5..4b4b1dae72 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -745,6 +745,9 @@ setenv rootuuid "true"' /boot/boot.cmd G_CONFIG_INJECT 'DEV_GITOWNER=' "DEV_GITOWNER=$G_GITOWNER" /boot/dietpi.txt G_VERSIONDB_SAVE + # Temporary fix for resizing on Bullseye until v9.1 has been released: https://github.com/MichaIng/DietPi/issues/6900 + (( $G_DISTRO < 7 )) && G_EXEC sed -i 's/MOUNTPOINTS/MOUNTPOINT/' /var/lib/dietpi/services/fs_partition_resize.sh + # Apply live patches G_DIETPI-NOTIFY 2 'Applying DietPi live patches to fix known bugs in this version' for i in "${!G_LIVE_PATCH[@]}" From 9c1f0af078f26412c8d06cd5f52782c59b4821ae Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 4 Feb 2024 17:08:27 +0100 Subject: [PATCH 4/6] v9.1 - DietPi-Software | Readarr: Update fallback URL --- dietpi/dietpi-software | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 3e63517419..8e89672c67 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -10053,7 +10053,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.17.2409/Readarr.develop.0.3.17.2409.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.18.2411/Readarr.develop.0.3.18.2411.linux-core-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Readarr/Readarr/releases' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}" | head -1)" G_EXEC mv Readarr /opt/readarr fi From 6a7a63ba62d82ce7e753c8434d1d82b97d106b32 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Sun, 4 Feb 2024 23:35:18 +0100 Subject: [PATCH 5/6] v9.1 (#6892) - DietPi-Build/Installer | Start adding support for building RPi images with new firmware packages - DietPi-Image/FS_partition_resize | Add support for DietPi config files and firstboot scripts on new RPi boot/firmware partition. Since the new RPi firmware packages require the boot FAT partition to be mounted at /boot/firmware, RPi firstboot automation does not work anymore. It is hence now handled similar to the trailing setup FAT partition used on other SBCs: With a related flag, the DietPi-Imager copies related files from /boot (rootfs) to the boot FAT partition, expected to be partition 1. The DietPi-FS_partition_resize script mounts this partition and copies all files over to /boot, replacing the ones there, if older. --- .build/images/dietpi-build | 37 +++- .build/images/dietpi-imager | 19 +- .build/images/dietpi-installer | 166 ++++++++++++------ .../dietpi/services/fs_partition_resize.sh | 14 ++ 4 files changed, 179 insertions(+), 57 deletions(-) diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 26e0669188..ebd782a17a 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -47,6 +47,7 @@ EDITION= SUFFIX= ADD_DOS_PART=1 SIGN_PASS= +RPI_NEW=0 while (( $# )) do case $1 in @@ -63,6 +64,7 @@ do '-s') shift; SUFFIX=$1;; '--no-dos-part') ADD_DOS_PART=0;; '--sign') shift; SIGN_PASS=$1;; + '--rpi-new') RPI_NEW=1;; *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; esac shift @@ -77,6 +79,10 @@ boot_fstype='fat32' CLONING_TOOL='dd' case $HW_MODEL in 0) iname='RPi' HW_ARCH=${HW_ARCH:-1} boot_size=128 root_size=895;; + 1) iname='RPi1' HW_ARCH=1 boot_size=128 root_size=895;; + 2) iname='RPi2' HW_ARCH=2 boot_size=128 root_size=895;; + 4) iname='RPi234' HW_ARCH=3 boot_size=128 root_size=895;; + 5) iname='RPi5' HW_ARCH=3 boot_size=128 root_size=895;; 10) iname='OdroidC1' HW_ARCH=2 partition_start=4 boot_size=128 root_size=700 boot_fstype='fat16';; 11) iname='OdroidXU4' HW_ARCH=2 partition_start=4 root_size=764;; 12) iname='OdroidC2' HW_ARCH=3 partition_start=4 root_size=892;; @@ -179,6 +185,16 @@ case $PTTYPE in *) G_DIETPI-NOTIFY 1 "Invalid partition table type \"$PTTYPE\" passed, aborting..."; exit 1;; esac +if (( $RPI_NEW )) +then + (( $HW_MODEL < 10 && $DISTRO > 6 )) || { G_DIETPI-NOTIFY 1 "Invalid flag \"--rpi-new\" passed for hardware model \"$HW_MODEL\" or distro \"$DISTRO\" (${distro^}), aborting..."; exit 1; } + +elif (( $HW_MODEL && $HW_MODEL < 10 )) +then + G_DIETPI-NOTIFY 1 "Invalid hardware model \"$HW_MODEL\" passed without flag \"--rpi-new\", aborting..." + exit 1 +fi + # Do not add trailing FAT partitions for VM, container and (Clonezilla) installer images, and if there is a boot FAT partition already [[ $HW_MODEL == 20 || $HW_MODEL == 75 || $ITYPE == 'Installer' ]] && ADD_DOS_PART=0 [[ $boot_size -gt 0 && $boot_fstype == 'fat'* ]] && ADD_DOS_PART=0 @@ -367,12 +383,14 @@ then fi G_EXEC "mkfs.$FSTYPE" "${afs_opts[@]}" "${FP_LOOP}p2" G_EXEC mount "${FP_LOOP}p2" rootfs - G_EXEC mkdir rootfs/boot - G_EXEC mount "${FP_LOOP}p1" rootfs/boot + fp_boot='boot' + (( $RPI_NEW )) && fp_boot+='/firmware' + G_EXEC mkdir -p "rootfs/$fp_boot" + G_EXEC mount "${FP_LOOP}p1" "rootfs/$fp_boot" G_EXEC mkdir rootfs/etc cat << _EOF_ > rootfs/etc/fstab PARTUUID=$(lsblk -no PARTUUID "${FP_LOOP}p2") / $FSTYPE noatime,lazytime 0 1 -PARTUUID=$(lsblk -no PARTUUID "${FP_LOOP}p1") /boot $boot_fstype noatime,lazytime 0 2 +PARTUUID=$(lsblk -no PARTUUID "${FP_LOOP}p1") /$fp_boot $boot_fstype noatime,lazytime 0 2 _EOF_ # - single partition else @@ -470,6 +488,7 @@ G_EXEC losetup -d "$FP_LOOP" export FP_ROOT_DEV CLONING_TOOL OUTPUT_IMG_NAME MOUNT_IT='Off' SKIP_ARCHIVE SKIP_FIRSTBOOT_RESIZE=1 IMAGER_ARGS=("$OUTPUT_IMG_NAME.img") (( $ADD_DOS_PART )) && IMAGER_ARGS+=('--add-dos-part') +(( $RPI_NEW )) && IMAGER_ARGS+=('--configs-to-boot') [[ $SIGN_PASS ]] && IMAGER_ARGS+=('--sign' "$SIGN_PASS") if [[ ! $EDITION || $EDITION == 'all' ]] then @@ -501,7 +520,11 @@ then # Mount filesystems G_EXEC mkdir rootfs - if (( $boot_size )) + if (( $RPI_NEW )) + then + G_EXEC mount "${FP_LOOP}p2" rootfs + + elif (( $boot_size )) then G_EXEC mount "${FP_LOOP}p2" rootfs G_EXEC mount "${FP_LOOP}p1" rootfs/boot @@ -559,7 +582,11 @@ then # Mount filesystems G_EXEC mkdir rootfs - if (( $boot_size )) + if (( $RPI_NEW )) + then + G_EXEC mount "${FP_LOOP}p2" rootfs + + elif (( $boot_size )) then G_EXEC mount "${FP_LOOP}p2" rootfs G_EXEC mount "${FP_LOOP}p1" rootfs/boot diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index e69025bf47..47412ad2e1 100755 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -62,11 +62,13 @@ [[ $SHRINK_ONLY == 1 ]] || SHRINK_ONLY=0 [[ $SKIP_ARCHIVE == 1 ]] || SKIP_ARCHIVE=0 ADD_DOS_PART=0 + CONFIGS_TO_BOOT=0 SIGN_PASS= while (( $# )) do case $1 in '--add-dos-part') ADD_DOS_PART=1;; + '--configs-to-boot') CONFIGS_TO_BOOT=1;; '--sign') shift; SIGN_PASS=$1;; *) if [[ -b $1 ]] @@ -515,8 +517,23 @@ [[ $PART_TABLE_TYPE == 'gpt' ]] && ((IMAGE_SIZE+=34)) || ((IMAGE_SIZE++)) ((IMAGE_SIZE*=512)) # 512 byte sectors => bytes + # RPi: Move configs to boot FAT partition to allow easier edit from Windows/macOS + if (( $CONFIGS_TO_BOOT )) + then + local fat_mountpoint=$(mktemp -d) + local root_mountpoint=$(mktemp -d) + G_EXEC mount "${FP_ROOT_DEV::-1}1" "$fat_mountpoint" + G_EXEC mount "$FP_ROOT_DEV" "$root_mountpoint" + G_DIETPI-NOTIFY 2 'Copying dietpi.txt and other config files to the DIETPISETUP partition' + for f in 'dietpi.txt' 'dietpi-wifi.txt' 'dietpiEnv.txt' 'unattended_pivpn.conf' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' + do + [[ -f $root_mountpoint/boot/$f ]] && G_EXEC cp "$root_mountpoint/boot/$f" "$fat_mountpoint/" + done + G_EXEC umount "$root_mountpoint" "$fat_mountpoint" + G_EXEC rmdir "$root_mountpoint" "$fat_mountpoint" + # Add trailing FAT partition to simplify first run setup if requested - if (( $ADD_DOS_PART )) + elif (( $ADD_DOS_PART )) then G_DIETPI-NOTIFY 2 'Adding a 1 MiB FAT partition to simplify first run setup' ((IMAGE_SIZE+=1048576)) diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 4b4b1dae72..e1b067f719 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -322,14 +322,35 @@ _EOF_ G_WHIP_BUTTON_CANCEL_TEXT='Exit' G_WHIP_DEFAULT_ITEM=0 case $G_HW_ARCH in - 1) G_WHIP_MENU_ARRAY=('0' ': Raspberry Pi (all models)');; + 1) + if findmnt -M /boot/firmware &> /dev/null + then + G_WHIP_MENU_ARRAY=( + '0' ': Raspberry Pi (all models)' + '1' ': Raspberry Pi 1+Zero (1)' + '2' ': Raspberry Pi 2+3' + '4' ': Raspberry Pi 4+5' + ) + else + G_WHIP_MENU_ARRAY=('0' ': Raspberry Pi 1-4') + fi + ;; 2|3) userland_arch=$(dpkg --print-architecture) G_DIETPI-NOTIFY 2 "Detected target userland/OS architecture: $userland_arch" if [[ $userland_arch == 'armhf' ]] then - G_WHIP_MENU_ARRAY=( - '0' ': Raspberry Pi 2 - 4' + if findmnt -M /boot/firmware &> /dev/null + then + G_WHIP_MENU_ARRAY=( + '0' ': Raspberry Pi 2-5' + '2' ': Raspberry Pi 2+3' + '4' ': Raspberry Pi 4+5' + ) + else + G_WHIP_MENU_ARRAY=('0' ': Raspberry Pi 2-4') + fi + G_WHIP_MENU_ARRAY+=( '10' ': Odroid C1' '11' ': Odroid XU3/XU4/MC1/HC1/HC2' '13' ': Odroid U3' @@ -347,8 +368,17 @@ _EOF_ elif [[ $userland_arch == 'arm64' ]] then - G_WHIP_MENU_ARRAY=( - '0' ': Raspberry Pi 2 (v1.2) - 4' + if findmnt -M /boot/firmware &> /dev/null + then + G_WHIP_MENU_ARRAY=( + '0' ': Raspberry Pi 2-5 (page size: 4k and 16k)' + '4' ': Raspberry Pi 2-5 (page size: 4k only)' + '5' ': Raspberry Pi 5 (page size: 16k only)' + ) + else + G_WHIP_MENU_ARRAY=('0' ': Raspberry Pi 2-4') + fi + G_WHIP_MENU_ARRAY+=( '12' ': Odroid C2' '15' ': Odroid N2' '16' ': Odroid C4/HC4' @@ -558,10 +588,17 @@ _EOF_ local armbian_repo=0 if (( $G_HW_MODEL < 10 )) then + if findmnt -M /boot/firmware &> /dev/null + then + G_EXEC ln -sf firmware/cmdline.txt /boot/cmdline.txt + G_EXEC ln -sf firmware/config.txt /boot/config.txt + G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/RPi/config.txt" /boot/firmware/ + else + G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/RPi/config.txt" /boot/ + fi echo "root=PARTUUID=$(findmnt -Ufnro PARTUUID -M /) rootfstype=$(findmnt -Ufnro FSTYPE -M /) rootwait net.ifnames=0 logo.nologo console=serial0,115200 console=tty1" > /boot/cmdline.txt - G_EXEC mv "DietPi-$G_GITBRANCH/.build/images/RPi/config.txt" /boot/ # Boot in 64-bit mode if this is a 64-bit image - [[ $G_HW_ARCH == 3 ]] && G_CONFIG_INJECT 'arm_64bit=' 'arm_64bit=1' /boot/config.txt + [[ $userland_arch == 'arm64' ]] && G_CONFIG_INJECT 'arm_64bit=' 'arm_64bit=1' /boot/config.txt elif [[ $G_HW_MODEL =~ ^(10|11)$ ]] then @@ -1192,7 +1229,34 @@ _EOF_ (( $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[@]}" + if findmnt -M /boot/firmware &> /dev/null + then + local kernel=() + case $G_HW_MODEL in + 0) + [[ $userland_arch == 'arm64' ]] || G_EXEC dpkg --add-architecture arm64 + case $G_HW_ARCH in + 1) kernel=('linux-image-rpi-v6' 'linux-image-rpi-v7' 'linux-image-rpi-v8');; + *) + if [[ $userland_arch == 'armhf' ]] + then + kernel=('linux-image-rpi-v7' 'linux-image-rpi-v8') + else + kernel=('linux-image-rpi-v8' 'linux-image-rpi-2712') + fi + ;; + esac + ;; + 1) kernel=('linux-image-rpi-v6');; + 2) kernel=('linux-image-rpi-v7');; + 4) kernel=('linux-image-rpi-v8');; + 5) kernel=('linux-image-rpi-2712');; + *) { G_DIETPI-NOTIFY 1 "Unexpected hardware model passed: \"$G_HW_MODEL\". Aborting ..."; exit 1; };; + esac + G_AGI raspi-firmware "${kernel[@]}" raspi-utils ./raspberrypi-sys-mods.deb raspberrypi-archive-keyring "${a32bit[@]}" + else + G_AGI raspberrypi-bootloader raspberrypi-kernel libraspberrypi0 libraspberrypi-bin ./raspberrypi-sys-mods.deb raspberrypi-archive-keyring "${a32bit[@]}" + fi G_EXEC rm raspberrypi-sys-mods.deb # https://github.com/RPi-Distro/raspberrypi-sys-mods/pull/60 @@ -2008,49 +2072,49 @@ _EOF_' /boot/dietpi/func/dietpi-set_hardware rpi-camera disable /boot/dietpi/func/dietpi-set_hardware rpi-codec disable - # Update USBridgeSig Ethernet driver via postinst kernel script, until it has been merged into official RPi kernel: https://github.com/allocom/USBridgeSig/tree/master/ethernet - cat << '_EOF_' > /etc/kernel/postinst.d/dietpi-USBridgeSig -#!/bin/bash -# Only available for v7+ -[[ $1 == *'-v7+' ]] || exit 0 -# Only reasonable for USBridgeSig = CM 3+ -grep -q '^Revision.*10.$' /proc/cpuinfo || exit 0 -echo "[ INFO ] Updating ASIX AX88179 driver for kernel $1 with ARM-optimised build" -echo '[ INFO ] - by Allo: https://github.com/allocom/USBridgeSig/tree/master/ethernet' -echo '[ INFO ] Estimating required module layout...' -module_layout=$(modprobe --dump-modversions /lib/modules/$1/kernel/drivers/net/usb/asix.ko | mawk '/module_layout/{print $1;exit}') || exit 0 -echo '[ INFO ] Downloading stable branch driver...' -if ! curl -#fL "http://3.230.113.73:9011/Allocom/USBridgeSig/stable_rel/rpi-usbs-$1/ax88179_178a.ko" -o /tmp/ax88179_178a.ko || - [[ $module_layout != $(modprobe --dump-modversions /tmp/ax88179_178a.ko | mawk '/module_layout/{print $1;exit}') ]] -then - echo '[ INFO ] No matching stable branch driver found, trying master branch driver...' - if ! curl -#fL "http://3.230.113.73:9011/Allocom/USBridgeSig/rpi-usbs-$1/ax88179_178a.ko" -o /tmp/ax88179_178a.ko || - [[ $module_layout != $(modprobe --dump-modversions /tmp/ax88179_178a.ko | mawk '/module_layout/{print $1;exit}') ]] - then - echo '[ INFO ] No matching driver found, cleaning up and aborting...' - rm -fv /tmp/ax88179_178a.ko || : - echo '[ INFO ] The default RPi kernel driver will be used instead, which might result in pops and ticks in your audio stream. If so, please try to rerun this script later:' - echo " - /etc/kernel/postinst.d/dietpi-USBridgeSig $1" - exit 0 - fi -fi -echo '[ INFO ] Installing driver...' -install -vpm 644 /tmp/ax88179_178a.ko /lib/modules/$1/kernel/drivers/net/usb || exit 0 -echo '[ INFO ] Running depmod...' -depmod $1 || exit 0 -echo '[ INFO ] All succeeded, cleaning up...' -rm -v /tmp/ax88179_178a.ko || exit 0 -_EOF_ - G_EXEC chmod +x /etc/kernel/postinst.d/dietpi-USBridgeSig - # Force upgrade now, regardless of current host machine - G_EXEC sed --follow-symlinks -i 's/^grep/#grep/' /etc/kernel/postinst.d/dietpi-USBridgeSig - for i in /lib/modules/*-v7+ - do - [[ -d $i ]] || continue - i=${i##*/} - /etc/kernel/postinst.d/dietpi-USBridgeSig "$i" - done - G_EXEC sed --follow-symlinks -i 's/^#grep/grep/' /etc/kernel/postinst.d/dietpi-USBridgeSig + # # Update USBridgeSig Ethernet driver via postinst kernel script, until it has been merged into official RPi kernel: https://github.com/allocom/USBridgeSig/tree/master/ethernet + # cat << '_EOF_' > /etc/kernel/postinst.d/dietpi-USBridgeSig +# #!/bin/bash +# # Only available for v7+ +# [[ $1 == *'-v7+' ]] || exit 0 +# # Only reasonable for USBridgeSig = CM 3+ +# grep -q '^Revision.*10.$' /proc/cpuinfo || exit 0 +# echo "[ INFO ] Updating ASIX AX88179 driver for kernel $1 with ARM-optimised build" +# echo '[ INFO ] - by Allo: https://github.com/allocom/USBridgeSig/tree/master/ethernet' +# echo '[ INFO ] Estimating required module layout...' +# module_layout=$(modprobe --dump-modversions /lib/modules/$1/kernel/drivers/net/usb/asix.ko | mawk '/module_layout/{print $1;exit}') || exit 0 +# echo '[ INFO ] Downloading stable branch driver...' +# if ! curl -#fL "http://3.230.113.73:9011/Allocom/USBridgeSig/stable_rel/rpi-usbs-$1/ax88179_178a.ko" -o /tmp/ax88179_178a.ko || + # [[ $module_layout != $(modprobe --dump-modversions /tmp/ax88179_178a.ko | mawk '/module_layout/{print $1;exit}') ]] +# then + # echo '[ INFO ] No matching stable branch driver found, trying master branch driver...' + # if ! curl -#fL "http://3.230.113.73:9011/Allocom/USBridgeSig/rpi-usbs-$1/ax88179_178a.ko" -o /tmp/ax88179_178a.ko || + # [[ $module_layout != $(modprobe --dump-modversions /tmp/ax88179_178a.ko | mawk '/module_layout/{print $1;exit}') ]] + # then + # echo '[ INFO ] No matching driver found, cleaning up and aborting...' + # rm -fv /tmp/ax88179_178a.ko || : + # echo '[ INFO ] The default RPi kernel driver will be used instead, which might result in pops and ticks in your audio stream. If so, please try to rerun this script later:' + # echo " - /etc/kernel/postinst.d/dietpi-USBridgeSig $1" + # exit 0 + # fi +# fi +# echo '[ INFO ] Installing driver...' +# install -vpm 644 /tmp/ax88179_178a.ko /lib/modules/$1/kernel/drivers/net/usb || exit 0 +# echo '[ INFO ] Running depmod...' +# depmod $1 || exit 0 +# echo '[ INFO ] All succeeded, cleaning up...' +# rm -v /tmp/ax88179_178a.ko || exit 0 +# _EOF_ + # G_EXEC chmod +x /etc/kernel/postinst.d/dietpi-USBridgeSig + # # Force upgrade now, regardless of current host machine + # G_EXEC sed --follow-symlinks -i 's/^grep/#grep/' /etc/kernel/postinst.d/dietpi-USBridgeSig + # for i in /lib/modules/*-v7+ + # do + # [[ -d $i ]] || continue + # i=${i##*/} + # /etc/kernel/postinst.d/dietpi-USBridgeSig "$i" + # done + # G_EXEC sed --follow-symlinks -i 's/^#grep/grep/' /etc/kernel/postinst.d/dietpi-USBridgeSig # For backwards compatibility with software compiled against older libraspberrypi0, create symlinks from old to new filenames if (( $G_HW_ARCH < 3 )) diff --git a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh index b76f9fdb96..5640c5142e 100755 --- a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh +++ b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh @@ -57,6 +57,20 @@ rmdir -v "$TMP_MOUNT" # Finally delete the partition so the resizing works sfdisk --no-reread --no-tell-kernel --delete "$ROOT_DRIVE" "${SETUP_PART: -1}" + + elif grep -q '[[:blank:]]/boot/firmware[[:blank:]][[:blank:]]*vfat[[:blank:]]' /etc/fstab + then + BOOT_PART=$(mawk '/[[:blank:]]\/boot\/firmware[[:blank:]][[:blank:]]*vfat[[:blank:]]/{print $1}' /etc/fstab) + echo "[ INFO ] Detected RPi boot/firmware partition $BOOT_PART" + # Mount it and copy files if present and newer + TMP_MOUNT=$(mktemp -d) + mount -v "$BOOT_PART" "$TMP_MOUNT" + for f in 'dietpi.txt' 'dietpi-wifi.txt' 'dietpiEnv.txt' 'unattended_pivpn.conf' 'Automation_Custom_PreScript.sh' 'Automation_Custom_Script.sh' + do + [[ -f $TMP_MOUNT/$f ]] && cp -uv "$TMP_MOUNT/$f" /boot/ + done + umount -v "$BOOT_PART" + rmdir -v "$TMP_MOUNT" else echo "[ INFO ] No DietPi setup partition found, last partition is: \"$LAST_PART\"" lsblk -po NAME,LABEL,SIZE,TYPE,FSTYPE,MOUNTPOINT "$ROOT_DRIVE" From ce3fa9e2996b4dbb656d0858f56cde9b7e2c1241 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 5 Feb 2024 01:21:56 +0100 Subject: [PATCH 6/6] v9.1 - CI | vaultwarden: Remove obsolete workaround for RISC-V --- .build/software/vaultwarden/build.bash | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.build/software/vaultwarden/build.bash b/.build/software/vaultwarden/build.bash index dd09f2cc07..07e2828967 100755 --- a/.build/software/vaultwarden/build.bash +++ b/.build/software/vaultwarden/build.bash @@ -39,9 +39,6 @@ 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 @@ -66,9 +63,6 @@ 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"