diff --git a/.build/images/dietpi-build b/.build/images/dietpi-build index 3c63703489..46f5a7c0ce 100755 --- a/.build/images/dietpi-build +++ b/.build/images/dietpi-build @@ -49,7 +49,7 @@ PTTYPE='msdos' FSTYPE='ext4' ITYPE= VMTYPE= -GITBRANCH='master' +GITBRANCH='apt' GITOWNER='MichaIng' EDITION= SUFFIX= diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index 85b9f3a094..6b8e19a2c4 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1035,8 +1035,17 @@ setenv rootuuid "true"' /boot/boot.cmd # DietPi-Build with Armbian kernel/bootloader/firmware elif (( $armbian_repo )) then - # Prevent any unintended packages from being installed from Armbian's APT repository, like base-files: https://github.com/MichaIng/DietPi/issues/6227#issuecomment-1713688577 - cat << '_EOF_' > /etc/apt/preferences.d/dietpi-armbian + # 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 lists + find /etc/apt/sources.list.d -mindepth 1 ! -name 'dietpi.list' -exec rm -Rf {} + + + if [[ $G_GITBRANCH == 'master' ]] + then + # Prevent any unintended packages from being installed from Armbian's APT repository, like base-files: https://github.com/MichaIng/DietPi/issues/6227#issuecomment-1713688577 + cat << '_EOF_' > /etc/apt/preferences.d/dietpi-armbian Package: * Pin: origin apt.armbian.com Pin-Priority: -1 @@ -1045,29 +1054,23 @@ Package: armbian-firmware* linux-* Pin: origin apt.armbian.com Pin-Priority: 500 _EOF_ - if dpkg --compare-versions "$(dpkg-query -Wf '${Version}' base-files)" gt 20 - then - G_DIETPI-NOTIFY 2 'Enforcing downgrade of Armbian'\''s base-files package to Debian'\''s' - cat << '_EOF_' > /etc/apt/preferences.d/dietpi-armbian-tmp + if dpkg --compare-versions "$(dpkg-query -Wf '${Version}' base-files)" gt 20 + then + G_DIETPI-NOTIFY 2 'Enforcing downgrade of Armbian'\''s base-files package to Debian'\''s' + cat << '_EOF_' > /etc/apt/preferences.d/dietpi-armbian-tmp Package: base-files Pin: release o=Debian Pin-Priority: 1000 _EOF_ - G_EXEC eval 'echo '\''APT::Get::Allow-Downgrades "1";'\'' > /etc/apt/apt.conf.d/dietpi-armbian' - fi - - # Bootstrap Armbian repository - G_EXEC_RETRIES=2 G_EXEC eval 'curl -sSfL '\''https://apt.armbian.com/armbian.key'\'' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-armbian.gpg --yes' - - # 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~' + G_EXEC eval 'echo '\''APT::Get::Allow-Downgrades "1";'\'' > /etc/apt/apt.conf.d/dietpi-armbian' + fi - # Remove obsolete lists - find /etc/apt/sources.list.d -mindepth 1 ! -name 'dietpi.list' -exec rm -Rf {} + + # Bootstrap Armbian repository + G_EXEC_RETRIES=2 G_EXEC eval 'curl -sSfL '\''https://apt.armbian.com/armbian.key'\'' | gpg --dearmor -o /etc/apt/trusted.gpg.d/dietpi-armbian.gpg --yes' - # Add Armbian repository - G_EXEC eval "echo 'deb https://apt.armbian.com ${DISTRO_TARGET_NAME/bullseye/bookworm} main' > /etc/apt/sources.list.d/dietpi-armbian.list" + # Add Armbian repository + G_EXEC eval "echo 'deb https://apt.armbian.com ${DISTRO_TARGET_NAME/bullseye/bookworm} main' > /etc/apt/sources.list.d/dietpi-armbian.list" + fi # Select kernel, device tree and U-Boot packages local model='odroidn2' kernel='meson64' arch='arm64' branch='current' zstd=() @@ -1367,14 +1370,7 @@ _EOF_ systemctl stop armbian-* # Keep currently installed kernel and bootloader packages - local apackages=( - - 'linux-image-' - 'linux-dtb-' - 'linux-u-boot-' - ) - - for i in "${apackages[@]}" + for i in linux-{image,dtb,u-boot}- do while read -r line do @@ -1383,7 +1379,6 @@ _EOF_ done < <(dpkg-query -Wf '${Package}\n' | mawk -v pat="^$i" '$0~pat') done - unset -v apackages # Add initramfs-tools and u-boot-tools, required to convert initramfs images into u-boot format aPACKAGES_REQUIRED_INSTALL+=('initramfs-tools' 'u-boot-tools') @@ -1435,6 +1430,21 @@ _EOF_ G_EXEC rm -f /{initrd.img,vmlinuz}{,.old} fi + if [[ -f '/boot/armbianEnv.txt' ]] + then + # Force legacy network interface names + G_CONFIG_INJECT 'extraargs=' 'extraargs=net.ifnames=0' /boot/armbianEnv.txt + + # Disable bootsplash logo, as we removed the file above: https://github.com/MichaIng/DietPi/issues/3932#issuecomment-852376681 + G_CONFIG_INJECT 'bootlogo=' 'bootlogo=false' /boot/armbianEnv.txt + + # Reset default kernel log verbosity, reduced to "1" on most Armbian images + G_CONFIG_INJECT 'verbosity=' 'verbosity=4' /boot/armbianEnv.txt + + # Disable Docker optimisations, since this has some performance drawbacks, enable on Docker install instead + G_CONFIG_INJECT 'docker_optimizations=' 'docker_optimizations=off' /boot/armbianEnv.txt + fi + # Generic kernel, device tree, bootloader and firmware package auto detect + initramfs-tools elif (( $G_HW_MODEL != 75 )) then @@ -2180,22 +2190,6 @@ _EOF_ G_EXEC eval 'echo '\''sprdwl_ng'\'' > /etc/modules-load.d/dietpi-enable_wifi.conf' fi - # Armbian - if [[ -f '/boot/armbianEnv.txt' ]] - then - # Force legacy network interface names - G_CONFIG_INJECT 'extraargs=' 'extraargs=net.ifnames=0' /boot/armbianEnv.txt - - # Disable bootsplash logo, as we removed the file above: https://github.com/MichaIng/DietPi/issues/3932#issuecomment-852376681 - G_CONFIG_INJECT 'bootlogo=' 'bootlogo=false' /boot/armbianEnv.txt - - # Reset default kernel log verbosity, reduced to "1" on most Armbian images - G_CONFIG_INJECT 'verbosity=' 'verbosity=4' /boot/armbianEnv.txt - - # Disable Docker optimisations, since this has some performance drawbacks, enable on Docker install instead - G_CONFIG_INJECT 'docker_optimizations=' 'docker_optimizations=off' /boot/armbianEnv.txt - fi - #------------------------------------------------------------------------------------------------ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Finalise system for first boot of DietPi"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ diff --git a/.github/workflows/dietpi-build.yml b/.github/workflows/dietpi-build.yml index 8ed3cab4cf..f110b0407f 100644 --- a/.github/workflows/dietpi-build.yml +++ b/.github/workflows/dietpi-build.yml @@ -129,8 +129,8 @@ jobs: urls="\"https://dietpi.com/downloads/images/testing/\"" for i in "$@"; do urls="$urls,\"https://dietpi.com/downloads/images/testing/${i##*/}\""; done IFS=, - curl -T "{$*}" --key /root/.ssh/id_ed25519 '\''${{ secrets.UPLOAD_URL }}testing/'\'' - curl -H '\''Authorization: Bearer ${{ secrets.CF_TOKEN }}'\'' -H '\''Content-Type: application/json'\'' -d "{\"files\":[$urls]}" '\''https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache'\'' + #curl -T "{$*}" --key /root/.ssh/id_ed25519 '\''${{ secrets.UPLOAD_URL }}testing/'\'' + #curl -H '\''Authorization: Bearer ${{ secrets.CF_TOKEN }}'\'' -H '\''Content-Type: application/json'\'' -d "{\"files\":[$urls]}" '\''https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache'\'' echo' | sudo tee upload.sh > /dev/null sudo gpg --batch --import << _EOF_ ${{ secrets.GPG_KEY }} diff --git a/.update/patches b/.update/patches index c4d55f2fe0..0e19c124de 100755 --- a/.update/patches +++ b/.update/patches @@ -797,13 +797,6 @@ Patch_8_10() Patch_8_11() { - # Armbian mirror director now correctly handles HTTPS requests - if [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' ]] && grep -q 'http://apt.armbian.com' /etc/apt/sources.list.d/dietpi-armbian.list - then - G_DIETPI-NOTIFY 2 'Connecting to apt.armbian.com via secure HTTPS since their router now handles HTTPS redirects reliably' - G_EXEC sed --follow-symlinks -i 's|http://apt.armbian.com|https://apt.armbian.com|' /etc/apt/sources.list.d/dietpi-armbian.list - fi - if (( $G_HW_MODEL == 56 )) then # Revert https://forum.armbian.com/topic/20133-nanopi-neo3-dtb-gone-since-linux-dtb-current-rockchip64-22021/ since dtb is available again @@ -1651,8 +1644,15 @@ Patch_9_5() Patch_9_6() { + # Update DietPi APT list for several SBCs we added components to our repo for + if [[ $PATCH_9_3_RAN == 0 && $G_HW_MODEL =~ ^(42|46|47|52|55|58|68|72|73|76|77|86|87)$ ]] + then + /boot/dietpi/func/dietpi-set_software apt-mirror dietpi + G_AGUP + G_AGUG + # Orange Pi 5: Offer to flash new U-Boot image to solve random Ethernet MAC address: https://github.com/MichaIng/DietPi/issues/6663 - if (( $G_HW_MODEL == 80 )) + elif (( $G_HW_MODEL == 80 )) then if G_WHIP_YESNO '[ INFO ] U-Boot update available to solve random Ethernet MAC address \nIn case you are affected by a random Ethernet MAC address, which changes every boot, flashing the latest U-Boot image has shown to solve it: https://github.com/MichaIng/DietPi/issues/6663 @@ -1691,6 +1691,13 @@ Patch_9_6() G_AGI zstd fi + # Remove Armbian APT repository from all systems which have an "all" component for kernel/bootloader/firmware packages form our APT repository + if [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' && -f '/etc/apt/sources.list.d/dietpi.list' ]] && grep -q 'dietpi.com/apt all' /etc/apt/sources.list.d/dietpi.list + then + G_DIETPI-NOTIFY 2 'Removing obsolete Armbian APT repository' + G_EXEC rm /etc/apt/sources.list.d/dietpi-armbian.list + fi + # Remove obsolete drop-in config: https://github.com/MichaIng/DietPi/issues/7104 [[ -d '/etc/systemd/system/ifup@.service.d' ]] && G_EXEC rm -R /etc/systemd/system/ifup@.service.d } diff --git a/.update/pre-patches b/.update/pre-patches index 702c1bd182..ac983c3244 100755 --- a/.update/pre-patches +++ b/.update/pre-patches @@ -424,6 +424,13 @@ then [[ ${apackages[0]} ]] && G_EXEC apt-mark unhold "${apackages[@]}" unset -v apackages fi + + # Remove Armbian APT repository from all systems which have an "all" component for kernel/bootloader/firmware packages form our APT repository + if [[ -f '/etc/apt/sources.list.d/dietpi-armbian.list' && -f '/etc/apt/sources.list.d/dietpi.list' ]] && grep -q 'dietpi.com/apt all' /etc/apt/sources.list.d/dietpi.list + then + G_DIETPI-NOTIFY 2 'Removing obsolete Armbian APT repository' + G_EXEC rm /etc/apt/sources.list.d/dietpi-armbian.list + fi fi exit 0 diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 01949cb322..cf06a4daaf 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v9.6 (2024-07-06) Enhancements: +- General | Since we provide all kernel, bootloader and firmware packages from our own APT repository now, the Armbian APT repository is removed form all systems. In case you use an SBC which is not officially supported by DietPi, as generic device, it is however preserved. - Quartz64/Star64/VisionFive 2 | The extended attribute handler for ext4 security labels "CONFIG_EXT4_FS_SECURITY" has been enabled for these SBCs, required for some Docker containers. Many thanks to @gxsw for reporting this missing feature: https://github.com/MichaIng/DietPi/issues/7102 - Quartz64/Star64/VisionFive 2 | eBPF functionality for firewall and network monitoring software like Cilium has been added to our kernel builds for these SBCs. Many thanks to @kbrighton for reporting these missing features: https://github.com/MichaIng/DietPi/issues/6834 - Orange Pi 5 | Older U-Boot builds caused the Ethernet MAC address to be random and change on every boot. Recent U-Boot builds solve this, but they are not flashed automatically on package upgrades. We hence inform users and offer to flash the latest U-Boot image during the DietPi update. Many thanks to @thuehlinger for reporting and testing the case: https://github.com/MichaIng/DietPi/issues/6663 diff --git a/dietpi/func/dietpi-set_software b/dietpi/func/dietpi-set_software index 8690a7f276..fe176f54d8 100755 --- a/dietpi/func/dietpi-set_software +++ b/dietpi/func/dietpi-set_software @@ -128,8 +128,11 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R 15) all_components='odroidn2';; 16) all_components='odroidc4';; 40) all_components='pinea64';; + 42) all_components='rockpro64';; 44) all_components='pinebook';; 45) all_components='pineh64';; + 46) all_components='pinebookpro';; + 47) all_components='nanopir4s';; 48) all_components='nanopir1';; 49) # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed kernel/firmware package @@ -149,9 +152,12 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R ;; esac ;; + 52) all_components='tinkerboard';; 54) all_components='nanopik2';; + 55) all_components='nanopir2s';; 56) all_components='nanopineo3';; 57) all_components='nanopineoplus2';; + 58) all_components='nanopim4v2';; 59) all_components='zeropi';; 60) all_components='nanopineo';; 61) all_components='nanopi2';; @@ -193,18 +199,54 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R ;; 66) all_components='nanopim1plus';; 67) all_components='nanopik1plus';; + 68) + # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package + # shellcheck disable=SC2154 + case $HW_VARIANT in + 1) all_components='nanopim4';; + 2) all_components='nanopineo4';; + 3) all_components='nanopct4';; + *) + [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) + [[ $all_components ]] || for i in nano{pim4,pineo4,pct4} + do + dpkg-query -s "linux-u-boot-$i-legacy" &> /dev/null || continue + all_components=${i/-//} + break + done + ;; + esac + ;; 70) all_components='sparkysbc';; + 72) + # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package + # shellcheck disable=SC2154 + case $HW_VARIANT in + 1) all_components='rock4';; + 2) all_components='rock4se';; + 3) all_components='rock4cplus';; + *) + [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) + [[ $all_components ]] || for i in rock{pi-4b,-4se,pi-4cplus} + do + dpkg-query -s "linux-u-boot-$i-legacy" &> /dev/null || continue + all_components=${i/-//} + break + done + ;; + esac + ;; + 73) all_components='rockpis';; 74) all_components='radxazero';; 76) # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package # shellcheck disable=SC2154 case $HW_VARIANT in - 1) all_components='';; # no R5S component is available yet + 1) all_components='nanopir5s';; 2) all_components='nanopir5c';; *) [[ -f '/etc/apt/sources.list.d/dietpi.list' ]] && all_components=$(sed -n '/ all /{s/^.* all //p;q}' /etc/apt/sources.list.d/dietpi.list) - # shellcheck disable=SC2043 - [[ $all_components ]] || for i in nanopi-r5c + [[ $all_components ]] || for i in nanopi-r5{c,s} do dpkg-query -s "linux-u-boot-$i-current" &> /dev/null || continue all_components=${i/-//} @@ -213,6 +255,7 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R ;; esac ;; + 77) all_components='rock3a';; 78) all_components='rock5b';; 79) # Detect variant either based on $HW_VARIANT environment variable, existing "all" components or installed U-Boot package @@ -238,6 +281,8 @@ $FP_SCRIPT rpi_kernel_choice Supported on Debian Bookworm or newer on R 83) all_components='orangepizero3';; 84) all_components='star64';; 85) all_components='rock5a';; + 86) all_components='tinkerboard2';; + 87) all_components='orangepi3b';; 88) all_components='orangepizero2w';; 89) all_components='orangepi3lts';; 90) all_components='radxazero3';;