Skip to content

Commit

Permalink
fixed problem with not matching udev rule (bnc#551310)
Browse files Browse the repository at this point in the history
svn path=/trunk/network/; revision=59662

Conflicts:
	VERSION
	package/yast2-network.changes
	src/modules/LanItems.ycp
  • Loading branch information
Michal Žugec authored and mchf committed Jan 13, 2015
1 parent a6b128f commit 2cb5790
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions package/yast2-network.changes
Expand Up @@ -2,6 +2,7 @@
Thu Nov 6 10:48:55 UTC 2014 - mfilka@suse.com

- adopted to new device type detection API provided by yast2
- fixed problem with not matching udev rule (bnc#551310)
- 2.17.199.1

-------------------------------------------------------------------
Expand Down
20 changes: 19 additions & 1 deletion src/modules/LanItems.ycp
Expand Up @@ -289,9 +289,27 @@ boolean ReadUdevDriverRules(){
return true;
}

list<string> getUdevFallback(){
list<string> udev_rules = getCurrentItem()["udev", "net"]:[];
if (size(udev_rules)==0){
udev_rules = [
"SUBSYSTEM==\"net\"",
"ACTION==\"add\"",
"DRIVERS==\"?*\"",
sformat("ATTR{address}==\"%1\"", getCurrentItem()["hwinfo", "mac"]:""),
"ATTR{type}==\"1\"",
"KERNEL==\"eth*\"",
sformat("NAME=\"%1\"", getCurrentItem()["ifcfg"]:"")
];
y2error("No Udev rules found, create new as fallback: %1", udev_rules);
}
return udev_rules;
}

global string GetItemUdev(string key){
string value="";
foreach(string row, Items[current, "udev", "net"]:[], {

foreach(string row, getUdevFallback(), {
if(issubstring(row, key)){

list items = filter(string s, splitstring(row, "="), { return (size(s)>0); });
Expand Down

0 comments on commit 2cb5790

Please sign in to comment.