Search
j0ke.net Open Build Service
>
Projects
>
home:jg
:
playground
>
dracut
> 0152-network-add-iBFT-interface-configuration.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0152-network-add-iBFT-interface-configuration.patch of Package dracut
From 0828d4c3574693ae80c217229e1bba6948dc9509 Mon Sep 17 00:00:00 2001 From: Harald Hoyer <harald@redhat.com> Date: Wed, 8 Dec 2010 12:25:12 +0100 Subject: [PATCH] network: add iBFT interface configuration --- dracut.8 | 9 +++++++-- modules.d/40network/ifup | 2 ++ modules.d/40network/install | 4 ++-- modules.d/40network/parse-ip-opts.sh | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/dracut.8 b/dracut.8 index 1139f75..ce39061 100644 --- a/dracut.8 +++ b/dracut.8 @@ -247,12 +247,17 @@ This parameter can be specified multiple times. .SS Network .TP -.BR ip= {dhcp|on|any|dhcp6|auto6} +.BR ip= {dhcp|on|any|dhcp6|auto6|ibft} dhcp|on|any: get ip from dhcp server from all interfaces. If root=dhcp, loop sequentially through all interfaces (eth0, eth1, ...) and use the first with a valid DHCP root-path. +.sp +\fBauto6\fR: IPv6 autoconfiguration +.sp +\fBdhcp6\fR: IPv6 DHCP +.sp +\fBibft\fR: iBFT autoconfiguration -auto6: do IPv6 autoconfiguration .TP .BR ip= <interface>:{dhcp|on|any|dhcp6|auto6} dhcp|on|any|dhcp6: get ip from dhcp server on a specific interface diff --git a/modules.d/40network/ifup b/modules.d/40network/ifup index 6ef1010..ebdaa3c 100755 --- a/modules.d/40network/ifup +++ b/modules.d/40network/ifup @@ -140,6 +140,8 @@ fi # looking for ip= lines for p in $(getargs ip=); do ip_to_var $p + # skip ibft + [ "$autoconf" = "ibft" ] && continue # If this option isn't directed at our interface, skip it [ -n "$dev" ] && [ "$dev" != "$netif" ] && continue diff --git a/modules.d/40network/install b/modules.d/40network/install index 398d4e4..abfa7a5 100755 --- a/modules.d/40network/install +++ b/modules.d/40network/install @@ -7,8 +7,8 @@ inst "$moddir/dhclient.conf" "/etc/dhclient.conf" inst_hook pre-udev 50 "$moddir/ifname-genrules.sh" inst_hook pre-udev 60 "$moddir/net-genrules.sh" inst_hook cmdline 91 "$moddir/dhcp-root.sh" -inst_hook cmdline 99 "$moddir/parse-ip-opts.sh" -inst_hook cmdline 98 "$moddir/parse-bridge.sh" +inst_hook cmdline 97 "$moddir/parse-bridge.sh" +inst_hook cmdline 98 "$moddir/parse-ip-opts.sh" inst_hook cmdline 99 "$moddir/parse-ifname.sh" inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh" diff --git a/modules.d/40network/parse-ip-opts.sh b/modules.d/40network/parse-ip-opts.sh index a3c9597..8ec94bf 100755 --- a/modules.d/40network/parse-ip-opts.sh +++ b/modules.d/40network/parse-ip-opts.sh @@ -49,11 +49,43 @@ if [ -n "$NEEDBOOTDEV" ] ; then [ -z "$BOOTDEV" ] && die "Bootdev argument is empty" 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 # XXX Would be nice if we could errorcheck ip addresses here as well for p in $(getargs ip=); do ip_to_var $p + # skip ibft + [ "$autoconf" = "ibft" ] && continue + # We need to have an ip= line for the specified bootdev [ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1 -- 1.8.3.1