[yast-commit] r66914 - /branches/SuSE-Code-11-SP2-Branch/network/src/clients/save_network.ycp
Author: mvidner
Date: Thu Nov 24 15:25:01 2011
New Revision: 66914
URL: http://svn.opensuse.org/viewcvs/yast?rev=66914&view=rev
Log:
Only save LLADDR (persistent MAC) for some s390 card types (bnc#658708).
Modified:
branches/SuSE-Code-11-SP2-Branch/network/src/clients/save_network.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=66914&r1=66913&r2=66914&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 Nov 24 15:25:01 2011
@@ -34,6 +34,10 @@
symbol network_disk = `no; // `nfs `iscsi `fcoe
string netdevice="";
+list<map> hardware=ReadHardware("netcard");
+y2milestone("hardware %1", hardware);
+
+
/**
* Read one install.inf item
* @param item InstallInf map key
@@ -59,6 +63,35 @@
return (ret == nil)? s: ret;
}
+string dev_name_to_sysfs_id(string dev_name) {
+ // hardware is global, read at client start
+ map hw_item = find(map i, hardware, ``( i["dev_name"]:"" == dev_name ));
+ return hw_item["sysfs_id"]:"";
+}
+
+string sysfs_card_type(string device) {
+ string sysfs_id = dev_name_to_sysfs_id(device);
+ 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) {
+ string card_type = sysfs_card_type(device);
+ list<string> types_needing_persistent = [
+ "OSD_100",
+ "OSD_1000",
+ "OSD_10GIG",
+ "OSD_FE_LANE",
+ "OSD_GbE_LANE",
+ "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);
+ return needs_persistent;
+}
+
/**
* Read install.inf from the correct location
* @return true on success
@@ -137,6 +170,10 @@
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)) {
+ InstallInf = remove (InstallInf, "hwaddr");
+ }
// hsi devices do not support setting hwaddr (bnc #479481)
if (InstallInf["type"]:"" == "hsi" && haskey (InstallInf, "hwaddr"))
InstallInf = remove (InstallInf, "hwaddr");
@@ -218,11 +255,6 @@
return "";
}
-
-//map
participants (1)
-
mvidner@svn2.opensuse.org