rpms/fcoe-utils/devel fcoe_edd.sh, NONE, 1.1 fcoe-utils-1.0.12-makefile-data-hook.patch, 1.1, 1.2 fcoe-utils-1.0.8-includes.patch, 1.2, 1.3 fcoe-utils.spec, 1.13, 1.14 sources, 1.5, 1.6

Jan Zeleny jzeleny at fedoraproject.org
Tue Mar 30 13:00:13 UTC 2010


Author: jzeleny

Update of /cvs/extras/rpms/fcoe-utils/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv528

Modified Files:
	fcoe-utils-1.0.12-makefile-data-hook.patch 
	fcoe-utils-1.0.8-includes.patch fcoe-utils.spec sources 
Added Files:
	fcoe_edd.sh 
Log Message:
some upstream updates, better fipvlan support, added fcoe_edd.sh script


--- NEW FILE fcoe_edd.sh ---
#!/bin/bash

# Script to read EDD information from sysfs and
# echo the FCoE interface name and target info.
# This is a work in progress and will be enhanced
# with more options as we progress further.
#
# Author: Supreeth Venkataraman
#	  Yi Zou
#         Intel Corporation
#
# Usage: sysfs_edd.sh -t for getting FCoE boot target information.
#        sysfs_edd.sh -i for getting FCoE boot NIC name.
#        sysfs_edd.sh -m for getting FCoE boot NIC MAC.
#        sysfs_edd.sh -e for getting FCoE boot EDD information.
#        sysfs_edd.sh -r for getting FCoE boot EDD interface type and path.
#        sysfs_edd.sh -a for getting all FCoE boot information.
#        sysfs_edd.sh -h for usage information.
#        Optional: use -v to turn on verbose mode.
#
# Notes:
# FCoE Boot Disk is identified by the following format of boot information
# in its corresponding sysfs firmware edd entry, i.e.,
# 	/sys/firmware/edd/int13_dev??/interface
# which is formatted as (for FCoE):
# string format: FIBRE wwid: 8c1342b8a0001620 lun: 7f00
# Please ref. to T13 BIOS Enhanced Disk Drive Specification v3.0 for more
# defails on EDD.
#

SYSEDD=/sys/firmware/edd
PREFIX="FIBRE"
VERBOSE=
FCOE_INF=
FCOE_WWN=
FCOE_LUN=
FCOE_EDD=
FCOE_NIC=
FCOE_MAC=


#
#
#
LOG() {
	if [ -n "$1" ] && [ -n "${VERBOSE}" ]; then
		echo "LOG:$1"
	fi
}


