Author: mzugec
Date: Tue Jul 17 07:38:38 2007
New Revision: 39452
URL: http://svn.opensuse.org/viewcvs/yast?rev=39452&view=rev
Log:
no more hwcfg files, don't use getcfg (#292085)
Modified:
trunk/network/VERSION
trunk/network/package/yast2-network.changes
trunk/network/src/clients/save_network.ycp
trunk/network/src/lan/address.ycp
trunk/network/src/lan/complex.ycp
trunk/network/src/modules/LanItems.ycp
trunk/network/src/routines/routines.ycp
Modified: trunk/network/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=39452&r1=39451&r2=39452&view=diff
==============================================================================
--- trunk/network/VERSION (original)
+++ trunk/network/VERSION Tue Jul 17 07:38:38 2007
@@ -1 +1 @@
-2.15.47
+2.15.48
Modified: trunk/network/package/yast2-network.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.changes?rev=39452&r1=39451&r2=39452&view=diff
==============================================================================
--- trunk/network/package/yast2-network.changes (original)
+++ trunk/network/package/yast2-network.changes Tue Jul 17 07:38:38 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Jul 17 07:37:01 CEST 2007 - mzugec@suse.de
+
+- no more hwcfg files, don't use getcfg (#292085)
+- 2.15.48
+
+-------------------------------------------------------------------
Fri Jul 13 22:02:40 CEST 2007 - kmachalkova@suse.cz
- Address dialog adapted for 80x25 terminal screen
Modified: trunk/network/src/clients/save_network.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/clients/save_network.ycp?rev=39452&r1=39451&r2=39452&view=diff
==============================================================================
--- trunk/network/src/clients/save_network.ycp (original)
+++ trunk/network/src/clients/save_network.ycp Tue Jul 17 07:38:38 2007
@@ -166,24 +166,19 @@
return "";
}
+/*
string getHWFullPath(string hwfile){
return sformat("%1/hwcfg-%2", "/etc/sysconfig/hardware", hwfile);
}
-
+*/
map hwcfg=$[];
-
+/*
string CreateHardwareFile(){
string hwfile="";
map hw=$[];
// read current hardware information and check if configuration file exists
hwcfg=getcfg("-f hwcfg- -d /etc/sysconfig/hardware", InstallInf["netdevice"]:"");
-//y2internal("hwcfg %1", hwcfg);
-/*
-foreach(map hw_temp, (list<map>)SCR::Read(.probe.netcard), {
-if (hwcfg["HWD_DEVICEPATH"]:"" == sformat("/sys%1", hw_temp["sysfs_id"]:"")) hw=hw_temp;
-});
-*/
hw=getHardware(hwcfg["HWD_DEVICEPATH"]:"", (list<map>)SCR::Read(.probe.netcard));
@@ -236,8 +231,9 @@
return hwfile;
}
+*/
-void CreateIfcfg(string hwcfg, string ifcfg){
+void CreateIfcfg(string ifcfg){
string network_configuration="";
// set BOOTPROTO=[ static | dhcp ]
if (InstallInf["bootproto"]:"dhcp"=="static") {
@@ -257,23 +253,27 @@
if (size(InstallInf["LLADDR"]:"")>0) network_configuration = sformat("%1LLADDR='%2'\n", network_configuration, InstallInf["LLADDR"]:"");
+/*
if (size(InstallInf["unique"]:"")>0)
{
// write UNIQUE - #suse25739
network_configuration = sformat("%1UNIQUE='%2'\n", network_configuration, InstallInf["unique"]:"");
+*/
// write UDI
+/*
list<map> cards=(list<map>)SCR::Read(.probe.netcard);
foreach(map card, cards, {
if (card["unique_key"]:""==InstallInf["unique"]:"") network_configuration = sformat("%1udi='%2'\n", network_configuration, card["udi"]:"");
});
}
+*/
if (network_disk){ network_configuration = sformat("%1STARTMODE='nfsroot'\n", network_configuration);
} else{network_configuration = sformat("%1STARTMODE='onboot'\n", network_configuration);
}
// reference to hardware configuration
- network_configuration = sformat("%1_nm_name='%2'\n", network_configuration, hwcfg);
+// network_configuration = sformat("%1_nm_name='%2'\n", network_configuration, hwcfg);
// point to point interface
if (size(InstallInf["remote_ip"]:"")>0)network_configuration = sformat("%1REMOTE_IPADDR='%2'\n", network_configuration, InstallInf["remote_ip"]:"");
@@ -341,7 +341,7 @@
integer new_SCR = WFM::SCROpen ("chroot=/:scr", false);
WFM::SCRSetDefault (new_SCR);
- SCR::Execute(.target.bash, sformat("cp /etc/sysconfig/hardware/* %1/etc/sysconfig/hardware/ 2>/dev/null", Installation::destdir));
+// SCR::Execute(.target.bash, sformat("cp /etc/sysconfig/hardware/* %1/etc/sysconfig/hardware/ 2>/dev/null", Installation::destdir));
// when root is on nfs/iscsi set startmode=nfsroot #176804
string device = NetworkStorage::getDevice( Installation::destdir );
@@ -360,10 +360,10 @@
WFM::SCRSetDefault (old_SCR);
if(ReadInstallInf()){
- string hwcfgname = CreateHardwareFile();
- string ifcfg = getIfcName(hwcfgname, hwcfg[sformat("HWD_INTERFACE_%1", tointeger(hwcfg["HWD_INTERFACE_N"]:"0")-1)]:"" );
+// string hwcfgname = CreateHardwareFile();
+ string ifcfg = sformat("ifcfg-%1", InstallInf["netdevice"]:""); //getIfcName(hwcfg[sformat("HWD_INTERFACE_%1", tointeger(hwcfg["HWD_INTERFACE_N"]:"0")-1)]:"" );
- CreateIfcfg(hwcfgname, ifcfg);
+ CreateIfcfg(ifcfg);
CreateOtherNetworkFiles();
SCR::Execute(.target.bash, "chkconfig network on");
Modified: trunk/network/src/lan/address.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/address.ycp?rev=39452&r1=39451&r2=39452&view=diff
==============================================================================
--- trunk/network/src/lan/address.ycp (original)
+++ trunk/network/src/lan/address.ycp Tue Jul 17 07:38:38 2007
@@ -681,9 +681,9 @@
1, 0,
`Frame(_("Detailed Settings"), `HBox(`HStretch(),
`HSquash(`VBox(
- `VSpacing(0.4),
- "ADVANCED_MB",
- `VSpacing(0.4)
+// `VSpacing(0.4),
+ "ADVANCED_MB"
+// `VSpacing(0.4)
)),
`HStretch()
)));
Modified: trunk/network/src/lan/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/complex.ycp?rev=39452&r1=39451&r2=39452&view=diff
==============================================================================
--- trunk/network/src/lan/complex.ycp (original)
+++ trunk/network/src/lan/complex.ycp Tue Jul 17 07:38:38 2007
@@ -134,7 +134,7 @@
Lan::Add ();
- LanItems::SelectHWMap(LanItems::Items[LanItems::current, "hwinfo"]:$[]);
+ LanItems::SelectHWMap(LanItems::getCurrentItem()["hwinfo"]:$[]);
LanItems::SetDefaultsForHW ();
@@ -216,6 +216,15 @@
NetworkService::SetManaged (value);
}
+void enableDisableButtons(){
+ LanItems::current = (integer)UI::QueryWidget (`id (`_hw_items), `CurrentItem);
+ UI::ChangeWidget(`_hw_sum, `Value,LanItems::GetItemDescription());
+ if (!LanItems::IsItemConfigured()) // unconfigured
+ UI::ChangeWidget(`id(`delete), `Enabled, false);
+ else UI::ChangeWidget(`id(`delete), `Enabled, true);
+ if (hasAnyValue(LanItems::getCurrentItem()["hwinfo", "dev_name"]:"")) UI::ChangeWidget(`id(`edit), `Enabled, true);
+ else UI::ChangeWidget(`id(`edit), `Enabled, false);
+}
void initOverview (string key) ``{
y2internal("init");
@@ -236,22 +245,14 @@
UI::ChangeWidget (`id (b), `Enabled, false);
});
}
- LanItems::current = (integer)UI::QueryWidget (`id (`_hw_items), `CurrentItem);
- UI::ChangeWidget(`_hw_sum, `Value,LanItems::GetItemDescription());
- if (!LanItems::IsItemConfigured()) // unconfigured
- UI::ChangeWidget(`id(`delete), `Enabled, false);
- else UI::ChangeWidget(`id(`delete), `Enabled, true);
+ enableDisableButtons();
}
symbol handleOverview( string key, map event ) {
- LanItems::current = (integer)UI::QueryWidget (`id (`_hw_items), `CurrentItem);
-
- if (!LanItems::IsItemConfigured()) // unconfigured
- UI::ChangeWidget(`id(`delete), `Enabled, false);
- else UI::ChangeWidget(`id(`delete), `Enabled, true);
+ enableDisableButtons();
UI::ChangeWidget(`_hw_sum, `Value,LanItems::GetItemDescription());
if (event["EventReason"]:"" == "Activated")
@@ -450,7 +451,7 @@
contents = CWM::PrepareDialog(contents, w);
Wizard::SetContentsButtons(caption, contents, help, Label::NextButton (), Label::FinishButton ());
- Wizard::HideBackButton();
+ Wizard::DisableBackButton();
symbol ret = CWM::Run(w, $[`abort:ReallyAbort ]);
Modified: trunk/network/src/modules/LanItems.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/LanItems.ycp?rev=39452&r1=39451&r2=39452&view=diff
==============================================================================
--- trunk/network/src/modules/LanItems.ycp (original)
+++ trunk/network/src/modules/LanItems.ycp Tue Jul 17 07:38:38 2007
@@ -206,11 +206,14 @@
NetworkDevices::CleanHotplugSymlink();
foreach(string tmpdevname, (list<string>)Map::Keys(NetworkDevices::FilterDevices("netcard")["eth"]:$[]), {
string confname = NetworkDevices::device_name("eth", tmpdevname);
- map config = getcfg(confname, "");
+y2internal("confname %1", confname);
+
+// map config = getcfg(confname, "");
integer pos = nil;
map val = $[];
foreach(integer key, map value, (map >)Items, {
- if (config["HWD_DEVICEPATH"]:"" == sformat("/sys%1", value["hwinfo", "sysfs_id"]:"")) {
+// if (config["HWD_DEVICEPATH"]:"" == sformat("/sys%1", value["hwinfo", "sysfs_id"]:"")) {
+ if (value["hwinfo", "dev_name"]:""==confname) {
pos = key;
val = value;
}
@@ -219,7 +222,7 @@
pos=size(Items);
Items[pos]=$[];
}
- Items[pos, "hwcfg"] = val[sformat("HWD_INTERFACE_%1", tointeger(val["HWD_INTERFACE_N"]:"0")-1)]:"";
+// Items[pos, "hwcfg"] = val[sformat("HWD_INTERFACE_%1", tointeger(val["HWD_INTERFACE_N"]:"0")-1)]:"";
Items[pos, "ifcfg"] = confname;
});
}
@@ -288,6 +291,10 @@
}
+global map getCurrentItem(){
+ return Items[current]:$[];
+}
+
/**
* Check if the given device has any virtual alias.
* @param dev device to be checked
Modified: trunk/network/src/routines/routines.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/routines/routines.ycp?rev=39452&r1=39451&r2=39452&view=diff
==============================================================================
--- trunk/network/src/routines/routines.ycp (original)
+++ trunk/network/src/routines/routines.ycp Tue Jul 17 07:38:38 2007
@@ -352,7 +352,7 @@
return need;
}
-
+/*
map getcfg(string options, string device){
map cfg=$[];
map output = (map )SCR::Execute(.target.bash_output,
@@ -366,6 +366,7 @@
y2milestone("%1 %2\n%3", options, device, cfg);
return cfg;
}
+*/
map getHardware(string sysfs_id, list<map> Hw){
map hardware = $[];
@@ -385,13 +386,14 @@
return true;
}
-string getIfcName(string hwfile, string devicename){
+string getIfcName(string devicename){
string ifcfg="";
string interfacetype = NetworkDevices::device_type( devicename );
// for special s390 interface types write static configuration
if (contains(["qeth", "hsi", "ctc", "lcs", "iucv"], interfacetype)){
y2internal("special device type %1", interfacetype);
- ifcfg=sformat("ifcfg-%1", hwfile);
+// ifcfg=sformat("ifcfg-%1", hwfile);
+ y2error("TODO: create ifcfg file for s390");
} else {
y2internal("usual type %1", interfacetype);
// if MAC available - use it for name
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org