From: Christian Hofstaedtler Date: Thu, 9 Dec 2010 16:22:22 +0000 (+0100) Subject: networking_grml: DNS for systems without resolvconf X-Git-Tag: v2.0.12-1+grml.02~1 X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=commitdiff_plain;h=44acfa24e0a438f2f6b3bb4132fce5dfe0c87cdb networking_grml: DNS for systems without resolvconf --- diff --git a/debian/patches/15_networking_grml.dpatch b/debian/patches/15_networking_grml.dpatch index d0f739d..99db73f 100755 --- a/debian/patches/15_networking_grml.dpatch +++ b/debian/patches/15_networking_grml.dpatch @@ -11,7 +11,7 @@ diff a/scripts/live-bottom/23networking_grml b/scripts/live-bottom/23networking_grml --- /dev/null +++ b/scripts/live-bottom/23networking_grml -@@ -0,0 +1,97 @@ +@@ -0,0 +1,102 @@ +#!/bin/sh + +#set -e @@ -56,8 +56,9 @@ diff a/scripts/live-bottom/23networking_grml b/scripts/live-bottom/23networking_ + configure_networking +fi + -+# prepare a new /etc/network/interfaces file ++# prepare a new /etc/network/interfaces file (and, possibly, a new /etc/resolv.conf) +IFFILE="/root/etc/network/interfaces" ++RESOLVCONF="/root/etc/resolv.conf" + +# config for loopback networking +cat > $IFFILE << EOF @@ -86,12 +87,13 @@ diff a/scripts/live-bottom/23networking_grml b/scripts/live-bottom/23networking_ +iface ${interface} inet ${method} +EOF + -+ # DNS for resolvconf ++ # DNS for resolvconf and /etc/resolv.conf + if [ -e "${netconfig}" ]; then + . "${netconfig}" + if [ -n "${DNSDOMAIN}" ]; then + echo " dns-search ${DNSDOMAIN}" >> $IFFILE + fi ++ # make sure we don't have any 0.0.0.0 nameservers + IPV4DNSLIST="" + for IPV4DNS in ${IPV4DNS0} ${IPV4DNS1}; do + [ -n "${IPV4DNS}" ] || continue @@ -100,6 +102,9 @@ diff a/scripts/live-bottom/23networking_grml b/scripts/live-bottom/23networking_ + done + if [ -n "${IPV4DNSLIST}" ]; then + echo " dns-nameservers ${IPV4DNSLIST}" >> $IFFILE ++ for IPV4DNS in ${IPV4DNSLIST}; do ++ echo "nameserver ${IPV4DNS}" >> $RESOLVCONF ++ done + fi + fi + unset DEVICE IPV4ADDR IPV4BROADCAST IPV4NETMASK IPV4GATEWAY IPV4DNS0 IPV4DNS1 HOSTNAME DNSDOMAIN NISDOMAIN ROOTSERVER ROOTPATH filename