commit yast2-network for openSUSE:Factory
![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community,
here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2012-11-06 16:25:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-network (Old)
and /work/SRC/openSUSE:Factory/.yast2-network.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-network", Maintainer is "MFilka@suse.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2012-10-11 11:38:39.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-network.new/yast2-network.changes 2012-11-06 16:25:22.000000000 +0100
@@ -1,0 +2,22 @@
+Tue Nov 6 10:44:59 UTC 2012 - mfilka@suse.com
+
+- Fixed testsuite. tests/include.ycp, tests/udev.ycp failed when
+missing /etc/sysconfig/console.
+
+-------------------------------------------------------------------
+Thu Oct 25 21:04:58 UTC 2012 - mfilka@suse.com
+
+- initialize s390 specific device variables when switching interfaces
+- s390 code cleanup. chan_mode variable is not shared between different
+device types anymore. qeth_macaddress is set according sysconfig now.
+- bnc#747844
+- 2.24.8
+
+-------------------------------------------------------------------
+Wed Oct 17 12:42:29 UTC 2012 - mfilka@suse.com
+
+- Refactoring editing interface names.
+- Added nic name checking according bnc#784952
+- 2.24.7
+
+-------------------------------------------------------------------
Old:
----
yast2-network-2.24.6.tar.bz2
New:
----
yast2-network-2.24.8.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-network.spec ++++++
--- /var/tmp/diff_new_pack.JtaexE/_old 2012-11-06 16:25:24.000000000 +0100
+++ /var/tmp/diff_new_pack.JtaexE/_new 2012-11-06 16:25:24.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-network
-Version: 2.24.6
+Version: 2.24.8
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -37,8 +37,8 @@
# Wizard::SetDesktopTitleAndIcon
# yast2 v2.23.0 - support for shel (un)quoting
# yast2 v2.23.6 - updated API for IPv6
-BuildRequires: yast2 >= 2.21.22
-Requires: yast2 >= 2.23.5
+BuildRequires: yast2 >= 2.23.6
+Requires: yast2 >= 2.23.6
#netconfig (FaTE #303618)
Requires: sysconfig >= 0.71.2
++++++ yast2-network-2.24.6.tar.bz2 -> yast2-network-2.24.8.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.24.6/VERSION new/yast2-network-2.24.8/VERSION
--- old/yast2-network-2.24.6/VERSION 2012-10-03 11:06:49.000000000 +0200
+++ new/yast2-network-2.24.8/VERSION 2012-11-06 08:39:56.000000000 +0100
@@ -1 +1 @@
-2.24.6
+2.24.8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.24.6/src/lan/complex.ycp new/yast2-network-2.24.8/src/lan/complex.ycp
--- old/yast2-network-2.24.6/src/lan/complex.ycp 2012-09-20 10:28:35.000000000 +0200
+++ new/yast2-network-2.24.8/src/lan/complex.ycp 2012-11-06 08:39:45.000000000 +0100
@@ -249,7 +249,8 @@
LanItems::startmode = "hotplug";
LanItems::bootproto = "none";
- LanItems::GetReplacedItemUdev("KERNELS", LanItems::getCurrentItem()["hwinfo", "busid"]:"");
+ // if particular bond slave uses mac based persistency, overwrite to bus id based one. Don't touch otherwise.
+ LanItems::ReplaceItemUdev( "ATTR{address}", "KERNELS", LanItems::getCurrentItem()["hwinfo", "busid"]:"");
LanItems::Commit();
});
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.24.6/src/lan/hardware.ycp new/yast2-network-2.24.8/src/lan/hardware.ycp
--- old/yast2-network-2.24.6/src/lan/hardware.ycp 2012-09-20 10:28:35.000000000 +0200
+++ new/yast2-network-2.24.8/src/lan/hardware.ycp 2012-11-06 08:39:56.000000000 +0100
@@ -372,8 +372,122 @@
return ret;
}
+/**
+ * Checks if given name can be accepted as nic's new one.
+ *
+ * @returns false and pops up an explanation if the name is invalid
+ */
+boolean CheckUdevNicName( string name)
+{
+ // when dev_name changed, rename ifcfg (both in NetworkInterfaces and LanItems)
+ boolean error = false;
+
+ if( UsedNicName( name) )
+ {
+ Popup::Error(_("Configuration name already exists."));
+ return false;
+ }
+ if( !ValidNicName( name) )
+ {
+ Popup::Error(_("Invalid configuration name."));
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * Dialog for editing nic's udev rules.
+ *
+ * @returns nic name. New one if `ok, old one otherwise.
+ */
+string EditUdevRulesDialog()
+{
+ UI::OpenDialog(
+ `VBox(
+ `RadioButtonGroup(`id(`udev_type),
+ `VBox(
+ //make sure there is enough space (#367239)
+ `HSpacing(30),
+ `Label(_("Rule by:")),
+ `Left(`RadioButton(`id(`mac), sformat("MAC address : %1", LanItems::getCurrentItem()["hwinfo", "mac"]:""))),
+ `Left(`RadioButton(`id(`busid), sformat("BusID : %1", LanItems::getCurrentItem()["hwinfo", "busid"]:"") ))
+ )
+ ),
+ `Left(
+ `HBox(
+ `CheckBox(`id(`change_dev_name), `opt(`notify), _("Change DeviceName"), false),
+ `InputField(`id(`dev_name), "", LanItems::GetItemUdev("NAME"))
+ )
+ ),
+ `VSpacing(0.5),
+ `HBox( `PushButton (`id(`ok), `opt(`default), Label::OKButton ()),
+ `PushButton (`id(`cancel), Label::CancelButton ())
+ )
+ )
+ );
+
+ if (size(LanItems::GetItemUdev("ATTR{address}"))>0)
+ {
+ UI::ChangeWidget(`id(`udev_type), `CurrentButton, `mac);
+ }
+ else
+ {
+ if (size(LanItems::GetItemUdev("KERNELS"))>0)
+ {
+ UI::ChangeWidget(`id(`udev_type), `CurrentButton, `busid);
+ }
+ else
+ y2error("Unknown udev rule ");
+ }
+
+ UI::ChangeWidget(`dev_name, `Enabled, false);
+
+ any ret = nil;
+ while( ret != `cancel && ret != `abort && ret != `ok)
+ {
+ ret = UI::UserInput();
+ boolean change_name_active = (boolean)UI::QueryWidget(`change_dev_name, `Value);
+
+ if (ret == `change_dev_name)
+ {
+ UI::ChangeWidget(`dev_name, `Enabled, change_name_active);
+ }
+
+ if(ret == `ok)
+ {
+ string old_name = LanItems::GetItemUdev("NAME");
+ string new_name = (string)UI::QueryWidget(`dev_name, `Value);
+ string rule_key = UI::QueryWidget(`udev_type, `CurrentButton)==`mac ? "ATTR{address}" : "KERNELS";
+ string rule_value = UI::QueryWidget(`udev_type, `CurrentButton)==`mac ? LanItems::getCurrentItem()["hwinfo", "mac"]:"" : LanItems::getCurrentItem()["hwinfo", "busid"]:"";
+
+ if( change_name_active && (new_name != old_name))
+ {
+ if( CheckUdevNicName( new_name))
+ {
+ LanItems::SetItemUdev("NAME", new_name);
+ NetworkInterfaces::Delete2(old_name);
+ LanItems::Items[LanItems::current, "ifcfg"] = LanItems::GetItemUdev("NAME");
+ }
+ else
+ {
+ UI::SetFocus( `dev_name);
+ ret = nil;
+ continue;
+ }
+ }
+
+ // update udev rules
+ string old_key = isempty( LanItems::GetItemUdev( "KERNELS")) ? "ATTR{address}" : "KERNELS";
+ LanItems::ReplaceItemUdev( old_key, rule_key, rule_value);
+ }
+ }
+ UI::CloseDialog();
+
+ return LanItems::Items[LanItems::current, "ifcfg"]:"";
+}
symbol handleHW (string key, map event) {
if (event["ID"]:nil==`cancel) LanItems::Rollback();
@@ -468,62 +582,7 @@
}
}
if (ret==`change_udev){
- UI::OpenDialog(
- `VBox(
- `RadioButtonGroup(`id(`udev_type),
- `VBox(
- //make sure there is enough space (#367239)
- `HSpacing(30),
- `Label(_("Rule by:")),
- `Left(`RadioButton(`id(`mac), sformat("MAC address : %1", LanItems::getCurrentItem()["hwinfo", "mac"]:""))),
- `Left(`RadioButton(`id(`busid), sformat("BusID : %1", LanItems::getCurrentItem()["hwinfo", "busid"]:"") ))
- )
- ),
- `Left(
- `HBox(
- `CheckBox(`id(`change_dev_name), `opt(`notify), _("Change DeviceName"), false),
- `InputField(`id(`dev_name), "", LanItems::GetItemUdev("NAME"))
- )
- ),
- `VSpacing(0.5),
- `HBox( `PushButton (`id(`ok), `opt(`default), Label::OKButton ()),
- `PushButton (`id(`cancel), Label::CancelButton ())
- )
- )
-
- );
- if (size(LanItems::GetItemUdev("ATTR{address}"))>0) UI::ChangeWidget(`id(`udev_type), `CurrentButton, `mac);
- else if (size(LanItems::GetItemUdev("KERNELS"))>0) UI::ChangeWidget(`id(`udev_type), `CurrentButton, `busid);
- else y2error("Unknown udev rule ");
- UI::ChangeWidget(`dev_name, `Enabled, false);
- any ret = nil;
- while(ret!=`cancel && ret!=`ok){
- ret = UI::UserInput();
- if (ret == `change_dev_name) UI::ChangeWidget(`dev_name, `Enabled, (boolean)UI::QueryWidget(`change_dev_name, `Value));
- }
- if (ret == `ok){
- string old_name = LanItems::GetItemUdev("NAME");
- string new_name = (string)UI::QueryWidget(`dev_name, `Value);
- // write new udev rule
- string rule_key = UI::QueryWidget(`udev_type, `CurrentButton)==`mac ? "ATTR{address}" : "KERNELS";
- string rule_value = UI::QueryWidget(`udev_type, `CurrentButton)==`mac ? LanItems::getCurrentItem()["hwinfo", "mac"]:"" : LanItems::getCurrentItem()["hwinfo", "busid"]:"";
-y2internal("LanItems::GetReplacedItemUdev(%1, %2) %3",rule_key, rule_value, LanItems::GetReplacedItemUdev(rule_key, rule_value));
- if ((boolean)UI::QueryWidget(`change_dev_name, `Value)){
- // when dev_name changed, rename ifcfg (both in NetworkInterfaces and LanItems)
- if (new_name!=old_name){
- if (contains(NetworkInterfaces::List(""), new_name)){
- Popup::Error(_("Configuration name already exists."));
- ret=nil;
- } else{
- y2internal("LanItems::GetReplacedItemUdev2 %1", LanItems::GetReplacedItemUdev("NAME", new_name));
- NetworkInterfaces::Delete2(old_name);
- LanItems::Items[LanItems::current, "ifcfg"]=LanItems::GetItemUdev("NAME");
- }
- }
- }
- }
- UI::CloseDialog();
- UI::ChangeWidget(`device_name, `Value, LanItems::Items[LanItems::current, "ifcfg"]:"");
+ UI::ChangeWidget(`device_name, `Value, EditUdevRulesDialog() );
}
if (ret==`blink){
string device = LanItems::device;
@@ -608,7 +667,7 @@
`VSpacing(1),
`HBox(
/* TextEntry label */
- `InputField(`id(`chan_mode), `opt(`hstretch), _("&Port Name"), LanItems::chan_mode),
+ `InputField(`id(`qeth_portname), `opt(`hstretch), _("&Port Name"), LanItems::qeth_portname),
`ComboBox(`id(`qeth_portnumber), _("Port Number"), [`item(`id("0"), "0", true), `item(`id("1"), "1")])
),
`VSpacing(1),
@@ -712,7 +771,7 @@
`Frame(_("S/390 Device Settings"), `HBox(`HSpacing(2), `VBox(
`VSpacing(1),
/* TextEntry label, #42789 */
- `InputField(`id(`chan_mode), `opt(`hstretch), _("&Peer Name"), ""),
+ `InputField(`id(`iucv_user), `opt(`hstretch), _("&Peer Name"), LanItems::iucv_user),
`VSpacing(1)
), `HSpacing(2))),
`HSpacing(6)
@@ -742,10 +801,20 @@
UI::ChangeWidget(`id(`qeth_macaddress), `ValidChars, ":0123456789abcdefABCDEF");
}
- if (LanItems::type != "hsi")
- UI::SetFocus(`id(`chan_mode));
- else
- UI::SetFocus(`id(`qeth_options));
+ switch( LanItems::type)
+ {
+ case "hsi":
+ UI::SetFocus(`id(`qeth_options));
+ break;
+ case "qeth":
+ UI::SetFocus(`id(`qeth_portname));
+ break;
+ case "iucv":
+ UI::SetFocus(`id(`iucv_user));
+ break;
+ default:
+ UI::SetFocus(`id(`chan_mode));
+ }
// FIXME: no spaces
// UI::ChangeWidget(`id(`key), `ValidChars, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_:;");
@@ -769,19 +838,27 @@
else if(ret == `next) {
if(LanItems::type == "iucv") {
// #176330, must be static
- LanItems::nm_name = "static-iucv-id-" + (string) UI::QueryWidget(`id(`chan_mode), `Value);
- LanItems::device = "id-" + (string) UI::QueryWidget(`id(`chan_mode), `Value);
+ LanItems::nm_name = "static-iucv-id-" + (string) UI::QueryWidget(`id(`iucv_user), `Value);
+ LanItems::device = "id-" + (string) UI::QueryWidget(`id(`iucv_user), `Value);
+ LanItems::iucv_user = (string) UI::QueryWidget(`id(`iucv_user), `Value);
}
- LanItems::chan_mode = (string) UI::QueryWidget(`id(`chan_mode), `Value);
+ if(LanItems::type == "ctc")
+ {
+ LanItems::chan_mode = (string) UI::QueryWidget(`id(`chan_mode), `Value);
+ }
if(LanItems::type == "lcs")
+ {
LanItems::lcs_timeout = (string) UI::QueryWidget(`id(`lcs_timeout), `Value);
+ LanItems::chan_mode = (string) UI::QueryWidget(`id(`chan_mode), `Value);
+ }
if(LanItems::type == "qeth" || LanItems::type == "hsi") {
LanItems::qeth_options = (string) UI::QueryWidget(`id(`qeth_options), `Value);
LanItems::ipa_takeover = (boolean) UI::QueryWidget(`id(`ipa_takeover), `Value);
LanItems::qeth_layer2 = (boolean) UI::QueryWidget(`id(`qeth_layer2), `Value);
LanItems::qeth_macaddress = (string) UI::QueryWidget(`id(`qeth_macaddress), `Value);
LanItems::qeth_portnumber = (string) UI::QueryWidget(`id(`qeth_portnumber), `Value);
+ LanItems::qeth_portname = (string) UI::QueryWidget(`id(`qeth_portname), `Value);
}
string read = (string) UI::QueryWidget(`id(`qeth_chan_read), `Value);
string write = (string) UI::QueryWidget(`id(`qeth_chan_write), `Value);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.24.6/src/modules/LanItems.ycp new/yast2-network-2.24.8/src/modules/LanItems.ycp
--- old/yast2-network-2.24.6/src/modules/LanItems.ycp 2012-10-03 10:59:17.000000000 +0200
+++ new/yast2-network-2.24.8/src/modules/LanItems.ycp 2012-11-06 08:39:56.000000000 +0100
@@ -122,12 +122,14 @@
list<string> nilliststring = nil; // to save some casting
/* s390 options */
-// portname is in ifcfg, others are in hwcfg
-global string portname = "";
+global string qeth_portname = "";
global string qeth_portnumber = "";
+// * ctc as PROTOCOL (or ctc mode, number in { 0, 1, .., 4 }, default: 0)
global string chan_mode = "0";
global string qeth_options = "";
global boolean ipa_takeover = false;
+// * iucv as ROUTER (or iucv user, a zVM guest, string of 1 to 8 chars )
+global string iucv_user = "";
// #84148
// 26bdd00.pdf
// Ch 7: qeth device driver for OSA-Express (QDIO) and HiperSockets
@@ -241,17 +243,34 @@
return value;
}
-global list<string> GetReplacedItemUdev(string r_key, string r_val){
- list <string> new_rules=[];
- foreach(string row, getUdevFallback(), {
- if (r_key=="NAME"){
- if (issubstring(row, "NAME")) row = sformat("NAME=\"%1\"", r_val);
- } else if (issubstring(row, "ATTR{address}") || issubstring(row, "KERNELS")) row = sformat("%1==\"%2\"", r_key, r_val);
+global list<string> ReplaceItemUdev(string replace_key, string new_key, string new_val)
+{
+ list<string> new_rules=[];
+ // udev syntax distinguishes among others:
+ // = for assignment
+ // == for equality checks
+ string operator = new_key == "NAME" ? "=" : "==";
- new_rules = add(new_rules, row);
- });
- Items[current, "udev", "net"]=new_rules;
- return new_rules;
+ foreach(string row, getUdevFallback(),
+ {
+ if( issubstring( row, replace_key))
+ row = sformat( "%1%2\"%3\"", new_key, operator, new_val);
+
+ new_rules = add( new_rules, row);
+ });
+
+ y2debug("LanItems::ReplaceItemUdev: udev rules %1", Items[ current, "udev", "net"]:[] );
+
+ Items[current, "udev", "net"] = new_rules;
+
+ y2debug("LanItems::ReplaceItemUdev(%1, %2, %3) %4", replace_key, new_key, new_val, new_rules);
+
+ return new_rules;
+}
+
+global list<string> SetItemUdev(string rule_key, string rule_val)
+{
+ return ReplaceItemUdev( rule_key, rule_key, rule_val);
}
global void WriteUdevDriverRules(){
@@ -1009,7 +1028,8 @@
wl_power = GetDeviceVar (devmap, defaults, "WIRELESS_POWER") == "yes";
wl_ap_scanmode = GetDeviceVar (devmap, defaults, "WIRELESS_AP_SCANMODE");
/* s/390 options */
- portname = GetDeviceVar (devmap, defaults, "PORTNAME");
+ /* We always have to set the MAC Address for qeth Layer2 support */
+ qeth_macaddress = GetDeviceVar (devmap, defaults, "LLADDR");
aliases = devmap["_aliases"]:$[];
@@ -1028,6 +1048,7 @@
"REMOTE_IPADDR": "",
"NETMASK": "",
"MTU": "",
+ "LLADDR": "00:00:00:00:00:00",
"ETHTOOL_OPTIONS": "",
"NAME": "",
"STARTMODE": "manual",
@@ -1053,7 +1074,6 @@
"WIRELESS_BITRATE": "auto",
"WIRELESS_AP": "",
"WIRELESS_POWER": "",
- "PORTNAME": "",
// aliases = devmap["_aliases"]:$[]; // ?
"WIRELESS_EAP_MODE": "",
"WIRELESS_WPA_IDENTITY": "",
@@ -1069,9 +1089,24 @@
// default options for bonding (bnc#404449)
"BONDING_MODULE_OPTS": "mode=active-backup miimon=100",
+
];
/**
+ * Default values used when creating an emulated NIC for physical s390 hardware.
+ */
+map
participants (1)
-
root@hilbert.suse.de