Skip to content

Commit

Permalink
v6.27
Browse files Browse the repository at this point in the history
+ DietPi-Patch | Reapply ARMbian conflicting file removal/block more sustainably
  • Loading branch information
MichaIng authored Nov 29, 2019
1 parent aee6309 commit b2f0045
Showing 1 changed file with 31 additions and 15 deletions.
46 changes: 31 additions & 15 deletions dietpi/patch_file
Original file line number Diff line number Diff line change
Expand Up @@ -1841,21 +1841,6 @@ Use "dietpi-config" to adjust these settings to your needs.'

fi
#-------------------------------------------------------------------------------
# Disable and remove all ARMbian services, especially to catch new zRam implementation, conflicting/bugging RAMlog in cases: https://github.com/MichaIng/DietPi/issues/2738
for i in /etc/init.d/armbian* /{etc,lib,usr/lib}/systemd/system/armbian*.service{,.d}
do

[[ -e $i ]] || continue
[[ -f $i ]] && systemctl disable --now ${i##*/}
rm -R $i

done
rm -f /etc/apt/apt.conf.d/*armbian*
rm -f /etc/cron.*/armbian*
rm -f /etc/default/armbian*
[[ -d '/usr/lib/armbian' ]] && rm -R /usr/lib/armbian
[[ -d '/usr/share/armbian' ]] && rm -R /usr/share/armbian
#-------------------------------------------------------------------------------
# Update x86_64 kernel module settings
if (( $G_HW_ARCH == 10 )); then

Expand Down Expand Up @@ -2215,6 +2200,37 @@ Would you like to switch back to the Nginx authentication method now?' && certbo
#-------------------------------------------------------------------------------
# Remove obsolete files that could have remained on older systems
rm -Rf /{DietPi,boot}/dietpi/{server_version*,login} /boot/dietpi/patch_file
#-------------------------------------------------------------------------------
# Mask ARMbian services, which are otherwise re-enabled on related APT package upgrade
local packages=$(dpkg-query -Wf '${PACKAGE}\n' linux-*-root-*)
for i in packages
do

services=$(dpkg -L $i | sed -n '\|^/lib/systemd/system/[^/]*\.service$|{s|^.*/||g;p}')
[[ $services == *'armbian'* ]] || continue # Failsafe
systemctl disable --now $services
systemctl mask $services

done
# Place DPKG exclude file, especially to skip cron jobs, which are doomed to fail and an unnecessary overhead + syslog spam on DietPi
rm -f /etc/apt/apt.conf.d/*armbian*
rm -f /etc/cron.*/*armbian*
#rm -f /etc/default/*armbian*
rm -f /etc/update-motd.d/*armbian*
rm -f /etc/profile.d/*armbian*
#[[ -d '/usr/lib/armbian' ]] && rm -R /usr/lib/armbian
[[ -d '/usr/share/armbian' ]] && rm -R /usr/share/armbian
cat << _EOF_ > /etc/dpkg/dpkg.cfg.d/dietpi-no_armbian
# Exclude conflicting ARMbian files
path-exclude /lib/systemd/system/*armbian*
path-exclude /etc/apt/apt.conf.d/*armbian*
path-exclude /etc/cron.*/*armbian*
#path-exclude /etc/default/*armbian* # Breaks ARMbain root package upgrade
path-exclude /etc/update-motd.d/*armbian*
path-exclude /etc/profile.d/*armbian*
#path-exclude /usr/lib/armbian # Breaks ARMbain root package upgrade
path-exclude /usr/share/armbian
_EOF_
#-------------------------------------------------------------------------------
# Reinstalls
# Syncthing: https://github.com/MichaIng/DietPi/pull/3202
Expand Down

0 comments on commit b2f0045

Please sign in to comment.