diff --git a/.build/images/dietpi-installer b/.build/images/dietpi-installer index d4d9a5bf1c..5a599935fa 100755 --- a/.build/images/dietpi-installer +++ b/.build/images/dietpi-installer @@ -1119,10 +1119,6 @@ _EOF_ # shellcheck disable=SC2154 write_uboot_platform "$DIR" "$BOOT_DEVICE" - # Remove temporary APT configs - [[ -f '/etc/apt/preferences.d/dietpi-armbian-tmp' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-armbian-tmp - [[ -f '/etc/apt/apt.conf.d/dietpi-armbian' ]] && G_EXEC rm /etc/apt/apt.conf.d/dietpi-armbian - # Odroid C1 cleanup: https://dietpi.com/forum/t/odroid-c1-not-booting-after-kernel-upgrade/17818 if (( $G_HW_MODEL == 10 )) then @@ -1260,11 +1256,33 @@ _EOF_ # Apply Lighttpd as default webserver, since Apache does not run on Linux 3.10: https://dietpi.com/forum/t/allogui-not-working-apache-service-doesnt-start/15708 G_CONFIG_INJECT 'AUTO_SETUP_WEB_SERVER_INDEX=' 'AUTO_SETUP_WEB_SERVER_INDEX=-2' /boot/dietpi.txt - # Armbian grab currently installed packages + # Armbian elif [[ $G_HW_MODEL != 75 && $(dpkg-query -Wf '${Package} ') == *'armbian'* ]] 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 + +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 +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 + systemctl stop armbian-* + # Keep currently installed kernel and bootloader packages local apackages=( 'linux-image-' @@ -1412,6 +1430,10 @@ _EOF_ G_AGA + # Remove temporary APT configs + [[ -f '/etc/apt/preferences.d/dietpi-armbian-tmp' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-armbian-tmp + [[ -f '/etc/apt/apt.conf.d/dietpi-armbian' ]] && G_EXEC rm /etc/apt/apt.conf.d/dietpi-armbian + #------------------------------------------------------------------------------------------------ G_DIETPI-NOTIFY 3 "$G_PROGRAM_NAME" "[$SETUP_STEP] Applying DietPi tweaks and cleanup"; ((SETUP_STEP++)) #------------------------------------------------------------------------------------------------ @@ -1432,12 +1454,8 @@ _EOF_ G_DIETPI-NOTIFY 2 'Restoring default base files:' # shellcheck disable=SC2114 rm -Rfv /etc/{motd,profile,update-motd.d,issue{,.net}} /root /home /media /var/mail - # Replace Armbian's base-files package with Debian's: https://github.com/MichaIng/DietPi/issues/6407 - G_EXEC eval 'echo -e '\''Package: base-files\nPin: origin *\nPin-Priority: 1000'\'' > /etc/apt/preferences.d/99dietpi-base-files' - G_AGI --reinstall --allow-downgrades base-files # Restore /etc/{update-motd.d,issue{,.net}} /root /home, allow downgrades to replace Armbian's base-files package - G_EXEC rm /etc/apt/preferences.d/99dietpi-base-files - G_AGA - [[ -L '/var/lock' ]] || G_EXEC rm -R /var/lock # Armbian images currently ship with this as directory (bug), and postinst fails migrating it to symlink => /run/lock if that directory has content: https://github.com/MichaIng/DietPi/issues/6407 + G_AGI --reinstall base-files # Restore /etc/{update-motd.d,issue{,.net}} /root /home + [[ -L '/var/lock' ]] || { [[ -d '/var/lock' ]] && G_EXEC rm -R /var/lock; G_EXEC ln -s /run/lock /var/lock; } # Armbian images currently ship with this as directory (bug), and postinst fails migrating it to symlink => /run/lock if that directory has content: https://github.com/MichaIng/DietPi/issues/6407 G_EXEC /var/lib/dpkg/info/base-files.postinst configure # Restore /root/.{profile,bashrc} /etc/{motd,profile} /media /var/mail G_DIETPI-NOTIFY 2 'Deleting list of known users and groups, not required by DietPi' @@ -1582,6 +1600,8 @@ _EOF_ G_EXEC rm -f /etc/{default,logrotate.d}/armbian* [[ -f '/lib/firmware/bootsplash.armbian' ]] && G_EXEC rm /lib/firmware/bootsplash.armbian [[ -L '/etc/systemd/system/sysinit.target.wants/bootsplash-ask-password-console.path' ]] && G_EXEC rm /etc/systemd/system/sysinit.target.wants/bootsplash-ask-password-console.path + [[ -f '/etc/udev/rules.d/70-rename-lan.rules' ]] && G_EXEC rm /etc/udev/rules.d/70-rename-lan.rules # NanoPi R2S/R2C: https://github.com/armbian/build/blob/main/config/boards/nanopi-r2s.csc, https://github.com/armbian/build/blob/main/config/boards/nanopi-r2c.csc + [[ -f '/etc/udev/rules.d/70-persistent-net.rules' ]] && G_EXEC rm /etc/udev/rules.d/70-persistent-net.rules # NanoPi R5S/R6S: https://github.com/armbian/build/blob/main/config/boards/nanopi-r5s.csc, https://github.com/armbian/build/blob/main/config/boards/nanopi-r6s.conf # - OMV: https://github.com/MichaIng/DietPi/issues/2994 [[ -d '/etc/openmediavault' ]] && G_EXEC rm -R /etc/openmediavault