network: add iBFT interface configuration
[forward port of 0828d4c3574693ae80c217229e1bba6948dc9509]master
parent
10b5dca0f7
commit
38ba0d7a62
|
@ -386,7 +386,7 @@ This parameter can be specified multiple times.</para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>
|
||||||
<envar>ip=</envar><replaceable>{dhcp|on|any|dhcp6|auto6}</replaceable>
|
<envar>ip=</envar><replaceable>{dhcp|on|any|dhcp6|auto6|ibft}</replaceable>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>dhcp|on|any: get ip from dhcp server from all interfaces. If root=dhcp,
|
<para>dhcp|on|any: get ip from dhcp server from all interfaces. If root=dhcp,
|
||||||
|
@ -394,6 +394,7 @@ loop sequentially through all interfaces (eth0, eth1, ...) and use the first
|
||||||
with a valid DHCP root-path.</para>
|
with a valid DHCP root-path.</para>
|
||||||
<para><constant>auto6</constant>: IPv6 autoconfiguration</para>
|
<para><constant>auto6</constant>: IPv6 autoconfiguration</para>
|
||||||
<para><constant>dhcp6</constant>: IPv6 DHCP</para>
|
<para><constant>dhcp6</constant>: IPv6 DHCP</para>
|
||||||
|
<para><constant>ibft</constant>: iBFT autoconfiguration</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
|
@ -207,6 +207,8 @@ fi
|
||||||
# looking for ip= lines
|
# looking for ip= lines
|
||||||
for p in $(getargs ip=); do
|
for p in $(getargs ip=); do
|
||||||
ip_to_var $p
|
ip_to_var $p
|
||||||
|
# skip ibft
|
||||||
|
[ "$autoconf" = "ibft" ] && continue
|
||||||
|
|
||||||
# If this option isn't directed at our interface, skip it
|
# If this option isn't directed at our interface, skip it
|
||||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
|
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
|
||||||
|
|
|
@ -55,9 +55,9 @@ install() {
|
||||||
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
||||||
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
||||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||||
inst_hook cmdline 99 "$moddir/parse-ip-opts.sh"
|
inst_hook cmdline 96 "$moddir/parse-bond.sh"
|
||||||
inst_hook cmdline 97 "$moddir/parse-bond.sh"
|
inst_hook cmdline 97 "$moddir/parse-bridge.sh"
|
||||||
inst_hook cmdline 98 "$moddir/parse-bridge.sh"
|
inst_hook cmdline 98 "$moddir/parse-ip-opts.sh"
|
||||||
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
|
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
|
||||||
inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
|
inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
|
||||||
|
|
||||||
|
|
|
@ -51,11 +51,43 @@ if [ -n "$NEEDBOOTDEV" ] ; then
|
||||||
[ -z "$BOOTDEV" ] && die "Bootdev argument is empty"
|
[ -z "$BOOTDEV" ] && die "Bootdev argument is empty"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "ibft" = "$(getarg ip=)" ]; then
|
||||||
|
modprobe ibft
|
||||||
|
num=0
|
||||||
|
(
|
||||||
|
for iface in /sys/firmware/ibft/ethernet*; do
|
||||||
|
[ -e ${iface}/mac ] || continue
|
||||||
|
ifname_mac=$(read a < ${iface}/mac; echo $a)
|
||||||
|
[ -z "$ifname_mac" ] || continue
|
||||||
|
ifname_if=ibft$num
|
||||||
|
num=$(( $num + 1 ))
|
||||||
|
echo "ifname=$ifname_if:$ifname_mac"
|
||||||
|
dev=$ifname_if
|
||||||
|
|
||||||
|
dhcp=$(read a < ${iface}/dhcp; echo $a)
|
||||||
|
if [ -n "$dhcp" ]; then
|
||||||
|
echo "ip=$dev:dhcp"
|
||||||
|
else
|
||||||
|
ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||||
|
gw=$(read a < ${iface}/gateway; echo $a)
|
||||||
|
mask=$(read a < ${iface}/subnet-mask; echo $a)
|
||||||
|
hostname=$(read a < ${iface}/hostname; echo $a)
|
||||||
|
echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
) >> /etc/cmdline
|
||||||
|
# reread cmdline
|
||||||
|
unset CMDLINE
|
||||||
|
fi
|
||||||
|
|
||||||
# Check ip= lines
|
# Check ip= lines
|
||||||
# XXX Would be nice if we could errorcheck ip addresses here as well
|
# XXX Would be nice if we could errorcheck ip addresses here as well
|
||||||
for p in $(getargs ip=); do
|
for p in $(getargs ip=); do
|
||||||
ip_to_var $p
|
ip_to_var $p
|
||||||
|
|
||||||
|
# skip ibft
|
||||||
|
[ "$autoconf" = "ibft" ] && continue
|
||||||
|
|
||||||
# We need to have an ip= line for the specified bootdev
|
# We need to have an ip= line for the specified bootdev
|
||||||
[ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1
|
[ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue