Add a dhcphostname option to grml which will set the hostname of the booted system according to the dns information. This Patch takes care of the netboot case. diffstat dhcphostname-ts.patch scripts/live | 5 +++++ grml/23networking | 13 +++++++++++++ 2 files changed, 18 insertions(+) signed-off-by: Andreas Thienemann --- a/grml/23networking 2009-06-02 11:57:00.156614733 +0200 +++ b/grml/23networking 2009-06-02 12:00:04.623804092 +0200 @@ -140,6 +140,19 @@ ${rc_server1} EOF cat /root/etc/resolv.conf >> /root/var/log/netboot.config + + if [ -n "$DHCPHOSTNAME" ] + 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 2009-06-02 11:59:15.689528261 +0200 +++ b/scripts/live 2009-06-02 01:18:42.617514858 +0200 @@ -59,6 +59,11 @@ Arguments () export DEFCONSOLE ;; + dhcphostname) + DHCPHOSTNAME="Yes" + export DHCPHOSTNAME + ;; + debug) DEBUG="Yes" export DEBUG