Author: mvidner Date: Thu Jan 26 18:05:52 2012 New Revision: 67316 URL: http://svn.opensuse.org/viewcvs/yast?rev=67316&view=rev Log: fixed detection of need for persistent mac address (bnc#728611) dev_name or sysfs_id are missing/wrong in the available hwinfo, so construct sysfs_id from busid Modified: branches/SuSE-Code-11-SP2-Branch/network/src/clients/save_network.ycp branches/SuSE-Code-11-SP2-Branch/network/src/modules/LanItems.ycp branches/SuSE-Code-11-SP2-Branch/network/src/routines/routines.ycp Modified: branches/SuSE-Code-11-SP2-Branch/network/src/clients/save_network.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/network/src/clients/save_network.ycp?rev=67316&r1=67315&r2=67316&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/network/src/clients/save_network.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/network/src/clients/save_network.ycp Thu Jan 26 18:05:52 2012 @@ -142,7 +142,8 @@ if (Arch::s390()) { y2milestone ("Interface type: %1", InstallInf["type"]:""); // only some card types need a persistent MAC (bnc#658708) - if (! s390_device_needs_persistent_mac(netdevice,hardware)) { + string sysfs_id = dev_name_to_sysfs_id(netdevice, hardware); + if (! s390_device_needs_persistent_mac(sysfs_id, hardware)) { InstallInf = remove (InstallInf, "hwaddr"); } // hsi devices do not support setting hwaddr (bnc #479481) Modified: branches/SuSE-Code-11-SP2-Branch/network/src/modules/LanItems.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/network/src/modules/LanItems.ycp?rev=67316&r1=67315&r2=67316&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/network/src/modules/LanItems.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/network/src/modules/LanItems.ycp Thu Jan 26 18:05:52 2012 @@ -1065,10 +1065,17 @@ newdev["NETWORK"] = ""; newdev["REMOTE_IPADDR"] = remoteip; + // set LLADDR to sysconfig only for device on layer2 and only these which needs it - if (qeth_layer2 && - s390_device_needs_persistent_mac(Items[current, "ifcfg"]:"",Hardware)){ - newdev["LLADDR"] = qeth_macaddress; + if (qeth_layer2) { + string busid = Items[current, "hwinfo", "busid"]:""; + // string sysfs_id = busid_to_sysfs_id(busid, Hardware); + // sysfs id has changed from css0... + string sysfs_id = "/devices/qeth/" + busid; + y2milestone("busid %1", busid); + if (s390_device_needs_persistent_mac(sysfs_id, Hardware)) { + newdev["LLADDR"] = qeth_macaddress; + } } if(alias == "") { Modified: branches/SuSE-Code-11-SP2-Branch/network/src/routines/routines.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/network/src/routines/routines.ycp?rev=67316&r1=67315&r2=67316&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/network/src/routines/routines.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/network/src/routines/routines.ycp Thu Jan 26 18:05:52 2012 @@ -354,22 +354,27 @@ return need; } +string busid_to_sysfs_id(string busid, list<map> hardware) { + // hardware is cached list of netcards + map hw_item = find(map i, hardware, ``( i["busid"]:"" == busid )); + return hw_item["sysfs_id"]:""; +} + string dev_name_to_sysfs_id(string dev_name, list<map> hardware) { // hardware is cached list of netcards map hw_item = find(map i, hardware, ``( i["dev_name"]:"" == dev_name )); return hw_item["sysfs_id"]:""; } -string sysfs_card_type(string device,list<map> hardware) { - string sysfs_id = dev_name_to_sysfs_id(device,hardware); +string sysfs_card_type(string sysfs_id, list<map> hardware) { if (sysfs_id == "") return "none"; string filename = "/sys" + sysfs_id + "/card_type"; string card_type = (string) SCR::Read(.target.string, filename); return String::FirstChunk(card_type, "\n"); } -boolean s390_device_needs_persistent_mac(string device,list<map> hardware) { - string card_type = sysfs_card_type(device,hardware); +boolean s390_device_needs_persistent_mac(string sysfs_id,list<map> hardware) { + string card_type = sysfs_card_type(sysfs_id,hardware); list<string> types_needing_persistent = [ "OSD_100", "OSD_1000", @@ -379,7 +384,7 @@ "OSD_Express", ]; boolean needs_persistent = contains(types_needing_persistent, card_type); - y2milestone("Device: %1, card type: %2, needs persistent MAC: %3", device, card_type, needs_persistent); + y2milestone("Sysfs Device: %1, card type: %2, needs persistent MAC: %3", sysfs_id, card_type, needs_persistent); return needs_persistent; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org