Author: mzugec
Date: Mon Jun 11 17:46:35 2007
New Revision: 38385
URL: http://svn.opensuse.org/viewcvs/yast?rev=38385&view=rev
Log:
don't write hwcfg when not needed
Modified:
trunk/network/VERSION
trunk/network/package/yast2-network.changes
trunk/network/src/clients/save_network.ycp
trunk/network/src/modules/Lan.ycp
trunk/network/src/routines/hardware.ycp
trunk/network/src/routines/routines.ycp
trunk/network/src/routines/runtime.ycp
Modified: trunk/network/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=38385&r1=38384&r2=38385&view=diff
==============================================================================
--- trunk/network/VERSION (original)
+++ trunk/network/VERSION Mon Jun 11 17:46:35 2007
@@ -1 +1 @@
-2.15.43
+2.15.44
Modified: trunk/network/package/yast2-network.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.changes?rev=38385&r1=38384&r2=38385&view=diff
==============================================================================
--- trunk/network/package/yast2-network.changes (original)
+++ trunk/network/package/yast2-network.changes Mon Jun 11 17:46:35 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Jun 11 17:45:26 CEST 2007 - mzugec@suse.cz
+
+- don't write hwcfg when not needed
+- 2.15.44
+
+-------------------------------------------------------------------
Fri Jun 8 16:59:20 CEST 2007 - mzugec@suse.cz
- dsl module: auto reconnect option (#244503)
Modified: trunk/network/src/clients/save_network.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/clients/save_network.ycp?rev=38385&r1=38384&r2=38385&view=diff
==============================================================================
--- trunk/network/src/clients/save_network.ycp (original)
+++ trunk/network/src/clients/save_network.ycp Mon Jun 11 17:46:35 2007
@@ -21,6 +21,8 @@
import "Installation";
import "String";
+include "network/routines.ycp";
+
map InstallInf = $[];
// global variable because chrooted environment
@@ -189,12 +191,22 @@
string CreateHardwareFile(){
string hwfile="";
-
+ boolean need=false;
+ 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;
+});
+
+y2milestone("hwinfo %1", hw);
+
if( tointeger(hwcfg["HWD_CONFIG_N"]:"0")==0 ){
y2internal("hwcfg doesn't exist");
- // check if deriver is connected to bus
+
+y2internal("need hwcfg: %1", needHwcfg(hw));
+ // check if driver is connected to bus
if (tointeger(hwcfg["HWD_BUS_N"]:"0")>0){
string busname = hwcfg[sformat("HWD_BUSNAME_%1", tointeger(hwcfg["HWD_BUS_N"]:"0")-1)]:"";
string busid = hwcfg[sformat("HWD_BUSID_%1", tointeger(hwcfg["HWD_BUS_N"]:"0")-1)]:"";
@@ -210,7 +222,7 @@
y2internal("will create hwcfg file %1", hwfile);
} else {
hwfile = sformat("bus-%1-%2", busname, busid);
- y2internal("will create hwcfg file %1", hwfile);
+ y2internal("hwcfg filename %1", hwfile);
}
}
@@ -219,15 +231,22 @@
y2error("Not connected to bus! Using %1", hwfile);
}
string content=sformat("STARTMODE='auto'\nMODULE='%1'\nMODULE_OPTIONS='%2'\n", InstallInf["module"]:"", InstallInf["options"]:"");
- y2internal ("creating %1 file\n%2", hwfile, content);
- SCR::Write(.target.string, getHWFullPath(hwfile), content);
+ if (need) {
+ y2internal ("creating %1 file\n%2", hwfile, content);
+ SCR::Write(.target.string, getHWFullPath(hwfile), content);
+ }
+ else y2warning("no hwcfg needed");
}else {
// in case of s390 hwcfg is created by Linuxrc (uli)
y2warning("hwcfg already exists");
hwfile = hwcfg[sformat("HWD_CONFIG_%1", tointeger(hwcfg["HWD_CONFIG_N"]:"0")-1)]:"";
y2internal("configuration name = %1", hwfile);
}
- y2internal("Hardware file: %1", getHWFullPath(hwfile));
+ if (!need){
+ y2warning("no needed to create hwcfg file");
+ hwfile="";
+ } else
+ y2internal("Hardware file: %1", getHWFullPath(hwfile));
return hwfile;
}
Modified: trunk/network/src/modules/Lan.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/Lan.ycp?rev=38385&r1=38384&r2=38385&view=diff
==============================================================================
--- trunk/network/src/modules/Lan.ycp (original)
+++ trunk/network/src/modules/Lan.ycp Mon Jun 11 17:46:35 2007
@@ -465,10 +465,10 @@
void writeIPv6(){
if (ipv6){
- SCR::Execute(.target.bash_output, "echo '#install ipv6 /bin/true' > /etc/modprobe.d/ipv6");
+ SCR::Execute(.target.string, "#install ipv6 /bin/true", "/etc/modprobe.d/ipv6");
SCR::Write(.sysconfig.windowmanager.KDE_USE_IPV6, "yes");
} else {
- SCR::Execute(.target.bash_output, "echo 'install ipv6 /bin/true' > /etc/modprobe.d/ipv6");
+ SCR::Execute(.target.string, "install ipv6 /bin/true", "/etc/modprobe.d/ipv6");
SCR::Write(.sysconfig.windowmanager.KDE_USE_IPV6, "no");
}
}
@@ -677,48 +677,50 @@
* Select the hardware component
* @param hw the component
*/
-void SelectHWMap (map hw) {
- SelectHardwareMap (hw);
+void SelectHWMap (map hardware) {
+ SelectHardwareMap (hardware);
if(hotplug == "") {
// FIXME: MOD Module["module"] = hw["module"]:"";
// FIXME: MOD Module["options"] = hw["options"]:"";
- NetworkModules::Alias = hw["module"]:"";
- NetworkModules::Options = hw["options"]:"";
+ NetworkModules::Alias = hardware["module"]:"";
+ NetworkModules::Options = hardware["options"]:"";
}
else
y2milestone("HOTPLUG(%1) -> ignoring modprobe.conf", hotplug);
// Wireless Card Features
- wl_auth_modes = hw["wl_auth_modes"]:nilliststring;
- wl_enc_modes = hw["wl_enc_modes"]:nilliststring;
- wl_channels = hw["wl_channels"]:nilliststring;
- wl_bitrates = hw["wl_bitrates"]:nilliststring;
+ wl_auth_modes = hardware["wl_auth_modes"]:nilliststring;
+ wl_enc_modes = hardware["wl_enc_modes"]:nilliststring;
+ wl_channels = hardware["wl_channels"]:nilliststring;
+ wl_bitrates = hardware["wl_bitrates"]:nilliststring;
- string mac = hw["mac"]:"";
- string busid = hw["busid"]:"";
+ string mac = hardware["mac"]:"";
+ string busid = hardware["busid"]:"";
- nm_name = createHwcfgName(hw);
+
+ nm_name = createHwcfgName(hardware);
// name of ifcfg
/* eth, tr, not on s390 (#38819) */
if(!Arch::s390 () && mac != nil && mac != "" && mac != "00:00:00:00:00:00")
- device = "id-" + hw["mac"]:"";
+ device = "id-" + hardware["mac"]:"";
/* iucv already filled in from lan/hardware.ycp (#42212) */
else if(type == "iucv")
y2debug("IUCV: %1", device);
/* other devs */
else if(busid != nil && busid != "")
- device = "bus-" + hw["bus"]:"" + "-" + hw["busid"]:"";
+ device = "bus-" + hardware["bus"]:"" + "-" + hardware["busid"]:"";
/* USB, PCMCIA */
- else if(hw["hotplug"]:"" != "")
- device = "bus-" + hw["hotplug"]:"";
+ else if(hardware["hotplug"]:"" != "")
+ device = "bus-" + hardware["hotplug"]:"";
/* dummy */
else
y2milestone("No detailed HW info: %1", device);
- y2milestone("hw=%1", hw);
- y2milestone("device=%1", device);
+ y2milestone("hw=%1", hardware);
+ y2milestone("device=%1", device);
+ hw=hardware;
}
/**
@@ -892,7 +894,13 @@
else if (Arch::s390 () && contains (["lcs", "eth"], type))
{
mtu = "1492";
- }
+ }
+
+ if (!needHwcfg(hw)){
+ nm_name_old = nm_name;
+ nm_name = "";
+ }
+ y2milestone("hwcfg name %1", nm_name);
}
/**
Modified: trunk/network/src/routines/hardware.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/routines/hardware.ycp?rev=38385&r1=38384&r2=38385&view=diff
==============================================================================
--- trunk/network/src/routines/hardware.ycp (original)
+++ trunk/network/src/routines/hardware.ycp Mon Jun 11 17:46:35 2007
@@ -475,6 +475,7 @@
import "NetworkModules";
include "network/routines.ycp";
+
string createHwcfgName(map hw){
string hwcfg_name = "";
// name of hwcfg
Modified: trunk/network/src/routines/routines.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/routines/routines.ycp?rev=38385&r1=38384&r2=38385&view=diff
==============================================================================
--- trunk/network/src/routines/routines.ycp (original)
+++ trunk/network/src/routines/routines.ycp Mon Jun 11 17:46:35 2007
@@ -327,5 +327,24 @@
}
+boolean needHwcfg(map hw){
+ boolean need=true;
+ // if kernel will autoload module for device
+ if (hasAnyValue(hw["modalias"]:"")){
+ if (size(hw["drivers"]:[])>1) y2milestone("there are more modules available for device, hwcfg is needed");
+ else {
+ y2milestone("Just one autoloadable module available.No need to write hwcfg");
+ need=false;
+ }
+ } else
+ // not autoload because of built-in driver (compiled in kernel)
+ if (!hasAnyValue(hw["driver_module"]:"")) {
+ y2milestone("built-in driver %1", hw["driver"]:"");
+ need=false;
+ }
+ return need;
+}
+
+
/* EOF */
}
Modified: trunk/network/src/routines/runtime.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/routines/runtime.ycp?rev=38385&r1=38384&r2=38385&view=diff
==============================================================================
--- trunk/network/src/routines/runtime.ycp (original)
+++ trunk/network/src/routines/runtime.ycp Mon Jun 11 17:46:35 2007
@@ -45,44 +45,6 @@
return (SCR::Execute(.target.bash, sformat("/sbin/SuSEconfig --module %1", modul)) == 0);
}
-/**
- * Check if running on a local system or over a network
- * @return true if running on a local system
- * /
-boolean RunningLocal() {
- import "DNS";
- import "Hostname";
-
- string domain = DNS::domain;
- string hostname = DNS::hostname;
- string fqhostname = Hostname::MergeFQ(hostname, domain);
- string display = lookup((map) SCR::Execute(.target.bash_output, "echo $DISPLAY"), "output", nil);
- string ssh_client = lookup((map) SCR::Execute(.target.bash_output, "echo $SSH_CLIENT"), "output", nil);
-
- y2milestone("display=%1", display);
- y2milestone("ssh_client=%1", ssh_client);
- y2milestone("fqhostname=%1", fqhostname);
-
- /* $SSH_CLIENT:
- * if(not set) local
- * else REMOTE
- * /
- if(ssh_client != "" && ssh_client != nil) return false;
-
- /* $DISPLAY:
- * local
- * :0.0 local
- * localhost:0.0 local
- * beholder:0.0 local
- * wyvern:11.0 REMOTE
- * /
- if(display != "" && display != nil) {
- string dhost = splitstring(display, ":")[0]:"";
- if(dhost != "" && dhost != nil && dhost != "localhost" &&
- dhost != hostname && dhost != fqhostname) return false;
- }
- return true;
-}
/**
* Link detection
@@ -194,5 +156,9 @@
Desktop::RunViaDesktop ("kinternet", ["--quiet"]);
}
+
+
+
+
/* EOF */
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org