diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index dd40cbc50f..406657d208 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -45,6 +45,7 @@ GITBRANCH='master' GITOWNER='MichaIng' EDITION= SUFFIX= +ADD_DOS_PART=1 while (( $# )) do case $1 in @@ -59,6 +60,7 @@ do '-o') shift; GITOWNER=$1;; '-e') shift; EDITION=$1;; '-s') shift; SUFFIX=$1;; + '--no-dos-part') ADD_DOS_PART=0;; *) G_DIETPI-NOTIFY 1 "Invalid input \"$1\", aborting..."; exit 1;; esac shift @@ -170,6 +172,10 @@ case $PTTYPE in *) G_DIETPI-NOTIFY 1 "Invalid partition table type \"$PTTYPE\" passed, aborting..."; exit 1;; esac +# 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 + fsname='' apackages=() afs_opts=() afsck=() aresize=() case $FSTYPE in 'ext4') apackages+=('e2fsprogs') afs_opts=('-e' 'remount-ro') afsck=('e2fsck' '-fyD') aresize=('resize2fs');; @@ -419,6 +425,7 @@ _EOF_ cat << _EOF_ >> rootfs/etc/rc.local export GITOWNER='$GITOWNER' GITBRANCH='$GITBRANCH' HW_MODEL='$HW_MODEL' IMAGE_CREATOR=0 PREIMAGE_INFO=0 WIFI_REQUIRED=1 DISTRO_TARGET=$DISTRO +echo '[ INFO ] Running DietPi-Installer for $G_GITOWNER/$G_GITBRANCH' bash -c "\$(curl -sSf 'https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-installer')" || poweroff _EOF_ @@ -464,13 +471,20 @@ G_EXEC losetup -d "$FP_LOOP" # Do not pack and upload raw VM image if not explicitly requested [[ $VMTYPE && ! $VMTYPE =~ ^(raw|all)$ ]] && SKIP_ARCHIVE=1 || SKIP_ARCHIVE=0 export FP_ROOT_DEV CLONING_TOOL OUTPUT_IMG_NAME MOUNT_IT='Off' SKIP_ARCHIVE SKIP_FIRSTBOOT_RESIZE=1 -[[ $EDITION && $EDITION != 'all' ]] || bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "$OUTPUT_IMG_NAME.img" || exit 1 +IMAGER_ARGS=("$OUTPUT_IMG_NAME.img") +(( $ADD_DOS_PART )) && IMAGER_ARGS+=('--add-dos-part') +if [[ ! $EDITION || $EDITION == 'all' ]] +then + G_DIETPI-NOTIFY 2 "Running DietPi-Imager for $G_GITOWNER/$G_GITBRANCH" + bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || exit 1 +fi # Amiberry edition: Install automatically on first boot, enable autostart option and onboard audio on RPi if [[ $EDITION == 'Amiberry' || ( $EDITION == 'all' && $HW_MODEL == 0 ) ]] then G_EXEC mv "$OUTPUT_IMG_NAME.img" "${OUTPUT_IMG_NAME}_Amiberry.img" OUTPUT_IMG_NAME="${OUTPUT_IMG_NAME}_Amiberry" + IMAGER_ARGS[0]="$OUTPUT_IMG_NAME.img" # Create loop device FP_LOOP=$(losetup -f) @@ -478,6 +492,15 @@ then G_EXEC partprobe "$FP_LOOP" G_EXEC partx -u "$FP_LOOP" + # Remove added DOS partition, it will be re-added by DietPi-Imager + if (( $ADD_DOS_PART )) && [[ $(lsblk -nrbo FSTYPE,LABEL "$FP_LOOP" | tail -1) == 'vfat DIETPISETUP' ]] + then + SETUP_PART=$(sfdisk -lqo DEVICE "$FP_LOOP" | tail -1) + G_EXEC_OUTPUT=1 G_EXEC sfdisk --no-reread --no-tell-kernel --delete "$FP_LOOP" "${SETUP_PART: -1}" + G_EXEC partprobe "$FP_LOOP" + G_EXEC partx -u "$FP_LOOP" + fi + # Mount filesystems G_EXEC mkdir rootfs if (( $boot_size )) @@ -502,7 +525,8 @@ then G_EXEC rmdir rootfs G_EXEC losetup -d "$FP_LOOP" - bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "$OUTPUT_IMG_NAME.img" || exit 1 + G_DIETPI-NOTIFY 2 "Running DietPi-Imager for $G_GITOWNER/$G_GITBRANCH" + bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || exit 1 fi # AlloGUI edition: Pre-install Allo GUI with all managed audiophile software @@ -510,6 +534,7 @@ if [[ $EDITION == 'AlloGUI' || ( $EDITION == 'all' && $HW_MODEL =~ ^(0|70)$ ) ]] then G_EXEC mv "$OUTPUT_IMG_NAME.img" "${OUTPUT_IMG_NAME%_Amiberry}_AlloGUI.img" OUTPUT_IMG_NAME="${OUTPUT_IMG_NAME%_Amiberry}_AlloGUI" + IMAGER_ARGS[0]="$OUTPUT_IMG_NAME.img" # Raise image size to 2.5 GiB and create loop device G_EXEC truncate -s '2560M' "$OUTPUT_IMG_NAME.img" @@ -517,7 +542,17 @@ then G_EXEC losetup "$FP_LOOP" "$OUTPUT_IMG_NAME.img" G_EXEC partprobe "$FP_LOOP" G_EXEC partx -u "$FP_LOOP" - # Raise partition and filesystem size as well, since resize2fs within the image returns "Nothing to do!" + + # Remove added DOS partition, it will be re-added by DietPi-Imager + if (( $ADD_DOS_PART )) && [[ $(lsblk -nrbo FSTYPE,LABEL "$FP_LOOP" | tail -1) == 'vfat DIETPISETUP' ]] + then + SETUP_PART=$(sfdisk -lqo DEVICE "$FP_LOOP" | tail -1) + G_EXEC_OUTPUT=1 G_EXEC sfdisk --no-reread --no-tell-kernel --delete "$FP_LOOP" "${SETUP_PART: -1}" + G_EXEC partprobe "$FP_LOOP" + G_EXEC partx -u "$FP_LOOP" + fi + + # Raise partition and filesystem sizes as well, since partprobe cannot inform the host kernel about the changed size from within the container G_EXEC_OUTPUT=1 G_EXEC eval "sfdisk -fN2 '$FP_LOOP' <<< ',+'" G_EXEC partprobe "$FP_LOOP" G_EXEC partx -u "$FP_LOOP" @@ -625,7 +660,8 @@ _EOF_ G_EXEC rmdir rootfs G_EXEC losetup -d "$FP_LOOP" - bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "$OUTPUT_IMG_NAME.img" || exit 1 + G_DIETPI-NOTIFY 2 "Running DietPi-Imager for $G_GITOWNER/$G_GITBRANCH" + bash -c "$(curl -sSf "https://raw.githubusercontent.com/$G_GITOWNER/DietPi/$G_GITBRANCH/.build/images/dietpi-imager")" 'DietPi-Imager' "${IMAGER_ARGS[@]}" || exit 1 fi [[ $VMTYPE && $VMTYPE != 'raw' ]] || exit 0 diff --git a/.build/images/dietpi-imager b/.build/images/dietpi-imager index 29d309d052..b6996ec194 100755 --- a/.build/images/dietpi-imager +++ b/.build/images/dietpi-imager @@ -46,22 +46,11 @@ exit 1 } - # Inputs + ########################################## + # Process inputs + ########################################## SOURCE_TYPE='Drive' FP_SOURCE_IMG= - if [[ -b $1 ]] - then - FP_SOURCE=$1 - - elif [[ -f $1 ]] - then - SOURCE_TYPE='Image' - FP_SOURCE_IMG=$1 - - elif [[ $1 ]] - then - Error_Exit "Input source $1 does not exist, aborting..." - fi PART_TABLE_TYPE= #FP_ROOT_DEV= ROOT_FS_TYPE= @@ -69,9 +58,32 @@ OUTPUT_IMG_EXT='img' #OUTPUT_IMG_NAME= [[ $MOUNT_IT == 'On' ]] || MOUNT_IT='Off' + [[ $SKIP_FIRSTBOOT_RESIZE == 1 ]] || SKIP_FIRSTBOOT_RESIZE=0 [[ $SHRINK_ONLY == 1 ]] || SHRINK_ONLY=0 [[ $SKIP_ARCHIVE == 1 ]] || SKIP_ARCHIVE=0 - [[ $SKIP_FIRSTBOOT_RESIZE == 1 ]] || SKIP_FIRSTBOOT_RESIZE=0 + ADD_DOS_PART=0 + while (( $# )) + do + case $1 in + '--add-dos-part') ADD_DOS_PART=1;; + *) + if [[ -b $1 ]] + then + FP_SOURCE=$1 + + elif [[ -f $1 ]] + then + SOURCE_TYPE='Image' + FP_SOURCE_IMG=$1 + + elif [[ $1 ]] + then + Error_Exit "Input source $1 does not exist, aborting..." + fi + ;; + esac + shift + done Unmount_tmp() { @@ -494,12 +506,57 @@ G_EXEC partx -u "$FP_SOURCE" fi + # Derive target image size from last partition end + 1 sector + IMAGE_SIZE=$(( ( $(sfdisk -qlo End "$FP_SOURCE" | tail -1) + 1 ) * 512 )) # 512 byte sectors => bytes + + # Add trailing FAT partition to simplify first run setup if requested + # - WARNING: this assumes that the partitions in the table are in order (which we do in other places as well) + if (( $ADD_DOS_PART )) + then + G_DIETPI-NOTIFY 2 'Adding a 1 MiB FAT partition to simplify first run setup' + # Increase source image size if required + [[ $SOURCE_TYPE == 'Image' ]] && (( $(stat -c '%s' "$FP_SOURCE_IMG") < $IMAGE_SIZE + 1048576 )) && G_EXEC truncate -s "$(( $IMAGE_SIZE + 1048576 ))" "$FP_SOURCE_IMG" && G_EXEC losetup -c "$FP_SOURCE" + # Add new DOS partition + local type='EBD0A0A2-B9E5-4433-87C0-68B6B72699C7' # https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs + [[ $PART_TABLE_TYPE == 'dos' ]] && type='c' + G_EXEC eval "sfdisk -a '$FP_SOURCE' <<< 'start=$IMAGE_SIZE,size=2048,type=$type'" # size in sectors + G_EXEC partprobe "$FP_SOURCE" + G_EXEC partx -u "$FP_SOURCE" + # create a FAT filesystem and add config files to it + local new_dos_part=$(sfdisk -l "$FP_SOURCE" | mawk "/ $IMAGE_SIZE /{print \$1;exit}") + G_EXE_OUTPUT=1 G_EXEC mkfs.fat -F 16 -n DIETPISETUP "$new_dos_part" + local fat_mountpoint=$(mktemp -d) + local root_mountpoint=$(mktemp -d) + G_EXEC mount "$new_dos_part" "$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 + cat << '_EOF_' > "$fat_mountpoint/Readme-DietPi-Config.txt" +DietPi pre-boot configuration + +You can edit the files in this folder to setup some configuration options +or even a completely automated install. Please check the documentation and +dietpi.txt for details: https://dietpi.com/docs/install/ + +This folder also supports the following additional files. Please ensure that +they have UNIX style LF line endings: +- unattended_pivpn.conf +- Automation_Custom_PreScript.sh +- Automation_Custom_Script.sh +_EOF_ + G_EXEC umount "$root_mountpoint" "$fat_mountpoint" + G_EXEC rmdir "$root_mountpoint" "$fat_mountpoint" + ((IMAGE_SIZE+=1048576)) + fi + # Exit now if source shall be shrunk only (( $SHRINK_ONLY )) && exit 0 - # Finished: Derive final image size from last partition end + 1 sector - IMAGE_SIZE=$(( ( $(sfdisk -qlo End "$FP_SOURCE" | tail -1) + 1 ) * 512 )) # 512 byte sectors => bytes - [[ $PART_TABLE_TYPE == 'gpt' ]] && IMAGE_SIZE=$(( $IMAGE_SIZE + 33*512 )) # Add 33 (34 overall) sectors for GPT backup partition table + # Add 33 (34 overall) sectors for GPT backup partition table + [[ $PART_TABLE_TYPE == 'gpt' ]] && IMAGE_SIZE=$(( $IMAGE_SIZE + 33*512 )) # Image file source and dd target if [[ $FP_SOURCE_IMG && $CLONING_TOOL == 'dd' ]] diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 509df364ac..0cebad0f72 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -990,13 +990,13 @@ _EOF_ 40) model='pine64' kernel='sunxi64';; 42) model='rockpro64' kernel='rockchip64';; 43) model='rock64' kernel='rockchip64';; - 44) model='pinebook-a64' kernel='sunxi64' dietpi_com=1;; + 44) model='pinebook-a64' kernel='sunxi64';; 45) model='pineh64-b' kernel='sunxi64';; - 46) model='pinebook-pro' kernel='rockchip64' dietpi_com=1;; + 46) model='pinebook-pro' kernel='rockchip64';; 47) model='nanopi-r4s' kernel='rockchip64';; 48) model='nanopi-r1' kernel='sunxi' arch='arm';; 52) model='tinkerboard' kernel='rockchip' arch='arm';; - 54) model='nanopik2-s905' dietpi_com=1;; + 54) model='nanopik2-s905';; 55) model='nanopi-r2s' kernel='rockchip64';; 56) model='nanopineo3' kernel='rockchip64';; 57) model='nanopineoplus2' kernel='sunxi64';; @@ -1007,10 +1007,9 @@ _EOF_ case $HW_VARIANT in 2) model='nanopifire3';; *) model='nanopim3';; - esac - dietpi_com=1;; + esac;; 63) model='nanopim1' kernel='sunxi' arch='arm' dietpi_com=1;; - 64) model='nanopiair' kernel='sunxi' arch='arm' dietpi_com=1;; + 64) model='nanopiair' kernel='sunxi' arch='arm';; 65) kernel='sunxi64' case $HW_VARIANT in 2) model='nanopineo2black';; @@ -1021,11 +1020,11 @@ _EOF_ 68) kernel='rockchip64' case $HW_VARIANT in 1) model='nanopim4';; - 3) model='nanopineo4' dietpi_com=1;; + 3) model='nanopineo4';; *) model='nanopct4';; esac;; 72) model='rockpi-4b' kernel='rockchip64';; - 73) model='rockpi-s' kernel='rockchip64' dietpi_com=1;; + 73) model='rockpi-s' kernel='rockchip64';; 74) model='radxa-zero';; 77) model='rock-3a' kernel='rk35xx' branch='edge';; 78) model='rock-5b' kernel='rk35xx' branch='legacy';; @@ -1033,8 +1032,8 @@ _EOF_ 82) model='orangepi5-plus' kernel='rk35xx' branch='legacy';; *) :;; esac - # Download and pre-install U-Boot hosted on dietpi.com where it has not been ported (and probably never will) to the Armbian Bookworm repo or where it provides a too old version - if (( $dietpi_com && $G_DISTRO > 6 || $G_HW_MODEL == 62 || $G_HW_MODEL == 72 || $G_HW_MODEL == 80 || $G_HW_MODEL == 82 )) + # Download and pre-install U-Boot hosted on dietpi.com where it has not been ported to the Armbian Bookworm repo or has been removed completely + if (( $dietpi_com && $G_DISTRO > 6 || $G_HW_MODEL == 62 )) then G_EXEC curl -sSfo package.deb "https://dietpi.com/downloads/binaries/linux-u-boot-$model-$branch.deb" G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb @@ -1056,19 +1055,19 @@ _EOF_ # Install initramfs-tools first to have an initramfs generated on kernel install, and configure it to use zstd if supported for better compression and faster decompression [[ $kernel == 'rockchip64' || $kernel == 'rk35xx' || $kernel == 'meson64' || $kernel == 'sunxi64' || $kernel == 'sunxi' ]] && zstd=('zstd') # - Download and pre-install a more recent armbian-firmware package from our server - G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/armbian-firmware.deb' - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb - G_EXEC rm package.deb + #G_EXEC_OUTPUT=1 G_EXEC curl -fo package.deb 'https://dietpi.com/downloads/binaries/armbian-firmware.deb' + #G_EXEC_OUTPUT=1 G_EXEC dpkg -i package.deb + #G_EXEC rm package.deb G_AGI initramfs-tools u-boot-tools armbian-firmware "${zstd[@]}" [[ ${zstd[0]} ]] && G_CONFIG_INJECT 'COMPRESS=' 'COMPRESS=zstd' /etc/initramfs-tools/initramfs.conf # Download and pre-install kernel hosted on dietpi.com where the Armbian APT repo provides a too old version - if [[ $G_HW_MODEL =~ ^(78|80|82)$ || ( $kernel == 'rockchip64' && $branch == 'current' ) ]] - then - G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb "https://dietpi.com/downloads/binaries/linux-image-$branch-$kernel.deb" - G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb "https://dietpi.com/downloads/binaries/linux-dtb-$branch-$kernel.deb" - G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb - G_EXEC rm package1.deb package2.deb - fi + #if [[ $G_HW_MODEL =~ ^(78|80|82)$ || ( $kernel == 'rockchip64' && $branch == 'current' ) ]] + #then + # G_EXEC_OUTPUT=1 G_EXEC curl -fo package1.deb "https://dietpi.com/downloads/binaries/linux-image-$branch-$kernel.deb" + # G_EXEC_OUTPUT=1 G_EXEC curl -fo package2.deb "https://dietpi.com/downloads/binaries/linux-dtb-$branch-$kernel.deb" + # G_EXEC_OUTPUT=1 G_EXEC dpkg -i package1.deb package2.deb + # G_EXEC rm package1.deb package2.deb + #fi G_AGI linux-{image,dtb}-"$branch-$kernel" "linux-u-boot-$model-$branch" # Cleanup [[ $G_HW_MODEL != 10 && -f '/boot/uImage' ]] && G_EXEC rm /boot/uImage @@ -1962,8 +1961,8 @@ _EOF_ G_DIETPI-NOTIFY 2 'Enabling NanoPi R4S Ethernet LEDs' G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf' cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules -SUBSYSTEM=="leds", KERNEL=="lan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" -SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" +SUBSYSTEM=="leds", KERNEL=="green:lan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" +SUBSYSTEM=="leds", KERNEL=="green:wan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" _EOF_ # NanoPi R2S elif (( $G_HW_MODEL == 55 )) diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index a18e8c5d4a..133655760e 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Setup tmpfs run: sudo mount -t tmpfs -o "noatime,lazytime,uid=$(id -u)" tmpfs "$GITHUB_WORKSPACE" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup DietPi-Globals run: | sudo mkdir -p /boot/dietpi/func diff --git a/.meta/dietpi-survey_report b/.meta/dietpi-survey_report index 707baaa300..5a06fdf49d 100755 --- a/.meta/dietpi-survey_report +++ b/.meta/dietpi-survey_report @@ -683,13 +683,16 @@ shopt -s extglob aSOFTWARE_NAME8_20[211]='Homebridge' aSOFTWARE_NAME8_21=() + aSOFTWARE_NAME8_22=() for i in "${!aSOFTWARE_NAME8_20[@]}" do aSOFTWARE_NAME8_21[i]=${aSOFTWARE_NAME8_20[i]} + aSOFTWARE_NAME8_22[i]=${aSOFTWARE_NAME8_21[i]} done + aSOFTWARE_NAME8_22[141]='ADS-B Feeder' # Pre-create software counter array so that we can see also software (available in newest version) with 0 installs - for i in "${aSOFTWARE_NAME8_21[@]}" + for i in "${aSOFTWARE_NAME8_22[@]}" do aSOFTWARE[$i]=0 done diff --git a/.update/patches b/.update/patches index cefd175279..c2d4466e32 100755 --- a/.update/patches +++ b/.update/patches @@ -1162,15 +1162,6 @@ Patch_8_17() [[ -f '/etc/systemd/system/roonbridge.service.d/dietpi-no-caps.conf' ]] && G_EXEC rm /etc/systemd/system/roonbridge.service.d/dietpi-no-caps.conf [[ -f '/etc/systemd/system/roonbridge.service.d' ]] && G_EXEC rmdir --ignore-fail-on-non-empty /etc/systemd/system/roonbridge.service.d - # NanoPi R4S - elif (( $G_HW_MODEL == 47 )) - then - G_DIETPI-NOTIFY 2 'Updating udev rule for NanoPi R4S Ethernet LEDs' - G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf' - cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules -SUBSYSTEM=="leds", KERNEL=="lan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" -SUBSYSTEM=="leds", KERNEL=="wan_led", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" -_EOF_ # NanoPi R2S elif (( $G_HW_MODEL == 55 )) then @@ -1470,6 +1461,20 @@ Patch_8_21() fi } +Patch_8_22() +{ + # NanoPi R4S: Fix Ethernet LEDs: https://github.com/MichaIng/DietPi/issues/6342#issuecomment-1697669420 + if (( $G_HW_MODEL == 47 )) + then + G_DIETPI-NOTIFY 2 'Updating udev rule for NanoPi R4S Ethernet LEDs' + G_EXEC eval 'echo '\''ledtrig-netdev'\'' > /etc/modules-load.d/dietpi-eth-leds.conf' + cat << '_EOF_' > /etc/udev/rules.d/dietpi-eth-leds.rules +SUBSYSTEM=="leds", KERNEL=="green:lan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth0", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth0", RUN+="/bin/ip l s down dev eth0" +SUBSYSTEM=="leds", KERNEL=="green:wan", ACTION=="add", ATTR{trigger}="netdev", ATTR{device_name}="eth1", ATTR{link}="1", ATTR{rx}="1", ATTR{tx}="1", RUN+="/bin/ip l s up dev eth1", RUN+="/bin/ip l s down dev eth1" +_EOF_ + fi +} + # v6.35 => v7 migration if (( $G_DIETPI_VERSION_CORE == 6 && $G_DIETPI_VERSION_SUB > 34 )) then diff --git a/.update/version b/.update/version index 3450adc4ff..3584ab528c 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=21 -G_REMOTE_VERSION_RC=1 +G_REMOTE_VERSION_SUB=22 +G_REMOTE_VERSION_RC=-1 # Minimum DietPi version to allow update G_MIN_VERSION_CORE=6 G_MIN_VERSION_SUB=14 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index fa470b7c44..96bbf05d0f 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,23 @@ +v8.22 +(2023-09-23) + +New software: +- ADS-B Feeder | Track airplanes using SDRs and feed the data to ADS-B aggregators. Many thanks to @dirkhh for maintaining and implementing this software option: https://github.com/MichaIng/DietPi/pull/6587 + +Enhancements: +- General | DietPi images are now shipped with a trailing FAT partition which contains dietpi.txt and other config files for easier pre-configuration and automation from Windows and macOS hosts. The partition is removed automatically on first boot, after copying all supported config files/scripts. Related CLI flags have been added to our build scripts: "--add-fat-part" for dietpi-imager and "--no-fat-part" for dietpi-build. Many thanks to @dirkhh for implementing this feature: https://github.com/MichaIng/DietPi/pull/6602 +- DietPi-Software | Docker: Enabled for Trixie and RISC-V via "docker.io" package from Debian repository. +- DietPi-Software | Portainer: Enabled for RISC-V as Docker is now supported on RISC-V as well. + +Bug fixes: +- NanoPi R4S | Resolved a v8.20 regression where the Ethernet LEDs did not react correctly after the kernel upgrade. Many thanks to @idaanx for reporting this issue: https://github.com/MichaIng/DietPi/issues/6342#issuecomment-1697669420 +- DietPi-Config | The menu option to update the SPI bootloader is now shown on Orange Pi 5 Plus as well, as intended. Many thanks for @zappydood for reporting its absence: https://github.com/MichaIng/DietPi/issues/6501#issuecomment-1697175109 +- DietPi-Software | Ampache: Resolved an issue where the latest version was not successfully detected on install, so that an older fallback version was installed instead. Many thanks to @bartolus39 for reporting this issue: https://github.com/MichaIng/DietPi/issues/6598 + +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/6580 + +----------------------------------------------------------------------------------------------------------- + v8.21 (2023-08-26) @@ -7,7 +27,7 @@ New images: Enhancements: - Orange Pi 5/ROCK 5B | An update of the kernel to Linux 5.10.160 will be applied automatically as part of the DietPi update. - Orange Pi 5 | An update of the U-Boot package will be applied. When flashing it to SPI via dietpi-config > Advanced Options > Update SPI bootloader, it enables booting DietPi via NVMe and USB. -- 64-bit Rockchip SBCs | All SBCs with Armbian's 64-bit Rockchip kernel package "linux-image-current-rockchip64" will receive a major kernel upgrade to Linux 6.1.46, including lots of fixes and enhancements that have been applied upstream and by Armbian in the meantime. Since Armbian's APT repository has not seen any update since February 2023, we started compiling and hosting own builds. An own APT repository is being worked on to better distribute our own package builds. Until the, headers for this kernel package can be downloaded at: https://dietpi.com/downloads/binaries/linux-headers-current-rockchip64.deb +- RK33xx SBCs | All SBCs with RK33xx SoC and Armbian's "linux-image-current-rockchip64" kernel package will receive a major kernel upgrade to Linux 6.1.46, including lots of fixes and enhancements that have been applied upstream and by Armbian in the meantime. Since Armbian's APT repository has not seen any update since February 2023, we started compiling and hosting own builds. An own APT repository is being worked on to better distribute our own package builds. Until then, headers for this kernel package can be downloaded at: https://dietpi.com/downloads/binaries/linux-headers-current-rockchip64.deb - DietPi-Config | WiFi Hotspot: When applying settings, manually changed IP addresses in /etc/network/interfaces will now be preserved. Additionally, it is now assured that changing interface names, e.g. due to an additionally attached WiFi adapter, are now aligned across /etc/network/interfaces, hostapd and DHCP server configs. - DietPi-Config | WiFi Hotspot: Toggles for enabling 802.11ac/WiFi 5, 802.11ax/WiFi 6 (Bookworm only) and 5 GHz WiFi respectively have been added to the menu. - DietPi-Software | WiFi Hotspot: We added new dietpi.txt settings "SOFTWARE_WIFI_HOTSPOT_WIFI4", "SOFTWARE_WIFI_HOTSPOT_WIFI5", "SOFTWARE_WIFI_HOTSPOT_WIFI6" and "SOFTWARE_WIFI_HOTSPOT_5G" to have 802.11n/WiFi 4, 802.11ac/WiFi 5, 802.11ax/WiFi 6 (Bookworm only) and 5 GHz support respectively enabled on install. @@ -1507,7 +1527,7 @@ Bug Fixes: - DietPi-Software | Home Assistant: Resolved on issue where fresh install failed to started to start due to missing permissions. Many thanks to @slopsjon, @tyjtyj and @pakikje for reporting this issue. - DietPi-Software | Google AIY: Resolved an issue where fresh install failed to start due to missing permissions - DietPi-Software | Grafana: Resolved an issue where install failed on RPi 1/Zero Buster systems. The fix includes an update of Grafana to the latest official version for those models. Many thanks to @TBail for reporting this issue: https://github.com/MichaIng/DietPi/issues/3213 -- DietPi-Software | Jackett: Resolved an issue where the internal updater broke the Jackett instance. Automated updates can be safely enabled again. Many thanks to @ngosang for providing the workaround: https://github.com/MichaIng/DietPi/issues/2593 +- DietPi-Software | Jackett: Resolved an issue where the internal updater broke the Jackett instance. Automated updates can be safely enabled again. Many thanks to @ezekini for reporting this issue: https://github.com/MichaIng/DietPi/issues/2593 - DietPi-Software | Pi-hole: Resolved an issue where choosing to block public admin panel access on Nginx failed. Many thanks to @anubis-genix for reporting this issue: https://github.com/MichaIng/DietPi/issues/3024#issuecomment-550342684 - DietPi-Software | Java: Resolved an issue where install on ARMv6 RPis (1/Zero) on Buster system failed, since Java 11 is not ARMv6-compatible. On these system, Java 8 is now installed instead. Many thanks to @maartenlangeveld for reporting this issue: https://github.com/MichaIng/DietPi/issues/3182 - DietPi-Software | rTorrent: Resolved an issue where rTorrent and the webserver didn't have sufficient permissions to read and write ruTorrent web UI settings and data. Many thanks to @notDavid for reporting this issue: https://github.com/MichaIng/DietPi/issues/3244 diff --git a/README.md b/README.md index a30c71f33d..f14488ca3e 100644 --- a/README.md +++ b/README.md @@ -337,6 +337,7 @@ Links to hardware and software manufacturers, sources and build instructions use - [Restic](https://github.com/restic/restic) - [MediaWiki](https://github.com/wikimedia/mediawiki) - [Homebridge](https://github.com/homebridge/homebridge) +- [ADS-B Feeder](https://github.com/dirkhh/adsb-feeder-image) --- diff --git a/dietpi/dietpi-config b/dietpi/dietpi-config index e1098d07e5..492aabb158 100755 --- a/dietpi/dietpi-config +++ b/dietpi/dietpi-config @@ -1068,8 +1068,8 @@ Re-enabling HDMI requires a reboot. If you need emergency HDMI output, edit the G_WHIP_MENU_ARRAY+=('Update RPi4 EEPROM firmware' ': Install rpi-eeprom APT package') fi - # Orange Pi 5: https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457 - elif (( $G_HW_MODEL == 80 )) + # Orange Pi 5 (Plus): https://dietpi.com/forum/t/orange-pi-5-boot-from-nvme/16457 + elif [[ $G_HW_MODEL == 8[02] ]] then [[ -b '/dev/mtdblock0' && -f '/usr/lib/u-boot/platform_install.sh' ]] && G_WHIP_MENU_ARRAY+=('Update SPI bootloader' ': Flash current U-Boot to /dev/mtdblock0') diff --git a/dietpi/dietpi-services b/dietpi/dietpi-services index d8e5f558b5..04b8758ae3 100755 --- a/dietpi/dietpi-services +++ b/dietpi/dietpi-services @@ -268,6 +268,8 @@ _EOF_ 'fahclient' 'ipfs' 'yacy' + 'adsb-setup' + 'adsb-docker' ) # Additional services: https://github.com/MichaIng/DietPi/issues/1869#issuecomment-401017251 diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 52d842e036..bc3b0e77fe 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -1130,8 +1130,6 @@ Available commands: aSOFTWARE_DESC[$software_id]='Build, ship, and run distributed applications' aSOFTWARE_CATX[$software_id]=8 aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/programming/#docker' - # - RISC-V: Missing package: https://download.docker.com/linux/debian/dists/ - aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 #------------------ software_id=185 aSOFTWARE_NAME[$software_id]='Portainer' @@ -1141,8 +1139,6 @@ Available commands: aSOFTWARE_DEPS[$software_id]='162' # - ARMv6: https://dietpi.com/forum/t/armv6-bookworm-software-test-matrix-question/16380/11 aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,1]=0 - # - RISC-V: Missing Docker package: https://download.docker.com/linux/debian/dists/ - aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0 #------------------ software_id=134 aSOFTWARE_NAME[$software_id]='Docker Compose' @@ -1603,6 +1599,13 @@ Available commands: aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/distributed_projects/#yacy' aSOFTWARE_DEPS[$software_id]='196' #------------------ + software_id=141 + aSOFTWARE_NAME[$software_id]='ADS-B Feeder' + aSOFTWARE_DESC[$software_id]='track airplanes using SDRs and feed the data to ADS-B aggregators' + aSOFTWARE_CATX[$software_id]=19 + aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/distributed_projects/#adsb-feeder' + aSOFTWARE_DEPS[$software_id]='17 130 134 162' # Git, Python, Docker & Docker Compose + #------------------ software_id=184 aSOFTWARE_NAME[$software_id]='Tor Relay' aSOFTWARE_DESC[$software_id]='add a node to the Tor network' @@ -7020,7 +7023,7 @@ _EOF_ if To_Install 98 haproxy # HAProxy then - local version='2.7.6' # https://www.haproxy.org/download/ + local version='2.8.2' # https://www.haproxy.org/download/ aDEPS=('make' 'gcc' 'libpcre3-dev' 'libssl-dev' 'zlib1g-dev' 'libsystemd-dev') Download_Install "https://www.haproxy.org/download/${version%.*}/src/haproxy-$version.tar.gz" @@ -7652,8 +7655,8 @@ _EOF_ # Bullseye+ if (( $G_DISTRO > 5 )) then - local fallback_url='https://github.com/ampache/ampache/releases/download/5.5.3/ampache-5.5.3_all.zip' - Download_Install "$(curl -sSfL 'https://api.github.com/repos/ampache/ampache/releases/latest' | mawk -F\" '/"browser_download_url": ".*\/ampache-[0-9\.]*_all.zip"/{print $4}')" ampache + local fallback_url="https://github.com/ampache/ampache/releases/download/6.0.2/ampache-6.0.2_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' @@ -8718,7 +8721,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.4'; 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.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"; } Download_Install "https://github.com/Novik/ruTorrent/archive/$version.tar.gz" # - Reinstall freshly with preserved configs and 3rd party plugins @@ -9109,7 +9112,7 @@ _EOF_ *) local arch='arm';; esac - local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.23.7/syncthing-linux-$arch-v1.23.7.tar.gz" + local fallback_url="https://github.com/syncthing/syncthing/releases/download/v1.24.0/syncthing-linux-$arch-v1.24.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 @@ -10187,7 +10190,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.7.4.3769/Prowlarr.master.1.7.4.3769.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Prowlarr/Prowlarr/releases/download/v1.8.6.3946/Prowlarr.master.1.8.6.3946.linux-core-$arch.tar.gz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/Prowlarr/Prowlarr/releases/latest' | mawk -F\" "/\"browser_download_url\": .*linux-core-$arch\.tar\.gz\"/{print \$4}")" G_EXEC mv Prowlarr /opt/prowlarr fi @@ -10262,7 +10265,7 @@ _EOF_ *) local arch='x64';; esac - local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.3.2171/Readarr.develop.0.3.3.2171.linux-core-$arch.tar.gz" + local fallback_url="https://github.com/Readarr/Readarr/releases/download/v0.3.4.2207/Readarr.develop.0.3.4.2207.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 @@ -10589,23 +10592,32 @@ _EOF_ if To_Install 162 docker # Docker then - # Detect distro - local distro='debian' - (( $G_RASPBIAN )) && distro='raspbian' + # APT package name + # - RISC-V: Use "docker.io" from Debian repo as the official Docker repo does not support RISC-V yet: https://download.docker.com/linux/debian/dists/ + local package='docker.io' + if (( $G_HW_ARCH != 11 )) + then + # Detect distro + local distro='debian' + (( $G_RASPBIAN )) && distro='raspbian' - # APT key - local url="https://download.docker.com/linux/$distro/gpg" - G_CHECK_URL "$url" - G_EXEC eval "curl -sSfL '$url' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-docker.gpg --yes" + # APT key + local url="https://download.docker.com/linux/$distro/gpg" + G_CHECK_URL "$url" + G_EXEC eval "curl -sSfL '$url' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-docker.gpg --yes" - # APT list - G_EXEC eval "echo 'deb https://download.docker.com/linux/$distro/ $G_DISTRO_NAME stable' > /etc/apt/sources.list.d/docker.list" - G_AGUP + # APT list + G_EXEC eval "echo 'deb https://download.docker.com/linux/$distro/ ${G_DISTRO_NAME/trixie/bookworm} stable' > /etc/apt/sources.list.d/docker.list" + G_AGUP + + # APT package name + package='docker-ce' + fi # APT package # - Mask service to prevent iptables related startup failure: https://github.com/MichaIng/DietPi/issues/6013 G_EXEC systemctl mask --now docker - G_AGI docker-ce + G_AGI "$package" G_EXEC systemctl unmask docker G_EXEC systemctl start docker.socket @@ -10617,7 +10629,7 @@ _EOF_ # - Move Docker containers to dietpi_userdata # - Log to systemd-journald (journalctl) by default with reduced log level: https://github.com/MichaIng/DietPi/issues/2388 # + containerd: https://github.com/docker/docker.github.io/issues/9091 - [[ -d '/mnt/dietpi_userdata/docker-data' ]] || G_EXEC mkdir /mnt/dietpi_userdata/docker-data + G_EXEC mkdir -p /mnt/dietpi_userdata/docker-data if [[ -f '/etc/docker/daemon.json' ]] then GCI_PRESERVE=1 G_CONFIG_INJECT '"data-root":' ' "data-root": "/mnt/dietpi_userdata/docker-data",' /etc/docker/daemon.json '^\{([[:space:]]|$)' @@ -10753,7 +10765,7 @@ _EOF_ *) local arch='arm-6';; esac - local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.20.3/gitea-1.20.3-linux-$arch.xz" + local fallback_url="https://github.com/go-gitea/gitea/releases/download/v1.20.4/gitea-1.20.4-linux-$arch.xz" Download_Install "$(curl -sSfL 'https://api.github.com/repos/go-gitea/gitea/releases/latest' | mawk -F\" "/\"browser_download_url\": \".*\/gitea-[^\"\/]*-linux-$arch\.xz\"/{print \$4}")" /mnt/dietpi_userdata/gitea/gitea # User @@ -11288,7 +11300,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.0/tasmoadmin_v3.1.0.tar.gz' + local fallback_url='https://github.com/TasmoAdmin/TasmoAdmin/releases/download/v3.1.1/tasmoadmin_v3.1.1.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 @@ -11984,6 +11996,56 @@ _EOF_ G_EXEC_OUTPUT=1 G_EXEC docker run -d -p '9002:9000' --name=portainer --restart=always -v '/run/docker.sock:/var/run/docker.sock' -v 'portainer_data:/data' 'portainer/portainer-ce' fi + if To_Install 141 adsb-setup adsb-docker # ADS-B Feeder + then + # clone the adsb-feeder repo into /tmp + G_EXEC_OUTPUT=1 G_EXEC git clone -b dietpi 'https://github.com/dirkhh/adsb-feeder-image.git' /tmp/adsb-feeder + + # remove the service that isn't needed for an app install on DietPi and install the rest + G_EXEC cd /tmp/adsb-feeder/src/modules/adsb-feeder/filesystem/root + G_EXEC rm ./usr/lib/systemd/system/adsb-bootstrap.service + G_EXEC mv ./usr/lib/systemd/system/* /etc/systemd/system/ + + # determine the version + local ADSB_FEEDER_DATE_COMPONENT=$(git log -20 --date='format:%y%m%d' --format='%ad' | uniq -c | mawk '{print $2"."$1;exit}') + local ADSB_FEEDER_TAG_COMPONENT=$(git describe --match 'v[0-9]*' | cut -d- -f1) + local ADSB_FEEDER_VERSION="$ADSB_FEEDER_TAG_COMPONENT(dietpi)-$ADSB_FEEDER_DATE_COMPONENT" + + # create the target directory for the app and populated with the code from the git checkout + [[ -d '/opt/adsb' ]] && G_EXEC rm -R /opt/adsb + G_EXEC mv /tmp/adsb-feeder/src/modules/adsb-feeder/filesystem/root/opt/adsb /opt/ + G_EXEC cd /opt/adsb + + # remove the git clone of the repo we installed from + G_EXEC rm -R /tmp/adsb-feeder + + # create a symlink so the config files reside where they should be in /mnt/dietpi_userdata/adsb-feeder + G_EXEC mkdir -p /mnt/dietpi_userdata/adsb-feeder/config + G_EXEC ln -s /mnt/dietpi_userdata/adsb-feeder/config . + + # set the 'image name' and version that are shown in the footer of the Web UI + G_EXEC eval 'echo '\''ADSB Feeder app running on DietPi'\'' > feeder-image.name' + G_EXEC eval "echo '$ADSB_FEEDER_VERSION' > adsb.im.version" + + # get the Python module + # for older distros we need to install via pip in order to get flask 2 + if (( $G_DISTRO < 7 )) + then + G_EXEC_OUTPUT=1 G_EXEC pip3 install -U flask + else + G_AGI python3-flask + fi + + # finally ensure that /run allows executables (this is needed for the containers to be able to not do excessive + # writes to physical storage - which might be an SD card) + G_EXEC mount -o remount,exec /run + + # now that everything is in place, run the one time service to get the software pre-configured + # running this as a service allows it to do a bit of housekeeping in the background without disrupting + # the software install flow + G_EXEC systemctl start adsb-nonimage + fi + if To_Install 172 # WireGuard then # Packages available on Buster backports and Bullseye: On Raspbian Buster add Bullseye repo @@ -12738,6 +12800,17 @@ If no WireGuard (auto)start is included, but you require it, please do the follo [[ -d '/etc/yacy' ]] && G_EXEC rm -R /etc/yacy fi + if To_Uninstall 141 # ADS-B Feeder + then + G_EXEC_NOHALT=1 G_EXEC_OUTPUT=1 G_EXEC /opt/adsb/docker-compose-adsb down + Remove_Service adsb-bootstrap + Remove_Service adsb-feeder-update + Remove_Service adsb-setup + Remove_Service adsb-update + command -v docker &> /dev/null && G_EXEC docker image prune -a -f + G_EXEC rm -Rf /opt/adsb /mnt/dietpi_userdata/adsb-feeder /opt/adsb-feeder-update + fi + if To_Uninstall 2 # Folding@Home then # Un-check out all work units, so they can be picked up by other donors prior to timeout: https://github.com/FoldingAtHome/fah-issues/issues/1255 diff --git a/dietpi/func/dietpi-globals b/dietpi/func/dietpi-globals index 511e5c5f99..ee41286297 100644 --- a/dietpi/func/dietpi-globals +++ b/dietpi/func/dietpi-globals @@ -58,8 +58,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=21 - [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=1 + [[ $G_DIETPI_VERSION_SUB ]] || G_DIETPI_VERSION_SUB=22 + [[ $G_DIETPI_VERSION_RC ]] || G_DIETPI_VERSION_RC=-1 [[ $G_GITBRANCH ]] || G_GITBRANCH='master' [[ $G_GITOWNER ]] || G_GITOWNER='MichaIng' # - Save current version and Git branch diff --git a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh index 5495eb128a..7140597829 100755 --- a/rootfs/var/lib/dietpi/services/fs_partition_resize.sh +++ b/rootfs/var/lib/dietpi/services/fs_partition_resize.sh @@ -39,6 +39,23 @@ exit 1 fi + # Check if the last partition contains a FAT filesystem with DIETPISETUP label + if [[ $(lsblk -nrbo FSTYPE,LABEL "$ROOT_DRIVE" | tail -1) == 'vfat DIETPISETUP' ]] + then + # Mount it and copy files if present and newer + SETUP_PART=$(sfdisk -lqo DEVICE "$ROOT_DRIVE" | tail -1) + TMP_MOUNT=$(mktemp -d) + mount "$SETUP_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 -u "$TMP_MOUNT/$f" /boot/ + done + umount "$SETUP_PART" + rmdir "$TMP_MOUNT" + # Finally delete the partition so the resizing works + sfdisk --no-reread --no-tell-kernel --delete "$ROOT_DRIVE" "${SETUP_PART: -1}" + fi + # Only increase partition size if not yet done on first boot if [[ -f '/dietpi_skip_partition_resize' ]] then