Author: gs Date: Tue Sep 13 10:53:18 2011 New Revision: 65676 URL: http://svn.opensuse.org/viewcvs/yast?rev=65676&view=rev Log: write /etc/sysconfig/network/ifcfg-ethx file during installation (and copy it to destination) Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/fcoe-client_finish.ycp Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp?rev=65676&r1=65675&r2=65676&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/FcoeClient.ycp Tue Sep 13 10:53:18 2011 @@ -167,6 +167,7 @@ global boolean lldpad_started = false; // service fcoe was started global boolean fcoe_started = false; // service lldpad was started +global string ifcfg_file = ""; // Settings: Define all variables needed for configuration of fcoe-client Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp?rev=65676&r1=65675&r2=65676&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/complex.ycp Tue Sep 13 10:53:18 2011 @@ -156,7 +156,7 @@ // check VLAN status if ( card["fcoe_vlan"]:"" == FcoeClient::NOT_CONFIGURED ) { - UI::ChangeWidget( `id(`edit), `Enabled, false ); + UI::ChangeWidget( `id(`edit), `Enabled, true ); UI::ChangeWidget( `id(`create), `Enabled, true ); UI::ChangeWidget( `id(`remove), `Enabled, false ); } @@ -284,8 +284,9 @@ string vlan_interface = ""; string fcoe_vlan_interface = ""; map status_map = $[]; - boolean create_ifcfg = false; - string ifcfg_file = ""; + boolean create_ifcfg = true; + + FcoeClient::ifcfg_file = sformat( "/etc/sysconfig/network/ifcfg-%1\.%2", dev_name, card["vlan_interface"]:"" ); if ( Stage::initial() ) // first stage of installation - create and start FCoE VLAN interface { @@ -326,11 +327,9 @@ on discovered FCoE VLAN interface on %1?"), dev_name ) ); if ( ret == true ) { - ifcfg_file = sformat( "/etc/sysconfig/network/ifcfg-%1\.%2", 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 ) ) + if ( FileUtils::Exists( FcoeClient::ifcfg_file ) ) { command = sformat( "ifup %1\.%2", dev_name, card["vlan_interface"]:"" ); y2milestone( "Executing command: %1", command ); @@ -345,13 +344,11 @@ else { command = sformat( "fipvlan -c -s %1", dev_name ); // create and start FCoE - create_ifcfg = true; } } else { command = sformat( "fipvlan -c -s %1", dev_name ); - create_ifcfg = true; } y2milestone( "Executing command: %1", command ); @@ -393,10 +390,10 @@ { string config = sformat( "BOOTPROTO=\"static\"\nSTARTMODE=\"nfsroot\" ETHERDEVICE=\"%1\"\nUSERCONTROL=\"no\"\nINTERFACETYPE=\"vlan\"\n", dev_name ); - ifcfg_file = sformat( "/etc/sysconfig/network/ifcfg-%1", fcoe_vlan_interface ); - SCR::Write(.target.string, ifcfg_file, config); - y2milestone( "Writing config: %1 to %2", config, ifcfg_file ); - FcoeClient::AddRevertCommand( sformat( "rm %1", ifcfg_file ) ); + FcoeClient::ifcfg_file = sformat( "/etc/sysconfig/network/ifcfg-%1", fcoe_vlan_interface ); + SCR::Write(.target.string, FcoeClient::ifcfg_file, config); + y2milestone( "Writing config: %1 to %2", config, FcoeClient::ifcfg_file ); + FcoeClient::AddRevertCommand( sformat( "rm %1", FcoeClient::ifcfg_file ) ); } } else Modified: branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/fcoe-client_finish.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/fcoe-client_finish.ycp?rev=65676&r1=65675&r2=65676&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/fcoe-client_finish.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/fcoe-client/src/fcoe-client_finish.ycp Tue Sep 13 10:53:18 2011 @@ -47,12 +47,19 @@ else if (func == "Write") { boolean start_services = false; - + string command = ""; y2milestone( "Copying files /etc/fcoe/* to destination" ); // 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/'"); + // copy sysconfig file + command = sformat ( "cp -a %1 '%2/etc/sysconfig/network'", FcoeClient::ifcfg_file, + String::Quote(Installation::destdir) ); + y2milestone( "Executing command: %1", command ); + + WFM::Execute (.local.bash, command ); + // only enable services if any FCoE VLAN interface is enabled list <map> netcards = FcoeClient::GetNetworkCards(); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org