change the way resolv.conf is being created, so that it also works when dnsmasq is...
authorFelix Fietkau <nbd@openwrt.org>
Fri, 27 Oct 2006 01:47:16 +0000 (01:47 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 27 Oct 2006 01:47:16 +0000 (01:47 +0000)
SVN-Revision: 5305

openwrt/package/base-files/Makefile
openwrt/package/base-files/default/bin/firstboot
openwrt/package/base-files/default/etc/functions.sh
openwrt/package/base-files/default/etc/init.d/S40network
openwrt/package/base-files/default/etc/resolv.conf [deleted file]
openwrt/package/base-files/default/usr/share/udhcpc/default.script
openwrt/package/dnsmasq/files/S50dnsmasq
openwrt/package/dnsmasq/files/dnsmasq.conf
openwrt/package/ppp/Makefile

index 30e6cfef23efdf35763f7ec4ebc61d6b910365cd..babe50ae6112ffb2d4042594d7d2457bb05e999b 100644 (file)
@@ -51,6 +51,8 @@ $(IPKG_BASE):
        mkdir -p $(IDIR_BASE)/usr/bin
        mkdir -p $(IDIR_BASE)/www
        rm -f $(IDIR_BASE)/var
+       rm -f $(IDIR_BASE)/etc/resolv.conf
+       ln -sf /tmp/resolv.conf $(IDIR_BASE)/etc/resolv.conf
        ln -sf /tmp $(IDIR_BASE)/var
        -find $(IDIR_BASE) -type d -name CVS | xargs rm -rf
        -find $(IDIR_BASE) -type d -name .svn | xargs rm -rf
index 02d941fe9840323e9056719ba500d4db13d38616..148bc995ded7655655d9cb36e916276e869b3649 100755 (executable)
@@ -21,7 +21,6 @@ dupe() { # <new_root> <old_root>
                case "$file" in
                ./rom/note) ;; #nothing
                ./etc/config*|\
-               ./etc/resolv.conf|\
                ./usr/lib/ipkg/info/*) cp -af $2/$file $file;;
                *) ln -sf /rom/${file#./*} $file;;
                esac
index 7a3ab6f23e7283a679dd2d30793b21cf9857b174..9fecccf7d4b270da2c2e7b98039ffc38acbb753c 100755 (executable)
@@ -60,10 +60,10 @@ do_ifup() {
                        } done
                }
 
-               [ -f /tmp/resolv.conf ] || {
-                       debug "# --- creating /tmp/resolv.conf ---"
+               [ -f /tmp/resolv.conf.auto ] || {
+                       debug "# --- creating /tmp/resolv.conf.auto ---"
                        for dns in $(nvram get ${2}_dns); do
-                               echo "nameserver $dns" >> /tmp/resolv.conf
+                               echo "nameserver $dns" >> /tmp/resolv.conf.auto
                        done
                }
                
index 2cae726359cfd129811262d3d87774cb1a1127a2..751dae7206cb4e46c5c0ce178aaeb9be0bc7bfb5 100755 (executable)
@@ -1,6 +1,8 @@
 #!/bin/sh
 case "$1" in
   start|restart)
+  rm -f /tmp/resolv.conf
+  ln -s /tmp/resolv.conf.auto /tmp/resolv.conf
   ifup_interfaces=$(nvram get ifup_interfaces)
   ifup_interfaces=${ifup_interfaces:-"lan wan wifi"}
   for iface in $ifup_interfaces; do
diff --git a/openwrt/package/base-files/default/etc/resolv.conf b/openwrt/package/base-files/default/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 20d306de4b18ea90a263b243c39f1c7ca9cb1580..cd45644a05a4b400afa14c2a5572f4636922c980 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 [ -z "$1" ] && echo "Error: should be run by udhcpc" && exit 1
 
-RESOLV_CONF="/tmp/resolv.conf"
+RESOLV_CONF="/tmp/resolv.conf.auto"
 
 hotplug_event() {
        nvram show 2>&- | grep _proto=dhcp | {
index 1c47011d05e0d3939b3f924870172d7c39ee8aee..1699659ea676f9733b683df91f93163077a16398 100755 (executable)
@@ -30,4 +30,11 @@ udhcpc -n -q -R -s /bin/true -i $ifname >&- || {
 wanproto=$(nvram get wan_proto)
 [ -z "$wanproto" -o "$wanproto" = "none" ] || args="${args} -I $(nvram get wan_ifname)"
 
-dnsmasq ${args}
+dnsmasq ${args} && {
+       # use dnsmasq for local dns requests
+       rm -f /tmp/resolv.conf
+       cat > /tmp/resolv.conf <<EOF
+nameserver 127.0.0.1
+search lan
+EOF
+}
index e43d473686f7be87c2a9a291b0e1c28252429ca8..f40c4aca48eebbf5e929bde970e7c55c8672c1cd 100644 (file)
@@ -9,7 +9,7 @@ local=/lan/
 domain=lan
 expand-hosts
 no-negcache
-resolv-file=/tmp/resolv.conf
+resolv-file=/tmp/resolv.conf.auto
 
 # enable dhcp (start,end,netmask,leasetime)
 dhcp-authoritative
index 79e03c037e333d0a6ac50638aea16c90489db56a..3acbfe6649ad3ea5c709082c4fe640b1d2ffba51 100644 (file)
@@ -88,7 +88,7 @@ endif
 
 $(IPKG_PPP):
        install -d -m0755 $(IDIR_PPP)/etc/ppp
-       ln -sf /tmp/resolv.conf $(IDIR_PPP)/etc/ppp/resolv.conf
+       ln -sf /tmp/resolv.conf.auto $(IDIR_PPP)/etc/ppp/resolv.conf
        install -m0600 ./files/etc/ppp/chap-secrets $(IDIR_PPP)/etc/ppp/
        install -m0644 ./files/etc/ppp/options $(IDIR_PPP)/etc/ppp/
        $(INSTALL_FILTER)