X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=debian%2Fpatches%2F15_networking_grml.dpatch;h=81b4c0dbeadcfa165a6450ca5e769a85d33d3637;hb=1662374f3cde472378e2cc112773259110c55a5a;hp=d0f739d38f8221921503f7f3ec82a502062f1a09;hpb=10cf8473cb8adbcff3589f98134b92b164217187;p=live-boot-grml.git diff --git a/debian/patches/15_networking_grml.dpatch b/debian/patches/15_networking_grml.dpatch index d0f739d..81b4c0d 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,107 @@ +#!/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 @@ -68,6 +69,8 @@ diff a/scripts/live-bottom/23networking_grml b/scripts/live-bottom/23networking_ + +EOF + ++unset HOSTNAME ++ +# generate config for each present network device +for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*; do + [ -e ${interface} ] || continue @@ -86,12 +89,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,12 +104,19 @@ 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 ++ ++ if [ -z "$NODHCPHOSTNAME" -a -n "$HOSTNAME" ]; then ++ echo $HOSTNAME > /root/etc/hostname ++ fi ++ + unset DEVICE IPV4ADDR IPV4BROADCAST IPV4NETMASK IPV4GATEWAY IPV4DNS0 IPV4DNS1 HOSTNAME DNSDOMAIN NISDOMAIN ROOTSERVER ROOTPATH filename + unset IPV4DNS IPV4DNSLIST + + echo>> $IFFILE +done + -+