Write BOOTPROTO=ibft for ip=ibft to ifcfg files

master
Radek Vykydal 2013-03-14 09:51:07 +01:00 committed by Harald Hoyer
parent c5a742a3bf
commit fd8e4aef90
2 changed files with 15 additions and 6 deletions

View File

@ -159,6 +159,7 @@ ibft_to_cmdline() {
hostname=$(read a < ${iface}/hostname; echo $a) hostname=$(read a < ${iface}/hostname; echo $a)
echo "ip=$ip::$gw:$mask:$hostname:$dev:none" echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
fi fi
echo $mac > /tmp/net.${dev}.has_ibft_config
done done
) >> /etc/cmdline.d/40-ibft.conf ) >> /etc/cmdline.d/40-ibft.conf
# reread cmdline # reread cmdline

View File

@ -106,7 +106,11 @@ for netif in $IFACES ; do
[ -n "$mtu" ] && echo "MTU=$mtu" [ -n "$mtu" ] && echo "MTU=$mtu"
if [ -f /tmp/net.$netif.lease ]; then if [ -f /tmp/net.$netif.lease ]; then
strstr "$ip" '*:*:*' && echo "IPV6INIT=yes" strstr "$ip" '*:*:*' && echo "IPV6INIT=yes"
echo "BOOTPROTO=dhcp" if [ -f /tmp/net.$netif.has_ibft_config ]; then
echo "BOOTPROTO=ibft"
else
echo "BOOTPROTO=dhcp"
fi
cp /tmp/net.$netif.lease /tmp/ifcfg-leases/dhclient-$uuid-$netif.lease cp /tmp/net.$netif.lease /tmp/ifcfg-leases/dhclient-$uuid-$netif.lease
else else
# If we've booted with static ip= lines, the override file is there # If we've booted with static ip= lines, the override file is there
@ -116,12 +120,16 @@ for netif in $IFACES ; do
echo "IPV6_AUTOCONF=no" echo "IPV6_AUTOCONF=no"
echo "IPV6ADDR=$ip/$mask" echo "IPV6ADDR=$ip/$mask"
else else
echo "BOOTPROTO=none" if [-f /tmp/net.$netif.has_ibft_config ]; then
echo "IPADDR=$ip" echo "BOOTPROTO=ibft"
if strstr "$mask" "."; then
echo "NETMASK=$mask"
else else
echo "PREFIX=$mask" echo "BOOTPROTO=none"
echo "IPADDR=$ip"
if strstr "$mask" "."; then
echo "NETMASK=$mask"
else
echo "PREFIX=$mask"
fi
fi fi
fi fi
if strstr "$gw" '*:*:*'; then if strstr "$gw" '*:*:*'; then