Skip to content

Commit

Permalink
v8.23
Browse files Browse the repository at this point in the history
- DietPi-Installer | Fix base-files workaound for Armbian pre-images: Previously we added a workaround where the package was not provided via apt.armbian.com. But now it is and we added a workaround for known hardware models already which might however conflict. The old workaround has now been removed and the new one applied for generic/unknown SBCs with Armbian kernel as well.
- DietPi-Installer | Harden /var/lock workaround for Armbian images: Do not only remove the faulty directory, but also create the intended symlink.
- DietPi-Installer | Remove udev rules to rename Ethernet interfaces from Armbian pre-images
  • Loading branch information
MichaIng committed Oct 9, 2023
1 parent 84cc7c4 commit c5e6013
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions .build/images/dietpi-installer
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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-'
Expand Down Expand Up @@ -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++))
#------------------------------------------------------------------------------------------------
Expand All @@ -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'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c5e6013

Please sign in to comment.