summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2014-05-20 12:37:19 +0200
committerSimon Rettberg2014-05-20 12:37:19 +0200
commit183031f091e56caa86fa48a89eee44a0819118eb (patch)
treea4625b1f5fac148bba7deccf754744b31b4bf8d4
parent[pam-freiburg] dont exec the cifs part if no cifs volume is found (diff)
downloadtm-scripts-183031f091e56caa86fa48a89eee44a0819118eb.tar.gz
tm-scripts-183031f091e56caa86fa48a89eee44a0819118eb.tar.xz
tm-scripts-183031f091e56caa86fa48a89eee44a0819118eb.zip
Make resolv.conf a symlink to /run/network/resolv.conf (where we generate ours from now on), in case someone wants to override the resolv.conf via config.tgz
-rwxr-xr-xremote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx18
-rwxr-xr-xremote/rootfs/rootfs-stage31/data/inc/setup_stage323
l---------remote/rootfs/rootfs-stage32/data/etc/resolv.conf1
-rwxr-xr-xremote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers2
4 files changed, 15 insertions, 9 deletions
diff --git a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
index cf140246..482adedc 100755
--- a/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
+++ b/remote/modules/dhcpc-busybox/data/opt/openslx/scripts/udhcpc-openslx
@@ -19,20 +19,24 @@
. /opt/openslx/config
-RESOLV_CONF="/etc/resolv.conf"
+RESOLV_CONF="/run/network/resolv.conf"
THIS_RESOLV="/run/network/${interface}.resolv"
rebuild_resolv_conf () {
- # Maybe make this smarter some time, if anyone is using client's that are on multiple networks at once etc...
+ # Don't do anything if the active resolv.conf is not ours
+ # Also this will not run resolvconf update.d... No idea if we should still do so...
+ [ -L "/etc/resolv.conf" ] || return 0
+ [ "x$(readlink "/etc/resolv.conf")" == "x${RESOLV_CONF}" ] || return 0
+ # Maybe make this smarter some time, if anyone is using clients that are on multiple networks at once etc...
# This is a little braindead but should work most of the time
sort -u /run/network/*.resolv > "$RESOLV_CONF" 2> /dev/null
# add support for resolv.conf update scripts // see man(8) resolvconf
- if [ -d /etc/resolvconf/update.d ]; then
- for s in $(ls -1 /etc/resolvconf/update.d/*.sh); do
- $s
- done
- fi
+ if [ -d /etc/resolvconf/update.d ]; then
+ for s in $(ls -1 /etc/resolvconf/update.d/*.sh); do
+ $s
+ done
+ fi
}
escape_search() {
diff --git a/remote/rootfs/rootfs-stage31/data/inc/setup_stage32 b/remote/rootfs/rootfs-stage31/data/inc/setup_stage32
index 9bf30d25..68b509b2 100755
--- a/remote/rootfs/rootfs-stage31/data/inc/setup_stage32
+++ b/remote/rootfs/rootfs-stage31/data/inc/setup_stage32
@@ -44,7 +44,8 @@ busybox mount -n --move "$FUTURE_ROOT" /mnt/opt/openslx/uniontmp || drop_shell "
FUTURE_ROOT="/mnt"
# Move network stuff
-cp /etc/hostname /etc/hosts /etc/resolv.conf "${FUTURE_ROOT}/etc/"
+cp /etc/hostname /etc/hosts "${FUTURE_ROOT}/etc/"
+cp /etc/resolv.conf "${FUTURE_ROOT}/run/network/"
[ -s "/run/config" ] && cat "/run/config" >> "${FUTURE_ROOT}/opt/openslx/config"
# if booting with splash, suppress kernel output in stage32
diff --git a/remote/rootfs/rootfs-stage32/data/etc/resolv.conf b/remote/rootfs/rootfs-stage32/data/etc/resolv.conf
new file mode 120000
index 00000000..9f9115ae
--- /dev/null
+++ b/remote/rootfs/rootfs-stage32/data/etc/resolv.conf
@@ -0,0 +1 @@
+/run/network/resolv.conf \ No newline at end of file
diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers
index 990fdb44..1e999da6 100755
--- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers
+++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-early_network_triggers
@@ -7,7 +7,7 @@
# Main interface
BRIDGE="br0"
-if [ ! -e "/sys/class/net/${BRIDGE}/operstate" -o "x$(cat "/sys/class/net/${BRIDGE}/operstate")" == "xup" ] && [ -e "/opt/openslx/uniontmp/etc/hostname" -o -e "/opt/openslx/uniontmp/etc/resolv.conf" ]; then
+if [ ! -e "/sys/class/net/${BRIDGE}/operstate" -o "x$(cat "/sys/class/net/${BRIDGE}/operstate")" == "xup" ] && [ -e "/opt/openslx/uniontmp/etc/hostname" -o -e "/etc/resolv.conf" ]; then
echo "Triggering network.target"
touch "/run/network/network-ready"
systemctl start network.target &