diff --git a/dietpi/patch_file b/dietpi/patch_file index cbde2d994a..19939e3e28 100644 --- a/dietpi/patch_file +++ b/dietpi/patch_file @@ -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 @@ -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