[yast-commit] r62763 - in /branches/SuSE-Code-11-SP1-Branch/network: VERSION package/yast2-network.changes src/clients/save_network.ycp src/modules/LanUdevAuto.ycp
Author: mzugec Date: Mon Nov 8 16:41:40 2010 New Revision: 62763 URL: http://svn.opensuse.org/viewcvs/yast?rev=62763&view=rev Log: TP-L3: if possible, for temporary installation network use same device with same MAC address, even if devicename changed (bnc#648270) Modified: branches/SuSE-Code-11-SP1-Branch/network/VERSION branches/SuSE-Code-11-SP1-Branch/network/package/yast2-network.changes branches/SuSE-Code-11-SP1-Branch/network/src/clients/save_network.ycp branches/SuSE-Code-11-SP1-Branch/network/src/modules/LanUdevAuto.ycp Modified: branches/SuSE-Code-11-SP1-Branch/network/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/network/VERSION?rev=62763&r1=62762&r2=62763&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/network/VERSION (original) +++ branches/SuSE-Code-11-SP1-Branch/network/VERSION Mon Nov 8 16:41:40 2010 @@ -1 +1 @@ -2.17.143 +2.17.144 Modified: branches/SuSE-Code-11-SP1-Branch/network/package/yast2-network.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/network/package/yast2-network.changes?rev=62763&r1=62762&r2=62763&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/network/package/yast2-network.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/network/package/yast2-network.changes Mon Nov 8 16:41:40 2010 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Nov 8 16:40:34 CET 2010 - mzugec@suse.de + +- TP-L3: if possible, for temporary installation network use same +device with same MAC address, even if devicename changed (bnc#648270) +- 2.17.144 + +------------------------------------------------------------------- Wed Oct 27 13:28:04 CEST 2010 - mzugec@suse.cz - AY: when no network profile, don't change network configuration Modified: branches/SuSE-Code-11-SP1-Branch/network/src/clients/save_network.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/network/src/clients/save_network.ycp?rev=62763&r1=62762&r2=62763&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/network/src/clients/save_network.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/network/src/clients/save_network.ycp Mon Nov 8 16:41:40 2010 @@ -64,6 +64,7 @@ * @return true on success */ define boolean ReadInstallInf() { + y2milestone("ReadInstallInf()"); /* Detect install.inf location */ path install_inf = nil; @@ -117,10 +118,14 @@ /* Split network device */ netdevice = InstallInf["netdevice"]:""; + y2milestone("InstallInf::netdevice:%1", netdevice); if (Mode::autoinst()){ + // if possible, for temporary installation network use same device + // with same MAC address (even if devicename changed) (bnc#648270) string new_devname = LanUdevAuto::GetDevnameByMAC(InstallInf["hwaddr"]:""); + y2milestone("LanUdevAuto::netdevice:%1", new_devname); if (size(new_devname)>0){ - y2internal("old devname: %1, new devname: %2", netdevice, new_devname); + y2milestone("old devname: %1, new devname: %2", netdevice, new_devname); netdevice=new_devname; } } Modified: branches/SuSE-Code-11-SP1-Branch/network/src/modules/LanUdevAuto.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/network/src/modules/LanUdevAuto.ycp?rev=62763&r1=62762&r2=62763&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/network/src/modules/LanUdevAuto.ycp (original) +++ branches/SuSE-Code-11-SP1-Branch/network/src/modules/LanUdevAuto.ycp Mon Nov 8 16:41:40 2010 @@ -229,22 +229,16 @@ global string GetDevnameByMAC(string mac){ string devname=""; if (size(mac)>0){ - foreach(integer id, map<string, any> row, (map<integer, map <string, any> >)LanItems::Items, { - LanItems::current=id; - string name = LanItems::GetItemUdev("NAME"); - string mac_rule = LanItems::GetItemUdev("ATTR{address}"); - if (size(mac_rule)==0){ - y2error("No MAC rule %1", row); - continue; - } else - y2internal("MAC rule %1", row); - if (mac_rule==mac){ - devname=name; - y2internal("Rule matched! New devname %1", devname); - break; - } + y2milestone("MAC address from 1st stage: %1", mac); + foreach(map rule, udev_rules, { + if (rule["rule"]:""=="ATTR{address}"){ + if (mac==rule["value"]:""){ + devname=rule["name"]:""; + y2milestone("MAC address matched with device:%1", rule["name"]:""); + break; + } + } }); - } else y2warning("No MAC address to compare."); return devname; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
mzugec@svn2.opensuse.org