From ac134a9f5c0342bc0eb332b6e06494d348fb5ef1 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Sun, 26 Dec 2010 01:31:46 +0100 Subject: [PATCH] Merge dhcphostname support into 23networking-grml 11_dhcphostname.dpatch patched 23networking, which we didn't ship at all. --- debian/patches/11_dhcphostname.dpatch | 22 ---------------------- debian/patches/15_networking_grml.dpatch | 10 ++++++++-- 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/debian/patches/11_dhcphostname.dpatch b/debian/patches/11_dhcphostname.dpatch index 69b9d69..162aa56 100755 --- a/debian/patches/11_dhcphostname.dpatch +++ b/debian/patches/11_dhcphostname.dpatch @@ -13,28 +13,6 @@ This patch takes care of the netboot case. diff --git a/scripts/live-bottom/23networking b/scripts/live-bottom/23networking index 9554b77..9270e9c 100755 ---- a/scripts/live-bottom/23networking -+++ b/scripts/live-bottom/23networking -@@ -135,6 +135,19 @@ ${rc_server1} - EOF - - cat /root/etc/resolv.conf >> /root/var/log/netboot.config -+ -+ if [ -z "$NODHCPHOSTNAME" ] -+ then -+ dhcp_address=$(cat netboot.config | awk '/address:/{print $2}') -+ dhcp_hostname=$(busybox nslookup ${dhcp_address} ${rc_server0#nameserver }| awk \ -+ '/Address 1: '${dhcp_address}'/{ print $4 }') -+ -+ if [ -n "$dhcp_hostname" ] -+ then -+ echo $dhcp_hostname > /root/etc/hostname -+ fi -+ unset dhcp_address dhcp_hostname dhcp_hostname -+ fi - fi - fi - fi --- a/scripts/live +++ b/scripts/live @@ -216,6 +216,11 @@ Arguments () diff --git a/debian/patches/15_networking_grml.dpatch b/debian/patches/15_networking_grml.dpatch index 99db73f..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,102 @@ +@@ -0,0 +1,107 @@ +#!/bin/sh + +#set -e @@ -69,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 @@ -107,10 +109,14 @@ diff a/scripts/live-bottom/23networking_grml b/scripts/live-bottom/23networking_ + 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 + -+ -- 2.1.4