From 59031be6b376e25a36bf568d6c495f0d2a4bd690 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Tue, 3 Jan 2023 18:58:49 +0100 Subject: [PATCH] armbian-next: only put `systemd-resolved`'s symlink in place if _not_ using NetworkManager - why is it even installed? dunno, but fix anyway. --- lib/functions/rootfs/distro-agnostic.sh | 2 +- lib/functions/rootfs/post-tweaks.sh | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/functions/rootfs/distro-agnostic.sh b/lib/functions/rootfs/distro-agnostic.sh index 5a8c797291..83519d7038 100644 --- a/lib/functions/rootfs/distro-agnostic.sh +++ b/lib/functions/rootfs/distro-agnostic.sh @@ -546,7 +546,7 @@ function install_distribution_agnostic() { # enable PubkeyAuthentication sed -i 's/#\?PubkeyAuthentication .*/PubkeyAuthentication yes/' "${SDCARD}"/etc/ssh/sshd_config - if [ -f "${SDCARD}"/etc/NetworkManager/NetworkManager.conf ]; then + if [[ -f "${SDCARD}"/etc/NetworkManager/NetworkManager.conf ]]; then # configure network manager sed "s/managed=\(.*\)/managed=true/g" -i "${SDCARD}"/etc/NetworkManager/NetworkManager.conf diff --git a/lib/functions/rootfs/post-tweaks.sh b/lib/functions/rootfs/post-tweaks.sh index ed0e0ca94f..741b4300e8 100644 --- a/lib/functions/rootfs/post-tweaks.sh +++ b/lib/functions/rootfs/post-tweaks.sh @@ -3,12 +3,13 @@ function post_debootstrap_tweaks() { display_alert "Applying post-tweaks" "post_debootstrap_tweaks" "debug" - # activate systemd-resolved - if [[ -d "${SDCARD}"/etc/systemd/network ]]; then - display_alert "Activating systemd-resolved" "Symlink resolv.conf" "debug" - # configure networkd - run_host_command_logged rm -fv "${SDCARD}"/etc/resolv.conf - run_host_command_logged ln -s /run/systemd/resolve/resolv.conf "${SDCARD}"/etc/resolv.conf + # activate systemd-resolved, if not using NetworkManager + if [[ ! -f "${SDCARD}"/etc/NetworkManager/NetworkManager.conf ]]; then + if [[ -d "${SDCARD}"/etc/systemd/network ]]; then + display_alert "Activating systemd-resolved" "Symlink resolv.conf to systemd-resolved's" "debug" + run_host_command_logged rm -fv "${SDCARD}"/etc/resolv.conf + run_host_command_logged ln -s /run/systemd/resolve/resolv.conf "${SDCARD}"/etc/resolv.conf + fi fi # remove service start blockers