fai trick: fix weird hostname

Holger Schurig hs4233 at mail.mn-solutions.de
Mon Jan 24 12:59:49 CET 2005


> In fai 2.6.6 you can set the hostname by appending following parameter
> to the kernel:
>
> HOST=demohost
>
> This will also set the hostname. For example. the fai CD contains
> following boot entry for grub:

I tried that first, but it did not work. The code line 
in /usr/lib/fai/sbin/rcS_fai reads:

-----------------
 if [ $HOSTNAME = '(none)' -a -n "$HOST" ]; then
-----------------

and therefore HOST= on the kernel command line only works if HOSTNAME had 
the previous value '(none)'. But in my setup this is not true, the DHCP 
client set it to something numeric:


# cd /tmp/fai
# grep 172.16.1.145 *
------------------
boot.log:IPADDR='172.16.1.145'
dhclient.log:bount to 172.16.1.145 -- renewal in 3600 seconds.
dmesg.log: <omitted>
variables.sh: HOSTNAME='172.16.1.145'
variables.sh: IPADDR='172.16.1.145'
variables.sh: sndhostname='172.16.1.145'
------------------


I'm using ISC DHCP Client V3.0.1.



More information about the linux-fai mailing list