set hostname from kernel cmdline

doof doofml at 9online.fr
Thu Jul 7 13:38:20 CEST 2005


Hi

I try to set hostname from kernel cmdline using dhcp.
For information, i dont have dns. dhcp give me a @ip and fai set the hostname to
@IP. (HOSTNAME=192)

It's imposible without modify fai-class.
line 134 :  HOSTNAME=$(uname -n | cut -d. -f1); export HOSTNAME

After modify fai-class, all work

my modify lines:
    CMD=`sed 's/ /\n/g' /proc/cmdline | grep HOSTNAME= | cut -d '=' -f2`
    if [ "$CMD" == "" ]
    then
        HOSTNAME=$(uname -n | cut -d. -f1)
    else
        HOSTNAME=$CMD;
    fi
    export HOSTNAME

Is-it possible to add this feature in fai ?

thanks
Fred



More information about the linux-fai mailing list