mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-01-27 14:01:05 +02:00
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
This commit is contained in:
parent
a6f470987e
commit
5ad62fbdd3
@ -115,6 +115,7 @@ define Package/base-files$(TARGET)/install
|
|||||||
rm -f $(1)/var
|
rm -f $(1)/var
|
||||||
ln -sf /tmp $(1)/var
|
ln -sf /tmp $(1)/var
|
||||||
mkdir -p $(1)/etc
|
mkdir -p $(1)/etc
|
||||||
|
ln -sf /tmp/resolv.conf $(1)/etc/resolv.conf
|
||||||
$(call Package/base-files/install-target,$(1))
|
$(call Package/base-files/install-target,$(1))
|
||||||
for conffile in $(1)/etc/config/*; do \
|
for conffile in $(1)/etc/config/*; do \
|
||||||
if [ -f "$$$$conffile" ]; then \
|
if [ -f "$$$$conffile" ]; then \
|
||||||
|
@ -15,6 +15,7 @@ start() {
|
|||||||
mkdir -p /var/lock
|
mkdir -p /var/lock
|
||||||
touch /var/log/wtmp
|
touch /var/log/wtmp
|
||||||
touch /var/log/lastlog
|
touch /var/log/lastlog
|
||||||
|
ln -s /tmp/resolv.conf.auto /tmp/resolv.conf
|
||||||
[ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
|
[ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
|
||||||
|
|
||||||
# manually trigger hotplug before loading modules
|
# manually trigger hotplug before loading modules
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
nameserver 127.0.0.1
|
|
||||||
search lan
|
|
@ -120,9 +120,9 @@ setup_interface() {
|
|||||||
$DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask"
|
$DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask"
|
||||||
$DEBUG ifconfig "$iface" inet6 add "$ip6addr"
|
$DEBUG ifconfig "$iface" inet6 add "$ip6addr"
|
||||||
[ -z "$gateway" ] || route add default gw "$gateway"
|
[ -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
|
for ns in $dns; do
|
||||||
echo "nameserver $ns" >> /tmp/resolv.conf
|
echo "nameserver $ns" >> /tmp/resolv.conf.auto
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
. /etc/functions.sh
|
. /etc/functions.sh
|
||||||
include /lib/network
|
include /lib/network
|
||||||
|
|
||||||
RESOLV_CONF="/tmp/resolv.conf"
|
RESOLV_CONF="/tmp/resolv.conf.auto"
|
||||||
|
|
||||||
hotplug_event() {
|
hotplug_event() {
|
||||||
scan_interfaces
|
scan_interfaces
|
||||||
|
@ -8,7 +8,7 @@ localise-queries
|
|||||||
local=/lan/
|
local=/lan/
|
||||||
domain=lan
|
domain=lan
|
||||||
expand-hosts
|
expand-hosts
|
||||||
resolv-file=/tmp/resolv.conf
|
resolv-file=/tmp/resolv.conf.auto
|
||||||
|
|
||||||
@ifdef dhcp_enable
|
@ifdef dhcp_enable
|
||||||
dhcp-range=@@start@@,@@end@@,@@netmask@@,@@lease@@
|
dhcp-range=@@start@@,@@end@@,@@netmask@@,@@lease@@
|
||||||
|
@ -50,7 +50,13 @@ start() {
|
|||||||
[ -z "$wan_proto" -o "$wan_proto" = "none" ] || echo "@define wan_ifname $wan_ifname"
|
[ -z "$wan_proto" -o "$wan_proto" = "none" ] || echo "@define wan_ifname $wan_ifname"
|
||||||
|
|
||||||
cat /etc/dnsmasq.conf
|
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() {
|
stop() {
|
||||||
|
@ -124,7 +124,7 @@ define Package/ppp/install
|
|||||||
$(INSTALL_BIN) ./files/etc/ppp/ip-down $(1)/etc/ppp/
|
$(INSTALL_BIN) ./files/etc/ppp/ip-down $(1)/etc/ppp/
|
||||||
$(INSTALL_DIR) $(1)/etc/ppp/ip-down.d
|
$(INSTALL_DIR) $(1)/etc/ppp/ip-down.d
|
||||||
$(INSTALL_DATA) ./files/etc/ppp/options $(1)/etc/ppp/
|
$(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
|
endef
|
||||||
|
|
||||||
define Package/ppp-mod-pppoa/install
|
define Package/ppp-mod-pppoa/install
|
||||||
|
@ -25,7 +25,7 @@ start_pppd() {
|
|||||||
[ "$interval" != "$keepalive" ] || interval=5
|
[ "$interval" != "$keepalive" ] || interval=5
|
||||||
|
|
||||||
config_get demand "$cfg" demand
|
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 "$@" \
|
/usr/sbin/pppd "$@" \
|
||||||
${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}} \
|
${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}} \
|
||||||
${demand:+precompiled-active-filter /etc/ppp/filter demand idle }${demand:-persist} \
|
${demand:+precompiled-active-filter /etc/ppp/filter demand idle }${demand:-persist} \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user