Forward port whiterussian resolv.conf changes /etc/resolv.conf links to /tmp/resolv...
authorFelix Fietkau <nbd@openwrt.org>
Mon, 8 Jan 2007 21:33:53 +0000 (21:33 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 8 Jan 2007 21:33:53 +0000 (21:33 +0000)
SVN-Revision: 6043

package/base-files/Makefile
package/base-files/files/etc/init.d/boot
package/base-files/files/etc/resolv.conf [deleted file]
package/base-files/files/lib/network/config.sh
package/base-files/files/usr/share/udhcpc/default.script
package/dnsmasq/files/dnsmasq.conf
package/dnsmasq/files/dnsmasq.init
package/ppp/Makefile
package/ppp/files/ppp.sh

index 16c6dc1eb82420993de55340d541964e320502f3..14917f683be991d802608a77048489171534eb8c 100644 (file)
@@ -115,6 +115,7 @@ define Package/base-files$(TARGET)/install
        rm -f $(1)/var
        ln -sf /tmp $(1)/var
        mkdir -p $(1)/etc
+       ln -sf /tmp/resolv.conf $(1)/etc/resolv.conf
        $(call Package/base-files/install-target,$(1))
        for conffile in $(1)/etc/config/*; do \
                if [ -f "$$$$conffile" ]; then \
index c58365234749a848db67500a6742440895a018fd..db7ec8cc3aadd98447c4c89e931d5113b42abe50 100755 (executable)
@@ -15,6 +15,7 @@ start() {
        mkdir -p /var/lock
        touch /var/log/wtmp
        touch /var/log/lastlog
+       ln -s /tmp/resolv.conf.auto /tmp/resolv.conf
        [ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
        
        # manually trigger hotplug before loading modules
diff --git a/package/base-files/files/etc/resolv.conf b/package/base-files/files/etc/resolv.conf
deleted file mode 100644 (file)
index 9617eac..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-nameserver 127.0.0.1
-search lan
index 845b33eb7e952d46496b1cbd70c112b6d3762c35..f3ead6a791d9ab81eb9ce691818d9b97f8f5884d 100755 (executable)
@@ -120,9 +120,9 @@ setup_interface() {
                        $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask"
                        $DEBUG ifconfig "$iface" inet6 add "$ip6addr" 
                        [ -z "$gateway" ] || route add default gw "$gateway"
-                       [ -z "$dns" -o -f /tmp/resolv.conf ] || {
+                       [ -z "$dns" -o -f /tmp/resolv.conf.auto ] || {
                                for ns in $dns; do
-                                       echo "nameserver $ns" >> /tmp/resolv.conf
+                                       echo "nameserver $ns" >> /tmp/resolv.conf.auto
                                done
                        }
 
index 53c8faf3169bc0a63cce9d8ae86567b158b9bf8a..f39d21ed8c2ae380180b5d0e9d90fadfa694c808 100755 (executable)
@@ -3,7 +3,7 @@
 . /etc/functions.sh
 include /lib/network
 
-RESOLV_CONF="/tmp/resolv.conf"
+RESOLV_CONF="/tmp/resolv.conf.auto"
 
 hotplug_event() {
        scan_interfaces
index 8a51f8445d6d8786ca0fc2185b48740bb908467b..8a8191b635138b1e69a4b7c14a0c571071f996e3 100644 (file)
@@ -8,7 +8,7 @@ localise-queries
 local=/lan/
 domain=lan
 expand-hosts
-resolv-file=/tmp/resolv.conf
+resolv-file=/tmp/resolv.conf.auto
 
 @ifdef dhcp_enable
 dhcp-range=@@start@@,@@end@@,@@netmask@@,@@lease@@
index 7afcee420e8c9490030dd99d370fdbb602d60e92..5e72fd014f59d22271a01e2ef529b91da6b782b9 100644 (file)
@@ -50,7 +50,13 @@ start() {
                [ -z "$wan_proto" -o "$wan_proto" = "none" ] || echo "@define wan_ifname $wan_ifname"
        
                cat /etc/dnsmasq.conf
-       ) | awk -f /lib/config/template.awk | dnsmasq -C /proc/self/fd/0
+       ) | awk -f /lib/config/template.awk | dnsmasq -C /proc/self/fd/0 && {
+               rm -f /tmp/resolv.conf
+               cat > /tmp/resolv.conf <<EOF
+nameserver 127.0.0.1
+search lan
+EOF
+       }
 }
 
 stop() {
index 2938b915ef9bacc8a8ba7a7b0a57c4d9a978e3fa..dc1f37b0a95623544d31af82e63d61278af333b8 100644 (file)
@@ -124,7 +124,7 @@ define Package/ppp/install
        $(INSTALL_BIN) ./files/etc/ppp/ip-down $(1)/etc/ppp/
        $(INSTALL_DIR) $(1)/etc/ppp/ip-down.d
        $(INSTALL_DATA) ./files/etc/ppp/options $(1)/etc/ppp/
-       ln -sf /tmp/resolv.conf $(1)/etc/ppp/resolv.conf
+       ln -sf /tmp/resolv.conf.auto $(1)/etc/ppp/resolv.conf
 endef
        
 define Package/ppp-mod-pppoa/install
index 6fd40fbe1e73ff4ba2984fb73250aabbef56fafd..0bd75fc0a76e565307575c6ecaf8616b4f98fe8d 100644 (file)
@@ -25,7 +25,7 @@ start_pppd() {
        [ "$interval" != "$keepalive" ] || interval=5
        
        config_get demand "$cfg" demand
-       [ -n "$demand" ] && echo "nameserver 1.1.1.1" > /tmp/resolv.conf
+       [ -n "$demand" ] && echo "nameserver 1.1.1.1" > /tmp/resolv.conf.auto
        /usr/sbin/pppd "$@" \
                ${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}} \
                ${demand:+precompiled-active-filter /etc/ppp/filter demand idle }${demand:-persist} \