find_fcoe_boot_disk() {
	local prefix=

	if [ ! -e $SYSEDD ]; then
		LOG "Need kernel EDD support!"
		return 1
	fi
#	for disk in `find ${SYSEDD} -maxdepth 1 -name 'int13*'`
	for disk in ${SYSEDD}/int13_*
	do
		LOG " checking $disk..."
		if [ ! -e ${disk}/interface ]; then
			continue;
		fi
		LOG " checking ${disk}/interface..."
		prefix=`awk '{printf $1}' < ${disk}/interface`
		if [ "${PREFIX}" != "${prefix}" ]; then
			LOG " The FCoE Boot prefix ${FCOE_PRE} is invalid!"
			continue;
		fi
		FCOE_INF=`cat ${disk}/interface`
		LOG " found FCoE boot info. from boot rom:${FCOE_INF}..."

	 	FCOE_WWN=`awk '{printf $3}' < ${disk}/interface`
		if [ ${#FCOE_WWN} -ne 16 ]; then
			LOG " The FCoE Boot WWID ${FCOE_WWN} is invalid!"
			continue;
		fi
		FCOE_LUN=`awk '{printf $5}' < ${disk}/interface`
		if [ -z "${#FCOE_LUN}" ]; then
			LOG " The FCoE Boot LUN ${FCOE_WWN} is invalid!"
			continue;
		fi
		# look for the correponding nic
		# FIXME:
		# 1) only supporst PCI device? 
		# 2) at initrd time, the nic name is always eth*? 
		if [ ! -e ${disk}/pci_dev ]; then
			LOG "Failed to locate the corresponing PCI device!"
			continue;
		fi
		if [ ! -e ${disk}/pci_dev/net ]; then
			LOG "Failed to detect any NIC device!"
			continue;
		fi
		
		for nic in ${disk}/pci_dev/net/*
		do
			if [ -e ${nic}/address ]; then
				FCOE_MAC=`cat ${nic}/address`
				FCOE_NIC=$(basename ${nic})
				break;
			fi
		done
		if [ -z "${FCOE_MAC}" ] || [ -z "${FCOE_NIC}" ]; then
			LOG "Failed to locate the corresponing NIC device!"
			continue;
		fi
		# Found the FCoE Boot Device
		FCOE_EDD=$(basename ${disk})
		return 0;
	done
	return 1
}

get_fcoe_boot_all(){
	echo "### FCoE Boot Information ###"
	echo "EDD=${FCOE_EDD}"
	echo "INF=${FCOE_INF}"
	echo "WWN=${FCOE_WWN}"
	echo "LUN=${FCOE_LUN}"
	echo "NIC=${FCOE_NIC}"
	echo "MAC=${FCOE_MAC}"
	return 0
}

get_fcoe_boot_target() {
	if [ -z "${FCOE_WWN}" ] || [ -z "${FCOE_LUN}" ]; then
		LOG "No FCoE Boot Target information is found!"
		return 1
	fi
	echo "WWN=${FCOE_WWN}"
	echo "LUN=${FCOE_LUN}"
}

get_fcoe_boot_inf(){
	if [ -z "${FCOE_INF}" ]; then
		LOG "No FCoE Boot INF information is found!"
		return 1
	fi
	echo "INF=${FCOE_INF}"
	return 0
}

get_fcoe_boot_mac(){
	if [ -z "${FCOE_MAC}" ]; then
		LOG "No FCoE Boot NIC MAC information is found!"
		return 1
	fi
	echo "MAC=${FCOE_MAC}"
	return 0
}

get_fcoe_boot_ifname(){
	if [ -z "${FCOE_NIC}" ]; then
		LOG "No FCoE Boot NIC information is found!"
		return 1
	fi
	echo "NIC=${FCOE_NIC}"
	return 0
}

get_fcoe_boot_edd(){
	if [ -z "${FCOE_EDD}" ]; then
		LOG "No FCoE Boot Disk EDD information is found!"
		return 1
	fi
	echo "EDD=${FCOE_EDD}"
	return 0
}


# parse options
prog=$(basename $0)
while getopts "timeravh" OptionName; do
    case "$OptionName" in
        t) 
		action=get_fcoe_boot_target
		;;
        i)
		action=get_fcoe_boot_ifname
		;;
        m)
		action=get_fcoe_boot_mac
		;;
        e)
		action=get_fcoe_boot_edd
		;;
        r)
		action=get_fcoe_boot_inf
		;;
	a)
		action=get_fcoe_boot_all
		;;
	v)
		VERBOSE="yes"
		;;
        h)
		echo "Usage: ${prog} -t for getting FCoE boot target information."
		echo "       ${prog} -i for getting FCoE boot NIC name."
		echo "       ${prog} -m for getting FCoE boot NIC MAC."
		echo "       ${prog} -e for getting FCoE boot EDD information."
		echo "       ${prog} -r for getting FCoE boot EDD interface type and path."
		echo "       ${prog} -a for getting all FCoE boot information."
		echo "       ${prog} -h for usage information."
		echo "       Optional: use -v to turn on verbose mode."
		exit 0
		;;
        *)
		echo "Invalid Option. Use -h option for help."
		exit 1
		;;
    esac
done
if [ -z "${action}" ]; then
	echo "Must specify at least -t, -i, -m, -e, -r, -a, or -h."
	echo "Use -h option for help."
	exit 1
fi
# Locate FCoE boot disk and nic information
find_fcoe_boot_disk
if [ $? -ne 0 ]; then
	echo "No FCoE boot disk information is found in EDD!"
	exit 1
fi
if [ -z "${FCOE_EDD}" ]; then
	echo "No FCoE boot disk is found in EDD!"
	exit 1;
fi

${action}

exit $?

fcoe-utils-1.0.12-makefile-data-hook.patch:
 Makefile.am |    5 -----
 1 file changed, 5 deletions(-)

Index: fcoe-utils-1.0.12-makefile-data-hook.patch
===================================================================
RCS file: /cvs/extras/rpms/fcoe-utils/devel/fcoe-utils-1.0.12-makefile-data-hook.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- fcoe-utils-1.0.12-makefile-data-hook.patch	16 Mar 2010 08:52:46 -0000	1.1
+++ fcoe-utils-1.0.12-makefile-data-hook.patch	30 Mar 2010 13:00:11 -0000	1.2
@@ -1,11 +1,11 @@
 --- fcoe-utils-1.0.12/Makefile.am.orig	2010-03-15 17:02:19.000000000 +0100
 +++ fcoe-utils-1.0.12/Makefile.am	2010-03-15 17:02:34.000000000 +0100
-@@ -69,8 +69,3 @@
+@@ -62,8 +62,3 @@
  init_d_SCRIPTS = etc/initd/fcoe
  
- dist_noinst_DATA = README COPYING INSTALL fcoe-utils.spec
+ dist_noinst_DATA = README COPYING INSTALL fcoe-utils.spec etc/config
 -
 -install-data-hook:
--	if [ ! -f ${fcoe_configdir}/config ] ; then \
--		cp etc/config ${fcoe_configdir}/config; \
+-	if [ ! -f ${DESTDIR}${fcoe_configdir}/config ] ; then \
+-		cp ${srcdir}/etc/config ${DESTDIR}${fcoe_configdir}/config; \
 -	fi

fcoe-utils-1.0.8-includes.patch:
 Makefile.am |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: fcoe-utils-1.0.8-includes.patch
===================================================================
RCS file: /cvs/extras/rpms/fcoe-utils/devel/fcoe-utils-1.0.8-includes.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- fcoe-utils-1.0.8-includes.patch	4 Dec 2009 08:53:05 -0000	1.2
+++ fcoe-utils-1.0.8-includes.patch	30 Mar 2010 13:00:12 -0000	1.3
@@ -1,11 +1,11 @@
 --- fcoe-utils-1.0.8/Makefile.am.orig	2009-07-31 13:28:11.484799253 +0200
 +++ fcoe-utils-1.0.8/Makefile.am	2009-07-31 13:28:38.331800646 +0200
 @@ -5,7 +5,7 @@
- endif
+ sbin_PROGRAMS = fcoeadm fcoemon fcping fipvlan fcnsq fcrls
  
  ## all targets should look for headers in the include directory
--AM_CPPFLAGS = -Wall -I${srcdir}/include
-+AM_CPPFLAGS = -Wall -I${srcdir}/include -I/lib/modules/`rpm -q --list kernel | grep "^/lib/modules/.*/build$$" | cut -f4 -d"/" | sort -r | head -1`/build/include
- 
+-AM_CPPFLAGS = -I${srcdir}/include -I${builddir}/include
++AM_CPPFLAGS = -I${srcdir}/include -I${builddir}/include -I/lib/modules/`rpm -q --list kernel | grep "^/lib/modules/.*/build$$" | cut -f4 -d"/" | sort -r | head -1`/build/include
  ## pass the sysconfdir into the C proprocessor
- AM_CFLAGS = -DSYSCONFDIR="\"${sysconfdir}\""
+ AM_CPPFLAGS += -DSYSCONFDIR="\"${sysconfdir}\""
+ AM_CFLAGS = -Wall


Index: fcoe-utils.spec
===================================================================
RCS file: /cvs/extras/rpms/fcoe-utils/devel/fcoe-utils.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- fcoe-utils.spec	17 Mar 2010 12:59:55 -0000	1.13
+++ fcoe-utils.spec	30 Mar 2010 13:00:12 -0000	1.14
@@ -1,6 +1,6 @@
 Name:           fcoe-utils
 Version:        1.0.12
-Release:        1%{?dist}
+Release:        2.20100323git%{?dist}
 Summary:        Fibre Channel over Ethernet utilities
 
 Group:          Applications/System
@@ -13,6 +13,7 @@ URL:            http://www.open-fcoe.org
 # cd .. && gzip fcoe-utils-%{version}
 Source0:        %{name}-%{version}.tar.gz
 Source1:        quickstart.txt
+Source2:        fcoe_edd.sh
 Patch0:         fcoe-utils-1.0.7-init.patch
 Patch1:         fcoe-utils-1.0.7-init-condrestart.patch
 Patch2:         fcoe-utils-1.0.8-includes.patch
@@ -55,6 +56,8 @@ rm -rf $RPM_BUILD_ROOT/etc/init.d
 install -m 644 %SOURCE1 quickstart.txt
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/fcoe/
 cp etc/config $RPM_BUILD_ROOT%{_sysconfdir}/fcoe/config
+mkdir -p $RPM_BUILD_ROOT%{_libexecdir}/fcoe
+install -m 755 %SOURCE2 $RPM_BUILD_ROOT%{_libexecdir}/fcoe/fcoe_edd.sh
 
 
 %clean
@@ -98,9 +101,15 @@ fi
 %config(noreplace) %{_sysconfdir}/fcoe/config
 %config(noreplace) %{_sysconfdir}/fcoe/cfg-ethx
 %{_initrddir}/fcoe
+%attr(0755,root,root) %{_libexecdir}/fcoe/fcoe_edd.sh
 
 
 %changelog
+* Tue Mar 30 2010 Jan Zeleny <jzeleny at redhat.com> - 1.0.12-2.20100323git
+- some upstream updates
+- better fipvlan support
+- added fcoe_edd.sh script
+
 * Tue Mar 16 2010 Jan Zeleny <jzeleny at redhat.com> - 1.0.12-1
 - rebased to version 1.0.12, improved functionality with lldpad
   and dcbd


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/fcoe-utils/devel/sources,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- sources	16 Mar 2010 08:52:46 -0000	1.5
+++ sources	30 Mar 2010 13:00:13 -0000	1.6
@@ -1 +1 @@
-bd64197b18f9d743120846c03b66dcf5  fcoe-utils-1.0.12.tar.gz
+a1a195ff5178175c84ebe6e3a9e97e7b  fcoe-utils-1.0.12.tar.gz



More information about the scm-commits mailing list