If fcoe service finds a valid fcoe boot interface then specify this
to fcoemon to avoid destroying this interface from fcoeadm.

This required fcoe edd script sysfs_edd.sh to be installed so that fcoe
service can use it to locate fcoe boot interface.

Script sysfs_edd.sh needs more meaningful name such as "fcoe-edd.sh" but
for now skipping name change since this script is already used by distros
and any such change would need coordination with them first.

Signed-off-by: Vasu Dev <[email protected]>
---

 Makefile.am            |    7 ++++++-
 etc/initd/initd.fedora |    5 +++++
 etc/initd/initd.suse   |    5 +++++
 3 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 8453c0c..926c6ce 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,6 +46,10 @@ dist_fcoe_config_DATA = etc/cfg-ethx
 ## man pages for fcoeadm and fcoemon
 dist_man_MANS = doc/fcoeadm.8 doc/fcoemon.8
 
+## install fcoe edd script $(prefix)/sbin
+sbin_SCRIPTS = contrib/sysfs_edd.sh
+
+
 ## init script for fcoemon
 dist_noinst_SCRIPTS = etc/initd/initd.suse etc/initd/initd.fedora
 
@@ -61,7 +65,8 @@ etc/initd/fcoe:
 init_ddir = ${sysconfdir}/init.d
 init_d_SCRIPTS = etc/initd/fcoe
 
-dist_noinst_DATA = README COPYING INSTALL fcoe-utils.spec etc/config
+dist_noinst_DATA = README COPYING INSTALL fcoe-utils.spec etc/config \
+       contrib/sysfs_edd.sh
 
 install-data-hook:
        if [ ! -f ${DESTDIR}${fcoe_configdir}/config ] ; then \
diff --git a/etc/initd/initd.fedora b/etc/initd/initd.fedora
index ef62bdd..847016f 100755
--- a/etc/initd/initd.fedora
+++ b/etc/initd/initd.fedora
@@ -40,6 +40,11 @@ if [ "$USE_SYSLOG" = "yes" ] || [ "$USE_SYSLOG" = "YES" ]; 
then
     FCOEMON_OPTS+=" --syslog"
 fi
 
+rootif=`sysfs_edd.sh -i`
+if [ $? -eq 0 ] ; then
+       FCOEMON_OPTS+=" --rootif `echo $rootif | sed -e 's/.*=//'`"
+fi
+
 if [ "$DEBUG" = "yes" ] || [ "$DEBUG" = "YES" ]; then
     FCOEMON_OPTS+=" --debug"
 fi
diff --git a/etc/initd/initd.suse b/etc/initd/initd.suse
index 659b3ad..b8385cc 100755
--- a/etc/initd/initd.suse
+++ b/etc/initd/initd.suse
@@ -56,6 +56,11 @@ if [ "$USE_SYSLOG" = "yes" ] || [ "$USE_SYSLOG" = "YES" ]; 
then
     FCOEMON_OPTS+=" --syslog"
 fi
 
+rootif=`sysfs_edd.sh -i`
+if [ $? -eq 0 ] ; then
+       FCOEMON_OPTS+=" --rootif `echo $rootif | sed -e 's/.*=//'`"
+fi
+
 if [ "$DEBUG" = "yes" ] || [ "$DEBUG" = "YES" ]; then
        FCOEMON_OPTS+=" --debug"
 fi

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to