Hello community, here is the log from the commit of package yast2-fcoe-client for openSUSE:Factory checked in at Wed Jul 20 09:17:14 CEST 2011.
-------- --- yast2-fcoe-client/yast2-fcoe-client.changes 2011-06-16 12:22:28.000000000 +0200 +++ /mounts/work_src_done/STABLE/yast2-fcoe-client/yast2-fcoe-client.changes 2011-07-19 14:10:11.000000000 +0200 @@ -1,0 +2,6 @@ +Tue Jul 19 14:08:23 CEST 2011 - [email protected] + +- AutoYaST support added +- V 2.21.4 + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- yast2-fcoe-client-2.21.3.tar.bz2 New: ---- yast2-fcoe-client-2.21.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-fcoe-client.spec ++++++ --- /var/tmp/diff_new_pack.ctQ2uQ/_old 2011-07-20 09:16:11.000000000 +0200 +++ /var/tmp/diff_new_pack.ctQ2uQ/_new 2011-07-20 09:16:11.000000000 +0200 @@ -19,12 +19,12 @@ Name: yast2-fcoe-client -Version: 2.21.3 +Version: 2.21.4 Release: 1 License: GPL Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-fcoe-client-2.21.3.tar.bz2 +Source0: yast2-fcoe-client-2.21.4.tar.bz2 Prefix: /usr @@ -40,7 +40,7 @@ Ethernet (FCoE) configuration. %prep -%setup -n yast2-fcoe-client-2.21.3 +%setup -n yast2-fcoe-client-2.21.4 %build %{prefix}/bin/y2tool y2autoconf ++++++ yast2-fcoe-client-2.21.3.tar.bz2 -> yast2-fcoe-client-2.21.4.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-2.21.3/VERSION new/yast2-fcoe-client-2.21.4/VERSION --- old/yast2-fcoe-client-2.21.3/VERSION 2011-06-16 12:20:35.000000000 +0200 +++ new/yast2-fcoe-client-2.21.4/VERSION 2011-07-19 14:08:12.000000000 +0200 @@ -1 +1 @@ -2.21.3 +2.21.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-2.21.3/agents/fcoe_cfg-ethx.scr new/yast2-fcoe-client-2.21.4/agents/fcoe_cfg-ethx.scr --- old/yast2-fcoe-client-2.21.3/agents/fcoe_cfg-ethx.scr 2011-04-19 13:21:24.000000000 +0200 +++ new/yast2-fcoe-client-2.21.4/agents/fcoe_cfg-ethx.scr 1970-01-01 01:00:00.000000000 +0100 @@ -1,29 +0,0 @@ -/** - * File: - * fcoe_cfg-ethx.scr - * Summary: - * SCR Agent for reading/writing /etc/fcoe/cfg-ethx - * using the ini-agent - * Access: - * read/write - * Authors: - * Gabriele Mohr <[email protected]> - * See: - * yast2-agent-ini/ini.html - * libscr - * Example: - * Read(.fcoe.cfg-ethx.FCOE_ENABLE) - * ("yes") - ** - * Write(.fcoe.cfg-ethx.FCOE_ENABLE, "no") - * (true) - * - * - * Read/Sets the values defined in <tt>/etc/fcoe/cfg-ethx</tt> - * in an easy manner. - */ -.fcoe.cfg-ethx - -`ag_ini( - `SysConfigFile("/etc/fcoe/cfg-ethx") -) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-2.21.3/configure new/yast2-fcoe-client-2.21.4/configure --- old/yast2-fcoe-client-2.21.3/configure 2011-06-16 12:22:03.000000000 +0200 +++ new/yast2-fcoe-client-2.21.4/configure 2011-07-19 14:09:23.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for yast2-fcoe-client 2.21.3. +# Generated by GNU Autoconf 2.68 for yast2-fcoe-client 2.21.4. # # Report bugs to <http://bugs.opensuse.org/>. # @@ -559,8 +559,8 @@ # Identity of this package. PACKAGE_NAME='yast2-fcoe-client' PACKAGE_TARNAME='yast2-fcoe-client' -PACKAGE_VERSION='2.21.3' -PACKAGE_STRING='yast2-fcoe-client 2.21.3' +PACKAGE_VERSION='2.21.4' +PACKAGE_STRING='yast2-fcoe-client 2.21.4' PACKAGE_BUGREPORT='http://bugs.opensuse.org/' PACKAGE_URL='' @@ -1229,7 +1229,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures yast2-fcoe-client 2.21.3 to adapt to many kinds of systems. +\`configure' configures yast2-fcoe-client 2.21.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1301,7 +1301,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of yast2-fcoe-client 2.21.3:";; + short | recursive ) echo "Configuration of yast2-fcoe-client 2.21.4:";; esac cat <<\_ACEOF @@ -1381,7 +1381,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -yast2-fcoe-client configure 2.21.3 +yast2-fcoe-client configure 2.21.4 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1398,7 +1398,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by yast2-fcoe-client $as_me 2.21.3, which was +It was created by yast2-fcoe-client $as_me 2.21.4, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2328,7 +2328,7 @@ # Define the identity of the package. PACKAGE='yast2-fcoe-client' - VERSION='2.21.3' + VERSION='2.21.4' cat >>confdefs.h <<_ACEOF @@ -2450,7 +2450,7 @@ -VERSION="2.21.3" +VERSION="2.21.4" RPMNAME="yast2-fcoe-client" MAINTAINER="Gabriele Mohr <[email protected]>" @@ -3380,7 +3380,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by yast2-fcoe-client $as_me 2.21.3, which was +This file was extended by yast2-fcoe-client $as_me 2.21.4, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -3433,7 +3433,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -yast2-fcoe-client config.status 2.21.3 +yast2-fcoe-client config.status 2.21.4 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-2.21.3/configure.in new/yast2-fcoe-client-2.21.4/configure.in --- old/yast2-fcoe-client-2.21.3/configure.in 2011-06-16 12:22:01.000000000 +0200 +++ new/yast2-fcoe-client-2.21.4/configure.in 2011-07-19 14:09:21.000000000 +0200 @@ -3,7 +3,7 @@ dnl -- This file is generated by y2autoconf 2.18.11 - DO NOT EDIT! -- dnl (edit configure.in.in instead) -AC_INIT(yast2-fcoe-client, 2.21.3, http://bugs.opensuse.org/, yast2-fcoe-client) +AC_INIT(yast2-fcoe-client, 2.21.4, http://bugs.opensuse.org/, yast2-fcoe-client) dnl Check for presence of file 'RPMNAME' AC_CONFIG_SRCDIR([RPMNAME]) @@ -18,7 +18,7 @@ AM_INIT_AUTOMAKE(tar-ustar -Wno-portability) dnl Important YaST2 variables -VERSION="2.21.3" +VERSION="2.21.4" RPMNAME="yast2-fcoe-client" MAINTAINER="Gabriele Mohr <[email protected]>" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-2.21.3/src/FcoeClient.ycp new/yast2-fcoe-client-2.21.4/src/FcoeClient.ycp --- old/yast2-fcoe-client-2.21.3/src/FcoeClient.ycp 2011-06-16 11:50:07.000000000 +0200 +++ new/yast2-fcoe-client-2.21.4/src/FcoeClient.ycp 2011-07-19 14:05:25.000000000 +0200 @@ -43,6 +43,7 @@ import "Package"; import "Popup"; import "Service"; +import "NetworkService"; /** * Prototypes @@ -207,8 +208,8 @@ } // map containing information about start of services at boot -map <string, boolean> service_start = $[ "fcoe":false, - "lldpad":false ]; +map <string, boolean> service_start = $[ "fcoe":true, + "lldpad":true ]; // map containing information about networks cards and VLAN, FCoE and DCB status list <map> network_interfaces = []; @@ -231,6 +232,11 @@ network_interfaces[row] = card; } +global void SetNetworkCards( list<map> netcards ) +{ + network_interfaces = netcards; +} + // Reset list of detected cards global void ResetNetworkCards() { @@ -322,7 +328,7 @@ { string vlan_device_name = ""; - string command = sformat( "sed -n 's/\\([^ ]*\\) |.*%1*.*%2/\\1/p' /proc/net/vlan/config", + string command = sformat( "sed -n 's/\\([^ ]*\\) *.*%1*.*%2/\\1/p' /proc/net/vlan/config", vlan_interface, interface ); y2milestone( "Executing command: %1", command ); @@ -355,7 +361,7 @@ if ( content == "" || content == nil ) { - y2milestone( "Cannot read cfg-file creating %1 with default values from /etc/fcoe/cfg-ethx", + y2milestone( "Cannot read cfg-file - creating %1 with default values from /etc/fcoe/cfg-ethx", file_name ); string def_values = (string)SCR::Read( .target.string, "/etc/fcoe/cfg-ethx" ); @@ -364,10 +370,19 @@ boolean ret = SCR::Write( .target.string, file_name, def_values ); if ( ret == true ) { - status_map = add( status_map, "FCOE_ENABLE", "yes"); - status_map = add( status_map, "DCB_REQUIRED", "yes"); + list <string> lines = splitstring( def_values, "\n" ); + foreach( string line, (list<string>)lines, { + if ( regexpmatch( line, "^FCOE_ENABLE" ) ) + { + status_map = add( status_map, "FCOE_ENABLE", deletechars( substring(line, 12), "\"") ); + } + if ( regexpmatch( line, "^DCB_REQUIRED" ) ) + { + status_map = add( status_map, "DCB_REQUIRED", deletechars( substring( line, 13 ),"\"") ); + } + }); status_map = add( status_map, "Filename", file_name ); - status_map = add( status_map, "Created", "yes" ); + AddRevertCommand( sformat( "rm %1", file_name ) ); } else { @@ -386,7 +401,6 @@ } list <string> lines = splitstring( content, "\n" ); - foreach( string line, (list<string>)lines, { if ( regexpmatch( line, "^FCOE_ENABLE" ) ) { @@ -470,7 +484,7 @@ global void SetStartStatus( string service, boolean status ) { - y2milestone( "Setting status of %1 to %2", service, status ); + y2milestone( "Starting service %1 on boot: %2", service, status ); service_start[ service ] = status; } @@ -500,9 +514,8 @@ // global boolean ServiceStatus() { - // TODO - check whether loading any modules in Stage::initial() is required - // (like in IsciClientLib.ycp, line 523 ) - // probably NOT -> see /etc/init.d/fcoe, line 85 (modprobe fcoe > /dev/null 2>&1) + // Loading of modules in Stage::initial() is not required (like in IsciClientLib.ycp, line 523 ) + // see /etc/init.d/fcoe, line 85 (modprobe fcoe > /dev/null 2>&1) boolean ret = true; if ( Service::Status( "fcoe" ) != 0 ) @@ -550,8 +563,8 @@ } // -// dev_name device fcoe_vlan fcoe_enable dcb_required dcb_capable vlan_interface modified cfg_file -// eth3 Ethernet card ... eth3.200 yes/no yes/no yes/no 200 yes/no /etc/fcoe/cfg-eth3.200 +// dev_name device fcoe_vlan fcoe_enable dcb_required dcb_capable vlan_interface cfg_file +// eth3 Ethernet card ... eth3.200 yes/no yes/no yes/no 200 /etc/fcoe/cfg-eth3.200 // // Detect network interface cards (hardware probe) and get status // @@ -571,14 +584,15 @@ map info_map = $[]; map <string, string> status_map = $[]; + // It's not possible to distinguish between no cable attached + // and interface not up in 'link' map got from .probe.network + // (according to snwint), so we have to check every interface. + // This may take a while! vlan_interface = GetVlanInterface( card["dev_name"]:"" ); if ( vlan_interface == "" ) { - // FCoE isn't enabled on the switch - we can't do anything here - // TODO - check link map from .probe.network and distinguish between - // no cable attached and interface not up, Steffen: cannot be used, "no" - // can stand for 'no cable connected' or 'interface not up' + // FCoE isn't enabled on the switch - we can't do anything here. fcoe_vlan_interface = NOT_AVAILABLE; } else @@ -604,7 +618,6 @@ info_map = add( info_map, "dcb_required", status_map["DCB_REQUIRED"]:""); // DCB_REQUIRED info_map = add( info_map, "dcb_capable", dcb_capable ); // DCB capable info_map = add( info_map, "vlan_interface", vlan_interface ); // VLAN interface, e.g. 200 - info_map = add( info_map, "modified", status_map["Created"]:"no" ); // data not modified info_map = add( info_map, "cfg_file", status_map["Filename"]:"" ); // cfg file name, e.g. /etc/fcoe/cfg-eth3.200 network_interfaces = add( network_interfaces, info_map ); @@ -633,6 +646,8 @@ string syslog_val = (string)SCR::Read(add(.fcoe, "USE_SYSLOG")); fcoe_general_config = add( fcoe_general_config, "USE_SYSLOG", syslog_val ); + y2milestone( "/etc/fcoe/config read - DEBUG: %1, USE_SYSLOG: %2", debug_val, syslog_val ); + return true; } @@ -664,12 +679,14 @@ { list <map> netcards = GetNetworkCards(); boolean success = true; + y2milestone( "Writing /etc/fcoe/cfg-ethx files" ); foreach ( map card, (list<map>)netcards, { - if ( card["modified"]:"no" == "yes" ) // data modified + if ( card["fcoe_vlan"]:"" != FcoeClient::NOT_AVAILABLE && // FCoE VLAN is configured + card["fcoe_vlan"]:"" != FcoeClient::NOT_CONFIGURED && Modified() ) // and data are modified { string content = (string)SCR::Read( .target.string, card["cfg_file"]:"" ); - y2milestone( "Original content: %1", content ); + y2debug( "Original content of %1: %2", card["cfg_file"]:"", content ); list <string> lines = (list<string>)splitstring( content, "\n" ); lines = maplist( string line, lines, { @@ -687,7 +704,7 @@ } }); content = mergestring( lines, "\n" ); - y2milestone( "Modified content: %1", content ); + y2milestone( "Writing content: %1", content ); boolean ret = SCR::Write( .target.string, card["cfg_file"]:"", content ); if ( !ret ) @@ -757,8 +774,8 @@ "" ); - // TODO - is this check needed here (like in IsciClient.ycp) - // if(!NetworkService::RunningNetworkPopup()) return false; + // check if network services are running + if(!NetworkService::RunningNetworkPopup()) return false; if(PollAbort()) return false; Progress::NextStage(); @@ -848,12 +865,13 @@ ], "" ); - // TODO things to do in case of Mode::autoinst()/autoupgrade() ??? - // see IscsiClient.ycp, line 236, 241 - // TODO is_running - used or obsolete ??? + // iscsi-client prepares for AutoYaST in Mode::autoinst()/autoupgrade() + // (see IscsiClient.ycp, line 236, 241) + // These things are done in fcoe-client_auto.ycp (should be sufficient there) + boolean is_running = Progress::IsRunning(); - y2milestone( "**** Progress still running: %1", is_running ); + y2debug( "**** Progress still running: %1", is_running ); // write settings if(PollAbort()) return false; @@ -884,7 +902,8 @@ // adjust start status of services lldpad and fcoe AdjustStartStatus(); - // TODO - add additional package ??? like in IscsiClient.ycp, line 257 + // Adding additional package (like in IscsiClient.ycp, line 257) + // is done in inst_fcoe-client.ycp (PackagesProposal::AddResolvables) sleep(sl); if(PollAbort()) return false; @@ -900,7 +919,14 @@ */ global boolean Import (map settings) { - // TODO FIXME: your code here (fill the above mentioned variables)... + // fill variables + fcoe_general_config = (map <string, string>)settings["fcoe_cfg"]:$[ ]; + network_interfaces = (list <map>)settings["interfaces"]:[]; + service_start = (map <string, boolean>)settings["service_start"]:$[ ]; + + SetModified( true ); + y2milestone ("Configuration has been imported"); + return true; } @@ -911,8 +937,12 @@ */ global map Export () { - // TODO FIXME: your code here (return the above mentioned variables)... - return $[]; + // return map containing current settings + return $[ + "fcoe_cfg" : fcoe_general_config, + "interfaces" : network_interfaces, + "service_start" : service_start + ]; } /** @@ -921,9 +951,36 @@ */ global list Summary() { - // TODO FIXME: your code here... + string summary = ""; + map fcoe_config = $[]; + list <map> netcards = []; + map service_start = $[]; + /* Configuration summary text for autoyast */ - return [ _("Configuration summary..."), [] ]; + summary = Summary::AddLine( summary, _("<b>General FCoE configuration</b>") ); + fcoe_config = FcoeClient::GetFcoeConfig(); + // options from config file, not meant for translation + summary = Summary::AddLine( summary, sformat( "DEBUG: %1", fcoe_config["DEBUG"]:"" ) ); + summary = Summary::AddLine( summary, sformat( "USE_SYSLOG: %1", fcoe_config["USE_SYSLOG"]:"" ) ); + summary = Summary::AddLine( summary, _("<b>Interfaces</b>") ); + netcards = FcoeClient::GetNetworkCards(); + foreach ( map card, netcards, { + summary = Summary::AddLine( summary, sformat( "%1: %2 %3: %4", + // network card, e.g. eth0 + _("<i>Netcard</i>:"), card["dev_name"]:"", + // nothing to translate here (abbreviation for + // Fibre Channel over Ethernet Virtual LAN interface) + "<i>FCoE VLAN</i>", card["fcoe_vlan"]:"" ) ); + } ); + service_start = FcoeClient::GetStartStatus(); + summary = Summary::AddLine( summary, _("<b>Starting of services</b>") ); + + // starting of service "fcoe" at boot time is enabled or disabled + summary = Summary::AddLine( summary, sformat( "fcoe: %1", (service_start["fcoe"]:false)?_("enabled"):_("disabled") )); + // starting of service "lldpad" at boot time is enabled or disabled + summary = Summary::AddLine( summary, sformat( "lldpad: %1", (service_start["lldpad"]:false)?_("enabled"):_("disabled") ) ); + + return [ summary, [] ]; } /** @@ -943,8 +1000,8 @@ */ global map AutoPackages() { - // TODO FIXME: your code here... - return $[ "install":[], "remove":[] ]; + // installation of open-fcoe required + return $[ "install":["open-fcoe"], "remove":[] ]; } /* EOF */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-2.21.3/src/complex.ycp new/yast2-fcoe-client-2.21.4/src/complex.ycp --- old/yast2-fcoe-client-2.21.3/src/complex.ycp 2011-06-16 11:50:38.000000000 +0200 +++ new/yast2-fcoe-client-2.21.4/src/complex.ycp 2011-07-19 14:05:25.000000000 +0200 @@ -332,13 +332,13 @@ else { command = sformat( "fipvlan -c -s %1", dev_name ); // create and start FCoE - create_ifcfg = true; + // create_ifcfg = true; } } else { command = sformat( "fipvlan -c -s %1", dev_name ); - create_ifcfg = true; + // create_ifcfg = true; } y2milestone( "Executing command: %1", command ); @@ -397,7 +397,6 @@ card["fcoe_enable"] = status_map["FCOE_ENABLE"]:""; card["dcb_required"] = status_map["DCB_REQUIRED"]:""; card["cfg_file"] = status_map["Filename"]:""; - card["modified"] = "yes"; FcoeClient::SetModified( true ); FcoeClient::SetNetworkCardsValue( FcoeClient::current_card, card ); @@ -485,7 +484,6 @@ if ( card["fcoe_enable"]:"" != fcoe_enabled ) { card["fcoe_enable"] = fcoe_enabled; - card["modified"] = "yes"; // set modified to "yes" FcoeClient::SetModified( true ); } @@ -493,7 +491,6 @@ if ( card["dcb_required"]:"" != dcb_required ) { card["dcb_required"] = dcb_required; - card["modified"] = "yes"; // set modified to "yes" FcoeClient::SetModified( true ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-2.21.3/src/fcoe-client.desktop new/yast2-fcoe-client-2.21.4/src/fcoe-client.desktop --- old/yast2-fcoe-client-2.21.3/src/fcoe-client.desktop 2011-05-30 10:58:42.000000000 +0200 +++ new/yast2-fcoe-client-2.21.4/src/fcoe-client.desktop 2011-06-29 14:46:59.000000000 +0200 @@ -11,10 +11,11 @@ X-SuSE-YaST-Group=Net_advanced X-SuSE-YaST-Argument= X-SuSE-YaST-RootOnly=true -X-SuSE-YaST-AutoInst= +X-SuSE-YaST-AutoInst=all X-SuSE-YaST-Geometry= X-SuSE-YaST-SortKey= X-SuSE-YaST-AutoInstResource=fcoe-client +X-SuSE-YaST-AutoInstClonable=true Icon=fcoe Exec=/sbin/yast2 fcoe-client diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-2.21.3/src/fcoe-client_auto.ycp new/yast2-fcoe-client-2.21.4/src/fcoe-client_auto.ycp --- old/yast2-fcoe-client-2.21.3/src/fcoe-client_auto.ycp 2011-04-19 13:03:23.000000000 +0200 +++ new/yast2-fcoe-client-2.21.4/src/fcoe-client_auto.ycp 2011-07-19 14:05:25.000000000 +0200 @@ -93,12 +93,142 @@ ret = FcoeClient::Read(); Progress::set (progress_orig); } -/* Write givven settings */ +/* Write given settings */ else if (func == "Write") { import "Progress"; boolean progress_orig = Progress::set (false); - FcoeClient::SetWriteOnly (true); + + boolean success = true; + boolean start_fcoe = false; + list<map> detected_netcards = []; + integer index = 0; + + // prepare for AutoYaST + list<map> imported_netcards = FcoeClient::GetNetworkCards(); + y2milestone( "Imported information about netcards: %1", imported_netcards ); + + // AutoYaST will install package 'open-fcoe' ( checks AutoPackages() ) + + // Start services 'fcoe' and 'lldpad' + success = FcoeClient::ServiceStatus(); + if ( success ) + { + y2milestone( "Services fcoe and lldpad started" ); + } + else + { + y2error( "Cannot start services - stopping auto installation" ); + return false; + } + // Reset info about netcards and get current values + FcoeClient::ResetNetworkCards(); + success = FcoeClient::DetectNetworkCards(); + if ( success ) + { + detected_netcards = FcoeClient::GetNetworkCards(); + y2milestone( "Information about detected netcards: %1", detected_netcards ); + } + else + { + y2error( "Cannot detect network cards - stopping auto installation" ); + return false; + } + + // Check imported data + foreach ( map card, imported_netcards, { + if ( card["fcoe_vlan"]:"" != FcoeClient::NOT_AVAILABLE && + card["fcoe_vlan"]:"" != FcoeClient::NOT_CONFIGURED ) + { + // any FCoE VLAN interface is configured + start_fcoe = true; + } + } ); + + // If any FcoE interface is found in imported data we try to start FCoE + // for all interfaces which are not yet configured, i.e. where starting of + // FCoE is possible. We can not start exactly the interface from imported + // data because the numeration of interfaces (eth0, eth1...) may differ. + if ( start_fcoe ) + { + foreach ( map card, detected_netcards, { + string vlan_interface = ""; + string fcoe_vlan_interface = ""; + string command = ""; + map output = $[]; + string ifcfg_file = ""; + map status_map = $[]; + + if ( card["fcoe_vlan"]:"" == FcoeClient::NOT_CONFIGURED ) + { + ifcfg_file = sformat( "/etc/sysconfig/network/ifcfg-%1\.%2", card["dev_name"]:"", + card["vlan_interface"]:"" ); + // if /etc/sysconfig/network/ifcfg-<vlan-interface> already exists + // call 'ifup' for the interface (creates /proc/net/vlan/<vlan-interface>) + if ( FileUtils::Exists( ifcfg_file ) ) + { + command = sformat( "ifup %1\.%2", card["dev_name"]:"", card["vlan_interface"]:"" ); + y2milestone( "Executing command: %1", command ); + output = (map)SCR::Execute( .target.bash_output, command ); + y2milestone( "Output: %1", output ); + + if ( output["exit"]:255 == 0 ) + { + // start FCoE + command = sformat( "fipvlan -s %1", card["dev_name"]:"" ); + } + } + else // create VLAN interface and start FCoE + { + command = sformat( "fipvlan -c -s %1", card["dev_name"]:"" ); + y2milestone( "Executing command: %1", command ); + output = (map)SCR::Execute( .target.bash_output, command ); + y2milestone( "Output: %1", output ); + } + + if ( output["exit"]:255 != 0 ) + { + y2error( "Cannot create and start FCoE on %1", card["dev_name"]:"" ); + } + else // get FCoE VLAN interface + { + vlan_interface = FcoeClient::GetVlanInterface( card["dev_name"]:"" ); + if ( vlan_interface == "" ) + { + y2error( "VLAN interface not available for %1.", card["dev_name"]:"" ); + } + else + { + fcoe_vlan_interface = FcoeClient::GetFcoeVlanInterface( card["dev_name"]:"", + vlan_interface ); + if ( fcoe_vlan_interface != "" ) + { + y2milestone( "FCoE VLAN interface %1 created/started", fcoe_vlan_interface ); + // read or create /etc/fcoe/ethx file + status_map = FcoeClient::GetFCoEStatus( fcoe_vlan_interface ); + // apply modified data + detected_netcards[ index, "fcoe_vlan"] = fcoe_vlan_interface; + detected_netcards[ index, "cfg_file"] = status_map["Filename"]:""; + detected_netcards[ index, "fcoe_enable"] = status_map["FCOE_ENABLE"]:""; + detected_netcards[ index, "dcb_required"] = status_map["DCB_REQUIRED"]:""; + } + else + { + y2error( "FCoE VLAN interface not configured for %1", card["dev_name"]:"" ); + } + } + } + } + index = index + 1; + }); + } + y2milestone( "Set NEW information about network cards: %1", detected_netcards ); + // Set new information about netcards + FcoeClient::SetNetworkCards( detected_netcards ); + + // FcoeClient::SetModified(true) is called in FcoeClient::Import(), + // i.e. modified is set before calling FcoeClient::Write() ret = FcoeClient::Write(); + Progress::set (progress_orig); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-2.21.3/src/fcoe-client_finish.ycp new/yast2-fcoe-client-2.21.4/src/fcoe-client_finish.ycp --- old/yast2-fcoe-client-2.21.3/src/fcoe-client_finish.ycp 2011-05-31 10:39:23.000000000 +0200 +++ new/yast2-fcoe-client-2.21.4/src/fcoe-client_finish.ycp 2011-07-19 14:05:25.000000000 +0200 @@ -46,14 +46,29 @@ } else if (func == "Write") { - // copy fcoe config files to destdir - WFM::Execute (.local.bash,"test -d /etc/fcoe/ && mkdir -p '" + String::Quote(Installation::destdir) + "/etc/fcoe' && cp -a /etc/fcoe/* '" + String::Quote(Installation::destdir) + "/etc/fcoe/'"); + boolean start_services = false; + + // copy fcoe config files to destdir + WFM::Execute (.local.bash,"test -d /etc/fcoe/ && mkdir -p '" + String::Quote(Installation::destdir) + "/etc/fcoe' && cp -a /etc/fcoe/* '" + String::Quote(Installation::destdir) + "/etc/fcoe/'"); - // TODO: only enable if any FCoE VLAN interface was enabled - Service::Enable("fcoe"); - Service::Enable("lldpad"); - y2milestone("fcoe and lldpad services enabled"); + // only enable services if any FCoE VLAN interface is enabled + list <map> netcards = FcoeClient::GetNetworkCards(); + foreach ( map card, netcards, { + if ( card["fcoe_vlan"]:"" != FcoeClient::NOT_AVAILABLE && + card["fcoe_vlan"]:"" != FcoeClient::NOT_CONFIGURED ) + { + // FCoE VLAN interface is configured -> start services + start_services = true; + } + } ); + + if ( start_services ) + { + y2milestone( "Enabling service start of fcoe and lldpad" ); + Service::Enable("fcoe"); + Service::Enable("lldpad"); + } } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-2.21.3/src/helps.ycp new/yast2-fcoe-client-2.21.4/src/helps.ycp --- old/yast2-fcoe-client-2.21.3/src/helps.ycp 2011-05-11 13:37:13.000000000 +0200 +++ new/yast2-fcoe-client-2.21.4/src/helps.ycp 2011-07-19 14:05:25.000000000 +0200 @@ -89,27 +89,40 @@ "interfaces" : _("<p><b><big>Network interface overview</big></b><br></p>") + /* Interfaces dialog help 2/4 */ -_("<p>The interfaces dialog shows all detected netcards including the status of VLAN and FcoE configuration.<br>FCoE is possible if a VLAN interface is configured for FCoE on the switch. For every netcard (network interface) this is shown in column 'FCoE VLAN interface'.</p>") + +_("<p>The interfaces dialog shows all detected netcards including the status of VLAN and FCoE configuration.<br>FCoE is possible if a VLAN interface is configured for FCoE on the switch. For every netcard (network interface) this is shown in column 'FCoE VLAN interface'.</p>") + /* Interfaces dialog help 3/4 */ - _("<i>not available</i> means, FCoE isn't possible (must be enabled on the switch first)<br> -<i>not configered</i>: FCoE is possible but not yet activated, press <b>Create FCoE VLAN interface</b> to do this.<br>") + + _("<p>The values for <i>FCoE VLAN Interface</i> in detail:<br> +<i>not available</i> means, FCoE isn't possible (must be enabled on the switch first)<br> +<i>not configured</i>: FCoE is possible but not yet activated, press <b>Create FCoE VLAN Interface</b> to do this.<br> + If the FCoE VLAN interface is already created the name is shown in the column, e.g. eth3.200.</p>") + - /* Interfaces dialog help 4/4 */ - _("If the FCoE VLAN interface is already created it is shown in the column, e.g. eth3.200"), + /* Interfaces dialog help 3/4 */ + _("<p>To change the configuration of an existing FCoE VLAN interface press button <b>Change Settings</b>.</p>" ), - /* Configuration dialog help 1/2 */ + /* Configuration dialog help 1/3 */ "configuration" : _("<p><b><big>General configuration of FCoE</big></b></p>") + - /* Configuration dialog help 2/2 */ -_("<p>Here you can configure the general settings for FCoE (/etc/fcoe/config).<br> -Debug: <i>yes</i> or <i>no</i>, Use syslog: <i>yes</i> or <i>no</i></p>"), + /* Configuration dialog help 2/3 */ + _("<p>Here you can configure the general settings for the FCoE system service. The settings are written to '/etc/fcoe/config'.</p>") + + + /* Configuration dialog help 3/3 */ + _("<p>The values are:<br> +<b>Debug</b>: <i>yes</i> or <i>no</i> is used to enable debugging messages from the fcoe service script and 'fcoemon'<br> +<b>Use syslog</b>: <i>yes</i> or <i>no</i> sends messages to the system log if set to <i>yes</i> (see /var/log/messages).</p>"), - /* edit dialog help 1/2 */ + /* edit dialog help 1/3 */ "change" : _("<p>Edit settings in /etc/fcoe/ethx</p>" ) + - /* Edit dialog help 2/2 */ - _( "FCoE enable: <i>yes</i> or <i>no</i>, DCB required: <i>yes</i> or <i>no</i>" ), + /* Edit dialog help 2/3 */ + _( "<p>The daemon 'fcoemon' reads these configuration files on initialization. + There is a file for every interface and the values indicate whether FCoE instances + should be created and if DCB is required.</p>" ) + + /* Edit dialog help 3/3 */ + _( "<p>The values are:<br> + FCoE enable: <i>yes</i> or <i>no</i> Enable or disable creation of FCoE. <br> + DCB required: <i>yes</i> or <i>no</i> The default is <i>yes</i>, DCB is usually + required.</p>" ), ]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-fcoe-client-2.21.3/src/inst_fcoe-client.ycp new/yast2-fcoe-client-2.21.4/src/inst_fcoe-client.ycp --- old/yast2-fcoe-client-2.21.3/src/inst_fcoe-client.ycp 2011-06-07 13:39:04.000000000 +0200 +++ new/yast2-fcoe-client-2.21.4/src/inst_fcoe-client.ycp 2011-07-19 14:05:25.000000000 +0200 @@ -98,6 +98,11 @@ // restart fcoemon y2milestone( "Restarting FCoE" ); FcoeClient::RestartServiceFcoe(); + // enable start of services + y2milestone( "Enabling service start of fcoe and lldpad" ); + FcoeClient::SetStartStatus( "fcoe", true ); + FcoeClient::SetStartStatus( "lldpad", true ); + FcoeClient::AdjustStartStatus(); // reset modified flag FcoeClient::SetModified( false ); } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
