From fc3286a3f946b1fe10da9280b6d77710c1165cc0 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Mon, 24 Oct 2022 15:46:11 +0200 Subject: [PATCH] armbian-next: initial post-`kinetic` `resolved` debacle, for now just WARN don't break; missing resolved package in kinetic? --- lib/functions/rootfs/distro-agnostic.sh | 3 ++- lib/functions/rootfs/distro-specific.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/functions/rootfs/distro-agnostic.sh b/lib/functions/rootfs/distro-agnostic.sh index 7e261b6f5..73f78689b 100644 --- a/lib/functions/rootfs/distro-agnostic.sh +++ b/lib/functions/rootfs/distro-agnostic.sh @@ -584,7 +584,8 @@ function install_distribution_agnostic() { elif [ -d "${SDCARD}"/etc/systemd/network ]; then # enable services - chroot_sdcard systemctl enable systemd-networkd.service systemd-resolved.service + chroot_sdcard systemctl enable systemd-networkd.service + chroot_sdcard systemctl enable systemd-resolved.service || display_alert "Failed to enable systemd-resolved.service" "" "wrn" # Mask `NetworkManager.service` to avoid conflict chroot_sdcard systemctl mask NetworkManager.service diff --git a/lib/functions/rootfs/distro-specific.sh b/lib/functions/rootfs/distro-specific.sh index 6d6dfe5c0..5ed2a034b 100644 --- a/lib/functions/rootfs/distro-specific.sh +++ b/lib/functions/rootfs/distro-specific.sh @@ -26,8 +26,12 @@ install_distribution_specific() { fi # DNS fix - if [ -n "$NAMESERVER" ]; then - sed -i "s/#DNS=.*/DNS=$NAMESERVER/g" "${SDCARD}"/etc/systemd/resolved.conf + if [[ -n "$NAMESERVER" ]]; then + if [[ -f "${SDCARD}"/etc/systemd/resolved.conf ]]; then + sed -i "s/#DNS=.*/DNS=$NAMESERVER/g" "${SDCARD}"/etc/systemd/resolved.conf + else + display_alert "DNS fix" "/etc/systemd/resolved.conf not found: ${DISTRIBUTION} ${RELEASE}" "wrn" + fi fi # Journal service adjustements