Variable DOMAIN in get-boot-info ignored in case of IP as kernel parameter

steven.wend at t-online.de steven.wend at t-online.de
Mon Mar 23 12:22:44 CET 2015


Hello to all,

inside a test net I' am not using an DHCP server so all maschine have static IPs. Thats why I have set ip, gateway, dns and domain as kernel parameters.

Version is:
apt-cache policy fai-server
fai-server:
  Installed: 4.3.2

Kernel Parameters are:
[...] ip=" + hostip + "::" + standgateway + ":255.255.255.0:" + vmhostname + ":eth0:none:: root=/dev/nfs nfsroot=" + faiserver + ":/srv/fai/nfsroot/debian8 FAI_FLAGS=verbose,sshd,createvt FAI_CONFIG_SRC=nfs://" + faiserver + "/srv/fai/config/debian8 FAI_ACTION=install DNSSRVS=" + dnsserver + " DOMAIN=" + domain + " GATEWAYS=" + standgateway [...]

Everything works fine except the domain variable. The reason ist the script "get-boot-info". 

In case if a static ip the domain isn't set to $bootlog.

setnet() {

    # get network parameters
    # first get first active network device
    local dev dummy
    dev=$(ip ad show up | awk -F': ' '/^[0-9]/ && ! / lo:/ {print $2;exit}')
    if [ -z "$dev" ]; then
        sleep 3 # if interface needs some time to come up
        dev=$(ip ad show up | awk -F': ' '/^[0-9]/ && ! / lo:/ {print $2;exit}')
    fi
    read IPADDR NETMASK BROADCAST dummy<<<$(ifdata -p $dev)
    GATEWAYS=$(ip route | awk '/^default/ {print $3}')

    cat >> $bootlog <<-EOF
        netdevices_all="$netdevices_all"
        netdevices_up="$netdevices_up"
        netdevices="$netdevices"
        IPADDR=$IPADDR
        SERVER=$SERVER
        NETMASK=$NETMASK
        GATEWAYS=$GATEWAYS
        BROADCAST=$BROADCAST
EOF
}

And at the end of the script $bootlog is getting checked for "DOMAIN=" which would never be true and causes an localdomain.

if ! grep -q DOMAIN= $bootlog; then
    echo 'Warning: no domain name configured, using "localdomain"' >&2
    echo "DOMAIN=localdomain" >> $bootlog
fi

I'm not sure about this - bug or not? Or is there another reason at all not seen by me?

Cheers Steven
This can be fixed by adding DOMAIN=$DOMAIN to setnet().

----------------------------------------------------------------
Profitieren Sie von der sicheren E-Mail-Übertragung Ihrer Daten mit einer kostenlosen E-Mail-Adresse der Telekom.
www.t-online.de/email-kostenlos




More information about the linux-fai mailing list