summaryrefslogtreecommitdiffstats
path: root/external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files')
-rw-r--r--external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/clean-connman-symlink.service11
-rw-r--r--external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean14
2 files changed, 25 insertions, 0 deletions
diff --git a/external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/clean-connman-symlink.service b/external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/clean-connman-symlink.service
new file mode 100644
index 00000000..8af82637
--- /dev/null
+++ b/external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/clean-connman-symlink.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Clean up bogus symlinked resolv.conf
+Before=network-pre.target
+Wants=network-pre.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/resolvconf-clean
+
+[Install]
+WantedBy=multi-user.target
diff --git a/external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean b/external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean
new file mode 100644
index 00000000..89c7e905
--- /dev/null
+++ b/external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if [ ! -L /etc/resolv.conf ]; then
+ exit 0
+fi
+
+# 'readlink -f' will fail if the symlink doesn't resolve to an existing path
+if readlink /etc/resolv.conf | grep -q connman; then
+ echo "Replacing resolv.conf symlink: $(readlink /etc/resolv.conf) to /etc/resolv-conf.systemd"
+ rm /etc/resolv.conf
+ ln -s /etc/resolv-conf.systemd /etc/resolv.conf
+fi