Skip to content

Commit 3643c25

Browse files
committed
dietpi-patches: move forward Armbian base-files patch
We enforced the downgrade only in case the Armbian repo was left in place, unintentionally one conditional too deep. Re-apply with DietPi v9.20 entirely unconditionally, aside of the impossibly high package version of course. But lower that one as well to >=15 to catch even possibly ancient cases. Latest Debian base-files is 14 until after Forky release in summer 2027. Even if then someone runs into this patch on Debian 15 Duke somehow, it will be just a noop, no harm.
1 parent faa7ebd commit 3643c25

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

.update/patches

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,10 +2245,6 @@ Patch_9_16()
22452245
fi
22462246
fi
22472247

2248-
# Remove obsolete configs from pre-patches
2249-
[[ -f '/etc/apt/preferences.d/dietpi-armbian-tmp' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-armbian-tmp
2250-
[[ -f '/etc/apt/apt.conf.d/dietpi-armbian-tmp' ]] && G_EXEC rm /etc/apt/apt.conf.d/dietpi-armbian-tmp
2251-
22522248
# NanoPi 4/5/6 series: Repair faulty all component
22532249
if [[ $G_HW_MODEL =~ ^(68|76|79)$ && -f '/etc/apt/sources.list.d/dietpi.list' ]] && grep -Eq ' all .*/(legacy|vendor|current|edge)$' /etc/apt/sources.list.d/dietpi.list
22542250
then
@@ -2653,6 +2649,10 @@ Patch_9_19()
26532649

26542650
Patch_9_20()
26552651
{
2652+
# Remove obsolete configs from pre-patches
2653+
[[ -f '/etc/apt/preferences.d/dietpi-armbian-tmp' ]] && G_EXEC rm /etc/apt/preferences.d/dietpi-armbian-tmp
2654+
[[ -f '/etc/apt/apt.conf.d/dietpi-armbian-tmp' ]] && G_EXEC rm /etc/apt/apt.conf.d/dietpi-armbian-tmp
2655+
26562656
# Software updates, migrations and patches
26572657
if [[ -f '/boot/dietpi/.installed' ]]
26582658
then

.update/pre-patches

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -462,17 +462,6 @@ Package: armbian-firmware* linux-*
462462
Pin: origin apt.armbian.com
463463
Pin-Priority: 500
464464
_EOF_'
465-
# Block and enforce downgrade of Armbian's base-files package to Debian's: https://github.com/MichaIng/DietPi/issues/6227#issuecomment-1713688577
466-
if dpkg --compare-versions "$(dpkg-query -Wf '${Version}' base-files)" gt 20
467-
then
468-
G_DIETPI-NOTIFY 2 'Enforcing downgrade of Armbian'\''s base-files package to Debian'\''s'
469-
G_EXEC eval 'cat << '\''_EOF_'\'' > /etc/apt/preferences.d/dietpi-armbian-tmp
470-
Package: base-files
471-
Pin: release o=Debian
472-
Pin-Priority: 1000
473-
_EOF_'
474-
G_EXEC eval 'echo '\''APT::Get::Allow-Downgrades "1";'\'' > /etc/apt/apt.conf.d/dietpi-armbian-tmp'
475-
fi
476465
fi
477466
fi
478467

@@ -599,5 +588,21 @@ _EOF_"
599588
fi
600589
fi
601590

591+
# v9.20
592+
if (( $G_DIETPI_VERSION_CORE < 9 || ( $G_DIETPI_VERSION_CORE == 9 && $G_DIETPI_VERSION_SUB < 20 ) ))
593+
then
594+
# Enforce downgrade of Armbian's base-files package to Debian's: https://github.com/MichaIng/DietPi/issues/6227#issuecomment-1713688577
595+
if dpkg --compare-versions "$(dpkg-query -Wf '${Version}' base-files)" ge 15
596+
then
597+
G_DIETPI-NOTIFY 2 'Enforcing downgrade of Armbian'\''s base-files package to Debian'\''s'
598+
G_EXEC eval 'cat << '\''_EOF_'\'' > /etc/apt/preferences.d/dietpi-armbian-tmp
599+
Package: base-files
600+
Pin: release o=Debian
601+
Pin-Priority: 1000
602+
_EOF_'
603+
G_EXEC eval 'echo '\''APT::Get::Allow-Downgrades "1";'\'' > /etc/apt/apt.conf.d/dietpi-armbian-tmp'
604+
fi
605+
fi
606+
602607
exit 0
603608
}

0 commit comments

Comments
 (0)