Bugzilla – Attachment 104060 Details for
Bug 218663
yast network module bonding and no ip patch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
yast network bonding patch
patch-yast2-network-2.14.5 (text/plain), 10.89 KB, created by
Cong Meng
on 2006-11-07 05:17:37 UTC
(
hide
)
Description:
yast network bonding patch
Filename:
MIME Type:
Creator:
Cong Meng
Created:
2006-11-07 05:17:37 UTC
Size:
10.89 KB
patch
obsolete
> >--- yast2-network-2.14.5.old/src/lan/hardware.ycp 2006-11-03 14:21:18.000000000 +0800 >+++ yast2-network-2.14.5/src/lan/hardware.ycp 2006-11-06 17:21:24.000000000 +0800 >@@ -88,7 +88,7 @@ in the <b>IBM Device Drivers and Install > string hwcfg = Lan::nm_name; > > // FIXME duplicated in address.ycp >- list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan" ]; >+ list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan", "bond" ]; > > if(Arch::s390 ()) > device_types = [ "eth", "tr", "hsi", "ctc", "escon", "ficon", "iucv", "qeth", "lcs" ]; >@@ -346,6 +346,19 @@ in the <b>IBM Device Drivers and Install > UI::ChangeWidget(`id(`modul), `Value, modul); > UI::ChangeWidget(`id(`options), `Value, options); > } >+ else if (type == "bond") >+ { >+ UI::ChangeWidget(`id(`hwcfg), `Enabled, false); >+ UI::ChangeWidget(`id(`modul), `Enabled, false); >+ UI::ChangeWidget(`id(`options), `Enabled, false); >+ UI::ChangeWidget(`id(`pcmcia), `Enabled, false); >+ UI::ChangeWidget(`id(`usb), `Enabled, false); >+ UI::ChangeWidget(`id(`list), `Enabled, false); >+ >+ UI::ChangeWidget(`id(`hwcfg), `Value, ""); >+ UI::ChangeWidget(`id(`modul), `Value, ""); >+ UI::ChangeWidget(`id(`options), `Value, ""); >+ } > > continue; > } >--- yast2-network-2.14.5.old/src/lan/address.ycp 2006-11-03 14:21:18.000000000 +0800 >+++ yast2-network-2.14.5/src/lan/address.ycp 2006-11-06 17:20:33.000000000 +0800 >@@ -89,6 +89,25 @@ void StoreAddrWidget (string key, map ev > } > > /** >+ * Default function to init the value of slave devices box. >+ * @param key id of the widget >+ */ >+void InitSlave(string key) >+{ >+ UI::ChangeWidget(`id(key), `SelectedItems, settings["SLAVES"]:[]); >+} >+ >+/** >+ * Default function to store the value of slave devices box. >+ * @param key id of the widget >+ * @param key id of the widget >+ */ >+void StoreSlave(string key, map event) >+{ >+ settings["SLAVES"] = (list<string>)UI::QueryWidget (`id(key), `SelectedItems); >+} >+ >+/** > * Initialize a RadioButtonGroup > * Group called FOO has buttons FOO_bar FOO_qux and values bar qux > * @param key id of the widget >@@ -417,6 +436,26 @@ the firewall will be disabled.</p>"), > "handle": HandleIfcfg, > ], > >+ "BONDSLAVE": $[ >+ "widget": `multi_selection_box, >+ "label": _("Bond Slaves"), >+ "opt": [`shrinkable], >+ "items" : [ ], >+ "init": InitSlave, >+ "store": StoreSlave, >+ "help": _("<p>Select the salve devices for the bond device. Only the deveices which's Device Activation is Never and set as None Address Setup are available.</p>"), >+ ], >+ >+ "BONDOPTION": $[ >+ "widget": `combobox, >+ /* ComboBox label */ >+ "label": _("Bond Driver Options"), >+ "opt": [`hstretch, `editable], >+ "help": _("<p>Select the bond driver options, and edit it if you need. </p>"), >+ "items": [["mode=balance-rr"], ["mode=active-backup"], ["mode=balance-xor"], >+ ["mode=broadcast"], ["mode=802.3ad"], ["mode=balance-tlb"], ["mode=balance-alb"]], >+ ], >+ > "BOOTPROTO": $[ > "widget": `empty, > "help": "", >@@ -425,6 +464,15 @@ the firewall will be disabled.</p>"), > "store": StoreWidgetRbg, > ], > >+ "BOOTPROTO_none": $[ >+ "widget": `radio_button, >+ // radio button label >+ "label": _("None Address Setup"), >+ "opt": [`notify], >+ "init": CWM::InitNull, >+ "store": CWM::StoreNull >+ ], >+ > "BOOTPROTO_dhcp": $[ > "widget": `radio_button, > // radio button label >@@ -435,6 +483,8 @@ the firewall will be disabled.</p>"), > "help": > /* Address dialog help 2-6/8: dynamic address preferred */ > /* Address dialog help 2/8 */ >+ _("<p>You can select none address setup if you don't want any IP address.</p>") + >+ > _("<p>You can select dynamic address assignment > if you have a <b>DHCP server</b> running on your local network.</p> > ") + >@@ -743,7 +793,7 @@ define any AddressDialog() { > } > > // FIXME duplicated in hardware.ycp >- list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan" ]; >+ list<string> device_types = [ "arc", "bnep", "dummy", "eth", "fddi", "myri", "tr", "usb", "wlan", "bond" ]; > > if(Arch::s390 ()) > device_types = [ "eth", "tr", "hsi", "ctc", "escon", "iucv", "qeth", "lcs" ]; >@@ -849,6 +899,7 @@ Components of this product might not wor > `id ("BOOTPROTO"), // CWM must not expand `id > `MarginBox (1, 0, > `VBox ( >+ `Left ("BOOTPROTO_none"), > `Left ("BOOTPROTO_dhcp"), // TODO: widget attribute align: left > `Left ("BOOTPROTO_static"), > address_static_contents) >@@ -861,12 +912,54 @@ Components of this product might not wor > is_ptp? address_p2p_contents: > (no_dhcp? address_static_contents: address_dhcp_contents); > >- term address_contents = `HSquash(`VBox( >- `Left(label), >- just_address_contents, >- frame2, >- "_DIALOG" >- )); >+ term bond = `MarginBox(1, 0, `Frame( "", `VBox("BONDSLAVE", "BONDOPTION"))); >+ >+ if (Lan::type == "bond") >+ { >+ settings["SLAVES"] = Lan::bond_slaves; >+ >+ //get all eth devices >+ map<string, map<string, map<string, any> > > devices = (map<string, map<string, map<string, any> > >)NetworkDevices::FilterDevices(""); >+ map<string, map<string, any> > avails= devices["eth"]:$[]; >+ >+ //filter the eth devices (BOOT_PROTO=none && START_MODE=off) >+ foreach (string num, map<string, any> value, avails, >+ { >+ if (((string)value["BOOTPROTO"]:"" == "none") && ((string)value["STARTMODE"]:"" == "off")) >+ wd["BONDSLAVE", "items"] = add (wd["BONDSLAVE", "items"]:[], [NetworkDevices::device_name("eth", num)] ); >+ }); >+ >+ settings["BONDOPTION"] = Lan::bond_option; >+ >+ //fill up the drop list and make the default value first >+ wd["BONDOPTION", "items"] = filter(list<string> v, wd["BONDOPTION", "items"]:[], >+ { >+ return v[0]:"" != Lan::bond_option; >+ }); >+ wd["BONDOPTION", "items"] = prepend(wd["BONDOPTION", "items"]:[], [Lan::bond_option]); >+ } >+ >+ >+ term address_contents = nil; >+ if (Lan::type == "bond") >+ { >+ address_contents = `HSquash(`VBox( >+ `Left(label), >+ just_address_contents, >+ bond, >+ frame2, >+ "_DIALOG" >+ )); >+ } >+ else >+ { >+ address_contents = `HSquash(`VBox( >+ `Left(label), >+ just_address_contents, >+ frame2, >+ "_DIALOG" >+ )); >+ } > > map functions = $[ > "init" : InitAddrWidget, >@@ -965,6 +1058,12 @@ Components of this product might not wor > } > } > >+ if (Lan::type == "bond") >+ { >+ Lan::bond_option = settings["BONDOPTION"]:""; >+ Lan::bond_slaves = (list<string>)settings["SLAVES"]:[]; >+ } >+ > // proceed with WLAN settings if appropriate, #42420 > if (ret == `next && Lan::type == "wlan" && Lan::alias == "") > { >--- yast2-network-2.14.5.old/src/modules/Lan.ycp 2006-11-03 14:21:18.000000000 +0800 >+++ yast2-network-2.14.5/src/modules/Lan.ycp 2006-11-06 17:26:01.000000000 +0800 >@@ -98,6 +98,10 @@ global string wl_key_length = ""; > global list<string> wl_key = []; > global integer wl_default_key = 0; > global string wl_nick = ""; >+ >+//bond options >+global list<string> bond_slaves = []; >+global string bond_option=""; > /** > * wl_wpa_eap aggregates the settings in a map for easier CWM access. > * @struct wpa_eap >@@ -854,6 +858,8 @@ map<string, string> SysconfigDefaults = > "WIRELESS_CA_CERT": "", > "WIRELESS_EAP_AUTH": "", > "WIRELESS_PEAP_VERSION": "", >+ >+ "BONDING_MODULE_OPTS": "", > ]; > > string GetDeviceVar (map primary, map fallback, string key) { >@@ -882,6 +888,15 @@ void SetDeviceVars(map devmap, map defau > startmode = GetDeviceVar (devmap, defaults, "STARTMODE"); > usercontrol = GetDeviceVar (devmap, defaults, "USERCONTROL") == "yes"; > description = GetDeviceVar (devmap, defaults, "NAME"); >+ bond_option = GetDeviceVar(devmap, defaults, "BONDING_MODULE_OPTS"); >+ >+ bond_slaves=[]; >+ foreach(any key, any value, devmap, >+ { >+ if (regexpmatch((string)key, "BONDING_SLAVE[0-9]+")) >+ if ((string)value != nil) >+ bond_slaves = add(bond_slaves, (string)value); >+ }); > > /* wireless options */ > wl_mode = GetDeviceVar (devmap, defaults, "WIRELESS_MODE"); >@@ -1037,7 +1052,7 @@ global define boolean Select(string dev) > qeth_macaddress = devmap["LLADDR"]:"00:00:00:00:00:00"; > } > >- if(bootproto == "none") bootproto = "static"; >+ //if(bootproto == "none") bootproto = "static"; > > return true; > } >@@ -1196,6 +1211,29 @@ global define boolean Commit() { > if(hotplug == "pcmcia") > newdev["DHCLIENT_SET_DOWN_LINK"] = "yes"; > >+ >+ if (type == "bond") >+ { >+ integer i = 0; >+ foreach (string slave, bond_slaves, >+ { >+ newdev[sformat("BONDING_SLAVE%1", i)] = slave; >+ i = i + 1; >+ }); >+ >+ //assign nil to rest BONDING_SLAVEn to remove them >+ while (i<10) >+ { >+ newdev[sformat("BONDING_SLAVE%1", i)] = nil; >+ i = i + 1; >+ }; >+ >+ newdev["BONDING_MODULE_OPTS"] = bond_option; >+ >+ //BONDING_MASTER always is yes >+ newdev["BONDING_MASTER"] = "yes"; >+ } >+ > if(type == "wlan") { > newdev["WIRELESS_MODE"] = wl_mode; > newdev["WIRELESS_ESSID"] = wl_essid; >--- yast2-network-2.14.5.old/src/routines/complex.ycp 2006-11-03 14:21:18.000000000 +0800 >+++ yast2-network-2.14.5/src/routines/complex.ycp 2006-11-06 17:22:29.000000000 +0800 >@@ -295,6 +295,8 @@ define string CheckEmptyName(string devt > "wlan-usb" : _("USB Wireless Network Card"), > /* Device type label */ > "xp" : _("XP Network"), >+ /* Device type label */ >+ "bond" : _("Bond Network"), > ]; > > if(haskey(device_names, devtype)) >@@ -485,6 +487,8 @@ define list BuildOverviewDevs(map<string > "ifplugd": _("Started automatically on cable connection"), > // summary description of STARTMODE=managed > "managed": _("Managed by NetworkManager"), >+ // summary description of STARTMODE=off >+ "off": _("Never started"), > ]; > list<string> models = []; > foreach(map<string, any>row, (list<map<string, any> >)SCR::Read (.probe.netcard), { >@@ -547,6 +551,19 @@ foreach(map<string, any>row, (list<map<s > , ip, v["NETMASK"]:""), > ]; > } >+ >+ // build the "Bond Slaves" entry of rich box >+ if (type == "bond") >+ { >+ string slaves = ""; >+ foreach (string key, any value, (map<string, any>)v, { >+ if ((value != nil) && (regexpmatch(key, "BONDING_SLAVE[0-9]"))) >+ slaves = slaves + ((slaves != "") ? ", " : "") + (string)value; >+ }); >+ if (slaves != "") >+ bullets = bullets + [_("Bond slaves")+ " : " + slaves]; >+ } >+ > // create the rich text description > string rich = HTML::Bold ( sformat("%1 %2", descr, (contains(models, v["NAME"]:"") )?"":_("(not connected)"))) +"<br>"+ HTML::List (bullets); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 218663
:
104059
| 104060