summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-01-08 21:33:53 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-01-08 21:33:53 +0000
commit5ad62fbdd3e65c841a917ee5f2d1fc238921078c (patch)
treeb9a2ebbf00ba84edd0eedc59e8163746df3a8db6 /package
parenta6f470987e6035ee650e95b996ca96980f6d92bc (diff)
Forward port whiterussian resolv.conf changes
/etc/resolv.conf links to /tmp/resolv.conf /tmp/resolv.conf links to /tmp/resolv.conf.auto by default (which is where the ISPs nameserver is in) When dnsmasq starts, it replaces /tmp/resolv.conf with a file pointing to 127.0.0.1 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6043 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/base-files/Makefile1
-rwxr-xr-xpackage/base-files/files/etc/init.d/boot1
-rw-r--r--package/base-files/files/etc/resolv.conf2
-rwxr-xr-xpackage/base-files/files/lib/network/config.sh4
-rwxr-xr-xpackage/base-files/files/usr/share/udhcpc/default.script2
-rw-r--r--package/dnsmasq/files/dnsmasq.conf2
-rw-r--r--package/dnsmasq/files/dnsmasq.init8
-rw-r--r--package/ppp/Makefile2
-rw-r--r--package/ppp/files/ppp.sh2
9 files changed, 15 insertions, 9 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 16c6dc1eb..14917f683 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -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 \
diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot
index c58365234..db7ec8cc3 100755
--- a/package/base-files/files/etc/init.d/boot
+++ b/package/base-files/files/etc/init.d/boot
@@ -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
index 9617eacda..000000000
--- a/package/base-files/files/etc/resolv.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-nameserver 127.0.0.1
-search lan
diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh
index 845b33eb7..f3ead6a79 100755
--- a/package/base-files/files/lib/network/config.sh
+++ b/package/base-files/files/lib/network/config.sh
@@ -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
}
diff --git a/package/base-files/files/usr/share/udhcpc/default.script b/package/base-files/files/usr/share/udhcpc/default.script
index 53c8faf31..f39d21ed8 100755
--- a/package/base-files/files/usr/share/udhcpc/default.script
+++ b/package/base-files/files/usr/share/udhcpc/default.script
@@ -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
diff --git a/package/dnsmasq/files/dnsmasq.conf b/package/dnsmasq/files/dnsmasq.conf
index 8a51f8445..8a8191b63 100644
--- a/package/dnsmasq/files/dnsmasq.conf
+++ b/package/dnsmasq/files/dnsmasq.conf
@@ -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@@
diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init
index 7afcee420..5e72fd014 100644
--- a/package/dnsmasq/files/dnsmasq.init
+++ b/package/dnsmasq/files/dnsmasq.init
@@ -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() {
diff --git a/package/ppp/Makefile b/package/ppp/Makefile
index 2938b915e..dc1f37b0a 100644
--- a/package/ppp/Makefile
+++ b/package/ppp/Makefile
@@ -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
diff --git a/package/ppp/files/ppp.sh b/package/ppp/files/ppp.sh
index 6fd40fbe1..0bd75fc0a 100644
--- a/package/ppp/files/ppp.sh
+++ b/package/ppp/files/ppp.sh
@@ -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} \