commit yast2-network for openSUSE:Factory
Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at Fri Jul 29 16:53:53 CEST 2011. -------- --- yast2-network/yast2-network.changes 2011-05-26 17:44:38.000000000 +0200 +++ /mounts/work_src_done/STABLE/yast2-network/yast2-network.changes 2011-07-22 18:10:11.000000000 +0200 @@ -1,0 +2,43 @@ +Fri Jul 22 17:49:47 CEST 2011 - mvidner@suse.cz + +- Support biosdevname=1 NIC naming scheme: don't write mac-based udev + rules (FATE#311332). +- STARMODE='nfsroot' also for FCoE (FATE#306855). +- Show NIC device names for unconfigured NICs (FATE#311335). +- Fixed configuring multiple interfaces with the same VLAN (FATE#311380, + FATE#309240, bnc#572747, bnc#588588) +- Make the hostname resolvable to our static address coming from + Linuxrc (bnc#664929). +- 2.21.0 + +------------------------------------------------------------------- +Fri Jul 22 17:49:46 CEST 2011 - jreidinger@suse.cz + +- Do not enable WIRELESS_POWER by default, some APs are broken + (FATE#309255). + +------------------------------------------------------------------- +Fri Jul 22 15:48:16 CEST 2011 - locilka@suse.cz + +- Obsoleted X-KDE-SubstituteUID replaced with xdg-su in Exec in + desktop files (bnc#540627) + +------------------------------------------------------------------- +Thu Jul 21 13:44:24 CEST 2011 - locilka@suse.cz + +- Fixed Firewall and SSH proposal to be still able to adjust SSH + independently on the firewall status (bnc#537980). +- 2.20.13 + +------------------------------------------------------------------- +Fri Jul 1 13:42:16 CEST 2011 - mvidner@suse.cz + +- Proofread texts for translation (by A.Turrini, bnc#703190). + +------------------------------------------------------------------- +Mon May 30 16:40:55 CEST 2011 - mvidner@suse.cz + +- WebYaST: also update /etc/hosts, for hostname -f (bnc#694283#c8) +- 2.20.12 + +------------------------------------------------------------------- @@ -4,0 +48,17 @@ + +------------------------------------------------------------------- +Wed Apr 13 16:17:19 CEST 2011 - mvidner@suse.cz + +- AutoYaST: networking/start_immediately was ignored (bnc#655571, bnc#675844) +- 2.20.11 + +------------------------------------------------------------------- +Tue Feb 15 15:19:47 CET 2011 - mvidner@suse.cz + +- DSL: linux-atm-lib.rpm was renamed to libatm1.rpm (bnc#668586) + +------------------------------------------------------------------- +Mon Jan 17 14:10:10 UTC 2011 - mvidner@novell.com + +- fixed progress messages being out of sync when writing LAN config + (reported by bmwiedemann) calling whatdependson for head-i586 Old: ---- noswitch.patch yast2-network-2.20.10.tar.bz2 New: ---- yast2-network-2.21.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.slZlSb/_old 2011-07-29 16:52:59.000000000 +0200 +++ /var/tmp/diff_new_pack.slZlSb/_new 2011-07-29 16:52:59.000000000 +0200 @@ -19,17 +19,16 @@ Name: yast2-network -Version: 2.20.10 -Release: 6 +Version: 2.21.0 +Release: 1 BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-network-2.20.10.tar.bz2 -Patch0: noswitch.patch +Source0: yast2-network-2.21.0.tar.bz2 Prefix: /usr Group: System/YaST -License: GPLv2+ +License: GPL v2 or later # should be required by devtools BuildRequires: perl-XML-Writer pkgconfig rpm BuildRequires: update-desktop-files @@ -37,9 +36,10 @@ BuildRequires: yast2-country BuildRequires: yast2-installation >= 2.15.27 -# NetworkStorage: adapt functions needed for iBFT (bnc#551380) -BuildRequires: yast2 >= 2.19.3 -Requires: yast2 >= 2.19.3 +# NetworkInterfaces::GetTypeFromIfcfg (bnc#572747) +BuildRequires: yast2 >= 2.21.6 +Requires: yast2 >= 2.21.6 + #netconfig (FaTE #303618) Requires: sysconfig >= 0.71.2 #GetLanguageCountry @@ -63,7 +63,7 @@ Summary: YaST2 - Network Configuration %package devel-doc -License: GPLv2+ + Group: System/YaST Summary: YaST2 - Developer documentation for yast2-network @@ -74,8 +74,7 @@ This package contains autogenerated documentation for yast2-network %prep -%setup -n yast2-network-2.20.10 -%patch0 -p1 +%setup -n yast2-network-2.21.0 %build %{prefix}/bin/y2tool y2autoconf @@ -145,5 +144,4 @@ %doc %{prefix}/share/doc/packages/yast2-network %exclude %{prefix}/share/doc/packages/yast2-network/COPYING %exclude %{prefix}/share/doc/packages/yast2-network/README - %changelog ++++++ yast2-network-2.20.10.tar.bz2 -> yast2-network-2.21.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/MAINTAINER new/yast2-network-2.21.0/MAINTAINER --- old/yast2-network-2.20.10/MAINTAINER 2006-11-06 14:35:04.000000000 +0100 +++ new/yast2-network-2.21.0/MAINTAINER 2011-03-22 16:22:24.000000000 +0100 @@ -1 +1 @@ -Michal Zugec <mzugec@suse.cz> +Martin Vidner <mvidner@suse.cz> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/VERSION new/yast2-network-2.21.0/VERSION --- old/yast2-network-2.20.10/VERSION 2011-01-03 16:00:07.000000000 +0100 +++ new/yast2-network-2.21.0/VERSION 2011-07-22 17:52:42.000000000 +0200 @@ -1 +1 @@ -2.20.10 +2.21.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/clients/firewall_stage1_finish.ycp new/yast2-network-2.21.0/src/clients/firewall_stage1_finish.ycp --- old/yast2-network-2.20.10/src/clients/firewall_stage1_finish.ycp 2009-10-05 13:17:47.000000000 +0200 +++ new/yast2-network-2.21.0/src/clients/firewall_stage1_finish.ycp 2011-07-22 15:01:24.000000000 +0200 @@ -28,20 +28,21 @@ y2debug("func=%1", func); y2debug("param=%1", param); +//we have those from the proposal +boolean fw_enabled = SuSEFirewall4Network::Enabled1stStage(); +boolean ssh_enabled = SuSEFirewall4Network::EnabledSsh1stStage(); + if (func == "Info") { return (any)$[ "steps" : 1, // progress step title "title" : _("Writing Firewall Configuration..."), - "when" : SuSEFirewallProposal::GetChangedByUser() ? [ `installation, `autoinst ] : [], + "when" : (SuSEFirewallProposal::GetChangedByUser() || ssh_enabled) ? [ `installation, `autoinst ] : [], ]; } else if (func == "Write") { - //we have those from the proposal - boolean fw_enabled = SuSEFirewall4Network::Enabled1stStage(); - boolean ssh_enabled = SuSEFirewall4Network::EnabledSsh1stStage(); y2milestone("After installation, firewall will be %1", fw_enabled ? sformat("enabled, ssh port will be %1", ssh_enabled ? "open" : "closed") : "disabled"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/clients/firewall_stage1_proposal.ycp new/yast2-network-2.21.0/src/clients/firewall_stage1_proposal.ycp --- old/yast2-network-2.20.10/src/clients/firewall_stage1_proposal.ycp 2010-01-20 17:24:12.000000000 +0100 +++ new/yast2-network-2.21.0/src/clients/firewall_stage1_proposal.ycp 2011-07-22 15:01:24.000000000 +0200 @@ -127,8 +127,6 @@ SuSEFirewall4Network::SetSshEnabled1stStage (ProductFeatures::GetBooleanFeature ("globals", "firewall_enable_ssh")); } - SuSEFirewall4Network::SetSshEnabled1stStage (ProductFeatures::GetBooleanFeature ("globals", "firewall_enable_ssh")); - SuSEFirewallProposal::SetProposalInitialized(true); } @@ -147,27 +145,23 @@ _("Firewall will be disabled (<a href=\"firewall--enable_firewall_in_proposal\">enable</a>)") ) + "</li>\n"; - if (SuSEFirewall4Network::Enabled1stStage()) - { - output = output + "<li>" + (SuSEFirewall4Network::EnabledSsh1stStage() ? - _("SSH service will be enabled, SSH port will be open (<a href=\"firewall--disable_ssh_in_proposal\">disable and close</a>)") - : - _("SSH service will be disabled, SSH port will be blocked (<a href=\"firewall--enable_ssh_in_proposal\">enable and open</a>)") - ) + "</li>\n"; + output = output + "<li>" + (SuSEFirewall4Network::EnabledSsh1stStage() ? + _("SSH service will be enabled, SSH port will be open (<a href=\"firewall--disable_ssh_in_proposal\">disable and close</a>)") + : + _("SSH service will be disabled, SSH port will be blocked (<a href=\"firewall--enable_ssh_in_proposal\">enable and open</a>)") + ) + "</li>\n"; - } output = output + "</ul>\n"; ret = $[ - "preformatted_proposal" : output, - "warning_level" : `warning, - //"warning" : proposal["warning"]:nil, - "links" : [ - "firewall--enable_firewall_in_proposal", "firewall--disable_firewall_in_proposal", - "firewall--enable_ssh_in_proposal", "firewall--disable_ssh_in_proposal", - ] - ]; - + "preformatted_proposal" : output, + "warning_level" : `warning, + //"warning" : proposal["warning"]:nil, + "links" : [ + "firewall--enable_firewall_in_proposal", "firewall--disable_firewall_in_proposal", + "firewall--enable_ssh_in_proposal", "firewall--disable_ssh_in_proposal", + ] + ]; } else if ( func == "AskUser" ) { any chosen_link = param["chosen_id"]:nil; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/clients/network.ycp new/yast2-network-2.21.0/src/clients/network.ycp --- old/yast2-network-2.20.10/src/clients/network.ycp 2006-11-06 14:34:53.000000000 +0100 +++ new/yast2-network-2.21.0/src/clients/network.ycp 2011-07-01 13:42:31.000000000 +0200 @@ -4,7 +4,7 @@ * Summary: Main network client * Authors: Michal Svec <msvec@suse.cz> * - * $Id: network.ycp 33494 2006-10-18 12:17:01Z kmachalkova $ + * $Id: network.ycp 64700 2011-07-01 11:42:29Z mvidner $ * * Main file for the network configuration. * Uses all other files. @@ -129,10 +129,10 @@ map cmdline_description = $[ "id" : "network", - // translators: command line help for HTTP server module + // translators: command line help for network module "help" : _("Configuration of network. -This is only executer of network sub-modules. -You can run this network modules: +This is only a delegator to network sub-modules. +You can run these network modules: lan ")+ _("Network Card") +(" isdn ")+ _("ISDN Card") +(" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/clients/save_network.ycp new/yast2-network-2.21.0/src/clients/save_network.ycp --- old/yast2-network-2.20.10/src/clients/save_network.ycp 2010-12-20 15:31:58.000000000 +0100 +++ new/yast2-network-2.21.0/src/clients/save_network.ycp 2011-07-22 17:31:40.000000000 +0200 @@ -223,132 +223,122 @@ list<map> hardware=ReadHardware("netcard"); y2milestone("hardware %1", hardware); +string StdoutOf(string command) { + map out = (map) SCR::Execute (.target.bash_output, command); + return out["stdout"]:""; +} - -void CreateIfcfg(){ - string network_configuration=""; +void CreateIfcfg() { + string ifcfg=""; if (network_disk==1 && contains(NetworkStorage::getiBFTDevices(), InstallInf["netdevice"]:"")){ - network_configuration = sformat("%1STARTMODE='nfsroot'\nBOOTPROTO='ibft'\n", network_configuration); - } else { - - // set BOOTPROTO=[ static | dhcp ] - if (InstallInf["bootproto"]:"dhcp"=="static") - { - // add broadcast interface #suse49131 - network_configuration=sformat("BOOTPROTO='static'\nIPADDR='%1/%2'\nBROADCAST='%3'\n", - InstallInf["ipaddr"]:"", Netmask::ToBits(InstallInf["netmask"]:""), InstallInf["bcast"]:""); - if(size(InstallInf["ipaddr6"]:"")>0){ - network_configuration=sformat("%1\n%2", network_configuration, - sformat("LABEL_ipv6='ipv6'\nIPADDR_ipv6='%1'\n", InstallInf["ipaddr6"]:"") - ); - } - } - else - { - //DHCP (also for IPv6) setup - if (InstallInf["bootproto"]:""=="dhcp") network_configuration="BOOTPROTO='dhcp4'\n"; - else if (InstallInf["bootproto"]:""=="dhcp6") network_configuration="BOOTPROTO='dhcp6'\n"; - else if (InstallInf["bootproto"]:""=="dhcp,dhcp6") network_configuration="BOOTPROTO='dhcp'\n"; - - // set DHCP_SET_HOSTNAME=yes #suse30528 - y2milestone("set DHCLIENT_SET_HOSTNAME=yes on installed system"); - SCR::Execute(.target.bash_output, "sed -i s/\"DHCLIENT_SET_HOSTNAME=.*\"/'DHCLIENT_SET_HOSTNAME=\"yes\"'/g /etc/sysconfig/network/dhcp"); - } - - switch(network_disk) - { - case 0: - network_configuration = sformat("%1STARTMODE='onboot'\n", network_configuration); - break; - case 1: - if (!contains(NetworkStorage::getiBFTDevices(), InstallInf["netdevice"]:"")){ - network_configuration = sformat("%1STARTMODE='nfsroot'\n", network_configuration); - } - break; - case 3: // FCoE case - create VLAN configuration - map<string,any> cmd = (map<string,any>) SCR::Execute(.target.bash_output, - "ls -la /sys/block/*|grep target|grep eth|cut -d'>' -f2|cut -d'/' -f5|uniq"); - y2internal("cmd %1", cmd); - if (cmd["exit"]:-1==0){ - string ifcfg = splitstring(cmd["stdout"]:"", "\n")[0]:""; - y2internal("ifcfg: %1", ifcfg); - string config=sformat("BOOTPROTO=\"static\"\nSTARTMODE=\"nfsroot\" -ETHERDEVICE=\"%1\"\nUSERCONTROL=\"no\"\n", splitstring(ifcfg, ".")[0]:""); - y2internal("config: %1", config); - string config_file=sformat("/etc/sysconfig/network/ifcfg-%1", ifcfg); - y2internal("filename: %1", config_file); - SCR::Write(.target.string, config_file, config); - } else y2error("Command failed."); - case 2: - network_configuration = sformat("%1STARTMODE='nfsroot'\n", network_configuration); - break; - } - - } - - - // wireless devices (bnc#223570) - if ( size(InstallInf["WESSID"]:"")>0 ) - { - network_configuration = sformat("%1WIRELESS_ESSID='%2'\n", network_configuration, InstallInf["WESSID"]:""); -// network_configuration = sformat("%1WIRELESS_AUTH_MODE='%2'\n", network_configuration, InstallInf["WAuth"]:""); - switch(InstallInf["WAuth"]:""){ - case "" : // "" means wpa-psk - case "psk" : - network_configuration = sformat("%1WIRELESS_WPA_PSK='%2'\n", network_configuration, InstallInf["WKey"]:""); - network_configuration = sformat("%1WIRELESS_AUTH_MODE='psk'\n", network_configuration); - break; - case "open" : - network_configuration = sformat("%1WIRELESS_AUTH_MODE='no-encryption'\n", network_configuration); - break; - case "wep_open" : - case "wep_restricted" : - string type=""; - if (InstallInf["WkeyType"]:""=="password") type="h:"; - else if (InstallInf["WkeyType"]:""=="ascii") type="s:"; - network_configuration = sformat("%1WIRELESS_AUTH_MODE='%2'\n", network_configuration, (InstallInf["WAuth"]:""=="wep-open") ? "open" : "sharedkey"); - network_configuration = sformat("%1WIRELESS_DEFAULT_KEY='0'\n", network_configuration); - network_configuration = sformat("%1WIRELESS_KEY_0='%2%3'\n", network_configuration, type, InstallInf["WKey"]:""); - network_configuration = sformat("%1WIRELESS_KEY_LENGTH='%2'\n", network_configuration, InstallInf["WKeyLen"]:""); - if (size(InstallInf["WKeyType"]:"")>0 && size(InstallInf["WKey"]:"")>0) - network_configuration = sformat("%1WIRELESS_KEY_0='%2:%3'\n", network_configuration, - substring(InstallInf["WKeyType"]:"", 0, 1), InstallInf["WKey"]:""); - break; - } - } - - - // if available, write MTU - if (size(InstallInf["mtu"]:"")>0) - network_configuration = sformat("%1MTU='%2'\n", network_configuration, InstallInf["mtu"]:""); + ifcfg = sformat("%1STARTMODE='nfsroot'\nBOOTPROTO='ibft'\n", ifcfg); + } + else { + // set BOOTPROTO=[ static | dhcp ] + if (InstallInf["bootproto"]:"dhcp"=="static") { + // add broadcast interface #suse49131 + ifcfg=sformat("BOOTPROTO='static'\nIPADDR='%1/%2'\nBROADCAST='%3'\n", + InstallInf["ipaddr"]:"", Netmask::ToBits(InstallInf["netmask"]:""), InstallInf["bcast"]:""); + if(size(InstallInf["ipaddr6"]:"")>0){ + ifcfg=sformat("%1\n%2", ifcfg, + sformat("LABEL_ipv6='ipv6'\nIPADDR_ipv6='%1'\n", InstallInf["ipaddr6"]:"") + ); + } + } + else { + //DHCP (also for IPv6) setup + if (InstallInf["bootproto"]:""=="dhcp") ifcfg="BOOTPROTO='dhcp4'\n"; + else if (InstallInf["bootproto"]:""=="dhcp6") ifcfg="BOOTPROTO='dhcp6'\n"; + else if (InstallInf["bootproto"]:""=="dhcp,dhcp6") ifcfg="BOOTPROTO='dhcp'\n"; + + // set DHCP_SET_HOSTNAME=yes #suse30528 + y2milestone("set DHCLIENT_SET_HOSTNAME=yes on installed system"); + SCR::Execute(.target.bash_output, "sed -i s/\"DHCLIENT_SET_HOSTNAME=.*\"/'DHCLIENT_SET_HOSTNAME=\"yes\"'/g /etc/sysconfig/network/dhcp"); + } + + if (network_disk == 0) { + ifcfg = sformat("%1STARTMODE='onboot'\n", ifcfg); + } + else if (network_disk > 0) { + ifcfg = sformat("%1STARTMODE='nfsroot'\n", ifcfg); + } + } - // for queth devices (s390) - // bnc#578689 - YaST2 should not write the MAC address into ifcfg file - if ((Arch::s390()) && (size(InstallInf["hwaddr"]:"")>0)) - network_configuration = sformat("%1LLADDR='%2'\n", network_configuration, InstallInf["hwaddr"]:""); + // wireless devices (bnc#223570) + if ( size(InstallInf["WESSID"]:"")>0 ) { + ifcfg = sformat("%1WIRELESS_ESSID='%2'\n", ifcfg, InstallInf["WESSID"]:""); + + switch(InstallInf["WAuth"]:"") { + case "" : // "" means wpa-psk + case "psk" : + ifcfg = sformat("%1WIRELESS_WPA_PSK='%2'\n", ifcfg, InstallInf["WKey"]:""); + ifcfg = sformat("%1WIRELESS_AUTH_MODE='psk'\n", ifcfg); + break; + case "open" : + ifcfg = sformat("%1WIRELESS_AUTH_MODE='no-encryption'\n", ifcfg); + break; + case "wep_open" : + case "wep_restricted" : + string type=""; + if (InstallInf["WkeyType"]:""=="password") type="h:"; + else if (InstallInf["WkeyType"]:""=="ascii") type="s:"; + ifcfg = sformat("%1WIRELESS_AUTH_MODE='%2'\n", ifcfg, (InstallInf["WAuth"]:""=="wep-open") ? "open" : "sharedkey"); + ifcfg = sformat("%1WIRELESS_DEFAULT_KEY='0'\n", ifcfg); + ifcfg = sformat("%1WIRELESS_KEY_0='%2%3'\n", ifcfg, type, InstallInf["WKey"]:""); + ifcfg = sformat("%1WIRELESS_KEY_LENGTH='%2'\n", ifcfg, InstallInf["WKeyLen"]:""); + if (size(InstallInf["WKeyType"]:"")>0 && size(InstallInf["WKey"]:"")>0) { + ifcfg = sformat("%1WIRELESS_KEY_0='%2:%3'\n", ifcfg, + substring(InstallInf["WKeyType"]:"", 0, 1), InstallInf["WKey"]:""); + } + break; + } + } + // if available, write MTU + if (size(InstallInf["mtu"]:"")>0) { + ifcfg = sformat("%1MTU='%2'\n", ifcfg, InstallInf["mtu"]:""); + } + // for queth devices (s390) + // bnc#578689 - YaST2 should not write the MAC address into ifcfg file + if ((Arch::s390()) && (size(InstallInf["hwaddr"]:"")>0)) { + ifcfg = sformat("%1LLADDR='%2'\n", ifcfg, InstallInf["hwaddr"]:""); + } // point to point interface - if (size(InstallInf["remote_ip"]:"")>0) - network_configuration = sformat("%1REMOTE_IPADDR='%2'\n", network_configuration, InstallInf["remote_ip"]:""); + if (size(InstallInf["remote_ip"]:"")>0) { + ifcfg = sformat("%1REMOTE_IPADDR='%2'\n", ifcfg, InstallInf["remote_ip"]:""); + } - string ifcfg = sformat("ifcfg-%1", netdevice); + string new_netdevice = netdevice; + if (! LanUdevAuto::AllowUdevModify()) { + string cmd = sformat("biosdevname --policy=all_names -i %1", netdevice); + string out = String::FirstChunk(StdoutOf(cmd), "\n"); + if (out != "") { + y2milestone ("biosdevname renames %1 to %2", netdevice, out); + new_netdevice = out; + } + } + + string ifcfg_name = sformat("ifcfg-%1", new_netdevice); - string hw_name = BuildDescription(NetworkInterfaces::device_type(netdevice), NetworkInterfaces::device_num(ifcfg), $["dev_name":netdevice], hardware); + string hw_name = BuildDescription(NetworkInterfaces::device_type(netdevice), + NetworkInterfaces::device_num(ifcfg_name), + $["dev_name":netdevice], + hardware); // protect special characters, #305343 - if (size(hw_name)>0) - network_configuration = sformat("%1NAME='%2'\n", network_configuration, String::Quote (hw_name)); + if (size(hw_name)>0) { + ifcfg = sformat("%1NAME='%2'\n", ifcfg, String::Quote (hw_name)); + } - y2milestone("Network Configuration:\n%1\nifcfg file: %2", network_configuration, ifcfg); + y2milestone("Network Configuration:\n%1\nifcfg file: %2", ifcfg, ifcfg_name); // write only if file doesn't exists - string dev_file=sformat("/etc/sysconfig/network/%1", ifcfg); - // string dev_file=sformat("/tmp/%1", ifcfg); + string dev_file=sformat("/etc/sysconfig/network/%1", ifcfg_name); - SCR::Write(.target.string, dev_file, network_configuration); - y2milestone("ifcfg file: %1", dev_file); + SCR::Write(.target.string, dev_file, ifcfg); + y2milestone("ifcfg file: %1", dev_file); } /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/installation/inst_hostname.ycp new/yast2-network-2.21.0/src/installation/inst_hostname.ycp --- old/yast2-network-2.20.10/src/installation/inst_hostname.ycp 2010-03-16 13:41:08.000000000 +0100 +++ new/yast2-network-2.21.0/src/installation/inst_hostname.ycp 2011-07-22 17:19:32.000000000 +0200 @@ -14,6 +14,7 @@ import "Arch"; import "DNS"; import "GetInstArgs"; +import "Host"; import "NetworkConfig"; import "String"; import "Wizard"; @@ -57,6 +58,10 @@ if (ret == `next) { + Host::Read(); + Host::ResolveHostnameToStaticIPs(); + Host::Write(); + // do not let Lan override us, #152218 DNS::proposal_valid = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/lan/YaPI/NETWORK.pm new/yast2-network-2.21.0/src/lan/YaPI/NETWORK.pm --- old/yast2-network-2.20.10/src/lan/YaPI/NETWORK.pm 2010-12-20 15:31:59.000000000 +0100 +++ new/yast2-network-2.21.0/src/lan/YaPI/NETWORK.pm 2011-05-30 16:33:26.000000000 +0200 @@ -4,11 +4,11 @@ use YaST::YCP qw(:LOGGING); use YaPI; use Data::Dumper; -use Switch; # ------------------- imported modules YaST::YCP::Import ("LanItems"); YaST::YCP::Import ("Hostname"); +YaST::YCP::Import ("Host"); YaST::YCP::Import ("DNS"); YaST::YCP::Import ("Routing"); # ------------------------------------- @@ -19,43 +19,53 @@ # TODO: parameter map<string, boolean> what_I_Need BEGIN{$TYPEINFO{Read} = ["function", - [ "map", "string", "any"]]; + [ "map", "string", "any"]]; } sub Read { - my $self = shift; + my $self = shift; -# Hostname->Read(); - DNS->Read(); - Routing->Read(); - LanItems->Read(); - - my %interfaces = (); - foreach my $devnum (keys %{LanItems->Items}){ - LanItems->current($devnum); - if (LanItems->IsItemConfigured()){ - my %configuration = (); - LanItems->SetItem(); - if (LanItems->isCurrentDHCP()){ - %configuration = ( 'bootproto' => LanItems->bootproto ); - } elsif (LanItems->bootproto eq "static"){ - %configuration = ( 'bootproto' => 'static' ); - $configuration{'ipaddr'} = LanItems->ipaddr . "/" . LanItems->prefix; - } - $interfaces{LanItems->interfacename}=\%configuration; - } elsif (LanItems->getCurrentItem()->{'hwinfo'}->{'type'} eq "eth") { - my $device = LanItems->getCurrentItem()->{"hwinfo"}->{"dev_name"}; - $interfaces{$device}= {}; + DNS->Read(); + Routing->Read(); + LanItems->Read(); + + my %interfaces = (); + foreach my $devnum (keys %{LanItems->Items}){ + LanItems->current($devnum); + if (LanItems->IsItemConfigured()){ + my %configuration = (); + LanItems->SetItem(); + if (LanItems->isCurrentDHCP()){ + %configuration = ( 'bootproto' => LanItems->bootproto ); + } elsif (LanItems->bootproto eq "static"){ + %configuration = ( 'bootproto' => 'static' ); + $configuration{'ipaddr'} = LanItems->ipaddr . "/" . LanItems->prefix; + } + $interfaces{LanItems->interfacename}=\%configuration; + } elsif (LanItems->getCurrentItem()->{'hwinfo'}->{'type'} eq "eth") { + my $device = LanItems->getCurrentItem()->{"hwinfo"}->{"dev_name"}; + $interfaces{$device}= {}; } - } + } - #FIXME: validate for nil values (dns espacially) - my %ret = ('interfaces'=>\%interfaces, - 'routes'=>{'default'=>{'via'=>Routing->GetGateway()}}, - 'dns'=>{'nameservers'=>\@{DNS->nameservers}, 'searches'=>\@{DNS->searchlist}}, - 'hostname'=>{'name'=>Hostname->CurrentHostname, 'domain'=>Hostname->CurrentDomain, 'dhcp_hostname'=>DNS->dhcp_hostname} -# 'hostname'=>{'name'=>Hostname->CurrentHostname, 'domain'=>Hostname->CurrentDomain} - ); - return \%ret; + #FIXME: validate for nil values (dns espacially) + my %ret = ( + 'interfaces' => \%interfaces, + 'routes' => { + 'default' => { + 'via' => Routing->GetGateway() + } + }, + 'dns' => { + 'nameservers' => \@{DNS->nameservers}, + 'searches' => \@{DNS->searchlist} + }, + 'hostname' => { + 'name' => Hostname->CurrentHostname, + 'domain' => Hostname->CurrentDomain, + 'dhcp_hostname' => DNS->dhcp_hostname + } + ); + return \%ret; } sub writeRoute { @@ -66,121 +76,124 @@ my $dest=""; my @route = (); if (defined ($args->{'route'}->{'default'}->{'via'})){ - $gw = $args->{'route'}->{'default'}->{'via'}; - if ($gw ne ""){ - YaST::YCP::Import ("IP"); - unless (IP->Check4($gw)) { - $ret{'exit'} = -1; - $ret{'error'} = IP->Valid4(); - return \%ret; - }; - $dest = "default"; - @route = ( {"destination" => $dest, + $gw = $args->{'route'}->{'default'}->{'via'}; + if ($gw ne ""){ + YaST::YCP::Import ("IP"); + unless (IP->Check4($gw)) { + $ret{'exit'} = -1; + $ret{'error'} = IP->Valid4(); + return \%ret; + }; + $dest = "default"; + @route = ( {"destination" => $dest, "gateway" => $gw, "netmask" => "-", "device" => "-" - }); - } + }); + } } Routing->Read(); y2milestone("YaPI->Write before change Routes:", Dumper(Routing->Routes)); Routing->Routes( \@route ); y2milestone("YaPI->Write after change Routes:", Dumper(Routing->Routes)); Routing->Write(); - return \%ret; + return \%ret; } sub writeHostname { - my $args = shift; - my $ret = {'exit'=>0, 'error'=>''}; - y2milestone("hostname", Dumper(\$args->{'hostname'})); - DNS->Read(); - DNS->hostname($args->{'hostname'}->{'name'}); - DNS->domain($args->{'hostname'}->{'domain'}); - DNS->dhcp_hostname($args->{'hostname'}->{'dhcp_hostname'}) if (defined $args->{'hostname'}->{'dhcp_hostname'}); - DNS->modified(1); - DNS->Write(); - return $ret; + my $args = shift; + my $ret = {'exit'=>0, 'error'=>''}; + y2milestone("hostname", Dumper(\$args->{'hostname'})); + DNS->Read(); + DNS->hostname($args->{'hostname'}->{'name'}); + DNS->domain($args->{'hostname'}->{'domain'}); + DNS->dhcp_hostname($args->{'hostname'}->{'dhcp_hostname'}) if (defined $args->{'hostname'}->{'dhcp_hostname'}); + DNS->modified(1); + DNS->Write(); + Host->Read(); + Host->EnsureHostnameResolvable(); + Host->Write(); + return $ret; } sub writeDNS { - my $args = shift; - my $ret = {'exit'=>0, 'error'=>''}; - y2milestone("dns", Dumper(\$args->{'dns'})); - DNS->Read(); - DNS->nameservers($args->{'dns'}->{'nameservers'}); - DNS->searchlist($args->{'dns'}->{'searches'}); - DNS->modified(1); - DNS->Write(); - return $ret; + my $args = shift; + my $ret = {'exit'=>0, 'error'=>''}; + y2milestone("dns", Dumper(\$args->{'dns'})); + DNS->Read(); + DNS->nameservers($args->{'dns'}->{'nameservers'}); + DNS->searchlist($args->{'dns'}->{'searches'}); + DNS->modified(1); + DNS->Write(); + return $ret; } sub writeInterfaces { - my $args = shift; - my $ret = {'exit'=>0, 'error'=>''}; - y2milestone("interface", Dumper(\$args->{'interface'})); - foreach my $dev (keys %{$args->{'interface'}}){ - YaST::YCP::Import ("NetworkInterfaces"); - NetworkInterfaces->Read(); - NetworkInterfaces->Add() unless NetworkInterfaces->Edit($dev); - NetworkInterfaces->Name($dev); - my $ip = $args->{'interface'}->{$dev}->{'ipaddr'}; - my $prefix="32"; - YaST::YCP::Import ("Netmask"); - my @ip_row = split(/\//, $ip); - $prefix = $ip_row[$#ip_row]; - if (Netmask->Check4($prefix) && $prefix =~ /\./){ - y2milestone("Valid netmask: ", $prefix, " will change to prefixlen"); - $prefix = Netmask->ToBits($prefix); - } - $ip = $ip_row[0]."/".$prefix; - my %config=("STARTMODE" => "auto", - "BOOTPROTO" => $args->{'interface'}->{$dev}->{'bootproto'}, - "IPADDR" => $ip - ); - NetworkInterfaces->Current(\%config); - NetworkInterfaces->Commit(); - NetworkInterfaces->Write(""); - YaST::YCP::Import ("Service"); - Service->Restart("network"); - } - return $ret; + my $args = shift; + my $ret = {'exit'=>0, 'error'=>''}; + y2milestone("interface", Dumper(\$args->{'interface'})); + foreach my $dev (keys %{$args->{'interface'}}){ + YaST::YCP::Import ("NetworkInterfaces"); + NetworkInterfaces->Read(); + NetworkInterfaces->Add() unless NetworkInterfaces->Edit($dev); + NetworkInterfaces->Name($dev); + my $ip = $args->{'interface'}->{$dev}->{'ipaddr'}; + my $prefix="32"; + YaST::YCP::Import ("Netmask"); + my @ip_row = split(/\//, $ip); + $prefix = $ip_row[$#ip_row]; + if (Netmask->Check4($prefix) && $prefix =~ /\./){ + y2milestone("Valid netmask: ", $prefix, " will change to prefixlen"); + $prefix = Netmask->ToBits($prefix); + } + $ip = $ip_row[0]."/".$prefix; + my %config=("STARTMODE" => "auto", + "BOOTPROTO" => $args->{'interface'}->{$dev}->{'bootproto'}, + "IPADDR" => $ip + ); + NetworkInterfaces->Current(\%config); + NetworkInterfaces->Commit(); + NetworkInterfaces->Write(""); + YaST::YCP::Import ("Service"); + Service->Restart("network"); + } + return $ret; } BEGIN{$TYPEINFO{Write} = ["function", - ["map","string","any"],["map","string","any"]]; + ["map","string","any"],["map","string","any"]]; } sub Write { - my $self = shift; - my $args = shift; - y2milestone("YaPI->Write with settings:", Dumper(\$args)); - - # SAVE DEFAULT ROUTE - if (exists($args->{'route'})){ - my $route_ret = writeRoute($args); - return $route_ret if ($route_ret->{'exit'} != 0); - } - # SAVE HOSTNAME - if (exists($args->{'hostname'})){ - my $hn_ret = writeHostname($args); - return $hn_ret if ($hn_ret->{'exit'} != 0); - } - # SAVE DNS Settings - if (exists($args->{'dns'})){ - my $dns_ret = writeDNS($args); - return $dns_ret if ($dns_ret->{'exit'} != 0); - } - # SAVE interfaces Settings - if (exists($args->{'interface'})){ - my $ifc_ret = writeInterfaces($args); - return $ifc_ret if ($ifc_ret->{'exit'} != 0); - } - - # return value for exit is type integer, but it'll be converted into string (in yast-perl-bindings) - # that means in rest-api it'll be {'exit'=>'0', 'error'=>''} - return {'exit'=>0, 'error'=>''}; + my $self = shift; + my $args = shift; + y2milestone("YaPI->Write with settings:", Dumper(\$args)); + + # SAVE DEFAULT ROUTE + if (exists($args->{'route'})){ + my $route_ret = writeRoute($args); + return $route_ret if ($route_ret->{'exit'} != 0); + } + # SAVE HOSTNAME + if (exists($args->{'hostname'})){ + my $hn_ret = writeHostname($args); + return $hn_ret if ($hn_ret->{'exit'} != 0); + } + # SAVE DNS Settings + if (exists($args->{'dns'})){ + my $dns_ret = writeDNS($args); + return $dns_ret if ($dns_ret->{'exit'} != 0); + } + # SAVE interfaces Settings + if (exists($args->{'interface'})){ + my $ifc_ret = writeInterfaces($args); + return $ifc_ret if ($ifc_ret->{'exit'} != 0); + } + + # return value for exit is type integer, but it'll be converted into string (in yast-perl-bindings) + # that means in rest-api it'll be {'exit'=>'0', 'error'=>''} + return {'exit'=>0, 'error'=>''}; } 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/lan/address.ycp new/yast2-network-2.21.0/src/lan/address.ycp --- old/yast2-network-2.20.10/src/lan/address.ycp 2011-01-03 16:00:07.000000000 +0100 +++ new/yast2-network-2.21.0/src/lan/address.ycp 2011-07-22 17:34:41.000000000 +0200 @@ -125,9 +125,6 @@ */ void InitVLANSlave(string key) { - settings["ETHERDEVICE"] = NetworkInterfaces::Current["ETHERDEVICE"]:""; - settings["VLAN_ID"] = tointeger(NetworkInterfaces::Current["VLAN_ID"]:"0"); - list items = []; // unconfigured devices foreach(integer i, map a, (map<integer, map>)LanItems::Items,{ @@ -150,16 +147,10 @@ symbol HandleVLANSlave(string key, map event){ - if (event["EventReason"]:""=="ValueChanged"){ - string configname = sformat("%1.%2", UI::QueryWidget(`id(`vlan_eth), `Value), UI::QueryWidget(`id(`vlan_id), `Value)); - NetworkInterfaces::Name = configname; - LanItems::Items[LanItems::current, "ifcfg"]= configname; - UI::ChangeWidget(`id("IFCFGID"), `Value, configname); - } - return nil; + // formerly tried to edit ifcfg name. bad idea, surrounding code not ready + return nil; } - /** * Default function to store the value of ETHERDEVICE devices box. * @param key id of the widget @@ -945,6 +936,11 @@ // TODO: dynamic for dummy. or add dummy from outside? boolean no_dhcp = is_ptp || settings["IFCFGTYPE"]:"" == "dummy" || LanItems::alias != ""; + if (LanItems::type == "vlan") { + settings["ETHERDEVICE"] = LanItems::vlan_etherdevice; + settings["VLAN_ID"] = tointeger(LanItems::vlan_id); + } + if (contains(["tun", "tap"], LanItems::type)) { settings = $[ @@ -1233,7 +1229,10 @@ // address tab if(LanItems::operation == `add) { LanItems::device = NetworkInterfaces::device_num(ifcfgname); - LanItems::type = NetworkInterfaces::device_type(ifcfgname); + LanItems::type = NetworkInterfaces::GetTypeFromIfcfg(settings); + if (LanItems::type == nil) { + LanItems::type = NetworkInterfaces::device_type(ifcfgname); + } } LanItems::bootproto = settings["BOOTPROTO"]:""; @@ -1277,9 +1276,7 @@ if (LanItems::type == "vlan"){ LanItems::vlan_etherdevice = settings["ETHERDEVICE"]:""; -y2internal("%1, %2", LanItems::vlan_id, (integer)settings["VLAN_ID"]:0); LanItems::vlan_id = tostring((integer)settings["VLAN_ID"]:0); -y2internal("%1", LanItems::vlan_id); } else if (LanItems::type == "br"){ LanItems::bridge_ports = settings["BRIDGE_PORTS"]:""; } else if (contains(["tun", "tap"], LanItems::type)){ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/lan/bridge.ycp new/yast2-network-2.21.0/src/lan/bridge.ycp --- old/yast2-network-2.20.10/src/lan/bridge.ycp 2010-12-20 15:31:59.000000000 +0100 +++ new/yast2-network-2.21.0/src/lan/bridge.ycp 2011-07-01 13:21:38.000000000 +0200 @@ -79,7 +79,7 @@ if ((string)configurations[NetworkInterfaces::GetType(device), device, "IPADDR"]:"" != "0.0.0.0" && (string)configurations[NetworkInterfaces::GetType(device), device, "BOOTPROTO"]:"" != "none") { if(!confirmed) { valid = Popup::ContinueCancel(_("At least one selected device is already configured. -Adapt the configuration for bridge (IP addess 0.0.0.0/32)? +Adapt the configuration for bridge (IP address 0.0.0.0/32)? ")); confirmed=true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/lan/hardware.ycp new/yast2-network-2.21.0/src/lan/hardware.ycp --- old/yast2-network-2.20.10/src/lan/hardware.ycp 2011-01-03 16:00:07.000000000 +0100 +++ new/yast2-network-2.21.0/src/lan/hardware.ycp 2011-07-22 17:34:59.000000000 +0200 @@ -4,7 +4,7 @@ * Summary: Hardware dialogs * Authors: Michal Svec <msvec@suse.cz> * - * $Id: hardware.ycp 63021 2010-12-22 23:32:50Z mzugec $ + * $Id: hardware.ycp 64700 2011-07-01 11:42:29Z mvidner $ */ { @@ -38,7 +38,7 @@ ") + _("<p><b>Show visible port identification</b> allows you to physically identify now configured NIC. -Set appropriate time, click <b>Blink</b> and LED diods on you NIC will start blinking for selected time. +Set appropriate time, click <b>Blink</b> and LED diodes on you NIC will start blinking for selected time. </p>")+ /* Manual network card setup help 2/4 */ @@ -531,10 +531,9 @@ LanItems::startmode="auto"; } if (LanItems::type=="vlan"){ - string vlanid=(string) UI::QueryWidget(`id(`num), `Value); - NetworkInterfaces::Current["VLAN_ID"] = vlanid; + LanItems::vlan_id = (string) UI::QueryWidget(`id(`num), `Value); } - } +} string driver = (string) UI::QueryWidget(`modul, `Value); LanItems::setDriver(driver); @@ -786,7 +785,7 @@ if (control==nil) control=""; LanItems::qeth_chanids = String::CutBlanks( sformat("%1 %2 %3", read, write, control) ); if (!LanItems::createS390Device()){ - Popup::Error(_("An error occured while creating device.\nSee YaST log for details.")); + Popup::Error(_("An error occurred while creating device.\nSee YaST log for details.")); ret=nil; continue; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/lan/help.ycp new/yast2-network-2.21.0/src/lan/help.ycp --- old/yast2-network-2.20.10/src/lan/help.ycp 2010-12-20 15:31:59.000000000 +0100 +++ new/yast2-network-2.21.0/src/lan/help.ycp 2011-07-01 13:36:13.000000000 +0200 @@ -175,7 +175,7 @@ /* Address dialog help 6/8 */ "netmask": _("<p>For <b>Static Address Setup</b> enter the static IP address for your computer (for example: <tt>192.168.100.99</tt>) and -the network mask (usually <tt>255.255.255.0</tt> or just lenght of prefix <tt>/24</tt>).Optionally, you can enter +the network mask (usually <tt>255.255.255.0</tt> or just length of prefix <tt>/24</tt>).Optionally, you can enter a fully qualified hostname for this IP address. The hostname will be written to <tt>/etc/hosts</tt>.</p> ") + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/modules/DSL.ycp new/yast2-network-2.21.0/src/modules/DSL.ycp --- old/yast2-network-2.20.10/src/modules/DSL.ycp 2009-04-03 14:42:29.000000000 +0200 +++ new/yast2-network-2.21.0/src/modules/DSL.ycp 2011-02-15 15:20:10.000000000 +0100 @@ -4,7 +4,7 @@ * Summary: DSL data * Authors: Michal Svec <msvec@suse.cz> * - * $Id: DSL.ycp 56143 2009-03-16 13:50:56Z mzugec $ + * $Id: DSL.ycp 63424 2011-02-15 14:20:09Z mvidner $ * * Representation of the configuration of DSL. * Input and output routines. @@ -568,7 +568,7 @@ global list<string> Packages() { if(size(NetworkInterfaces::List("dsl")) < 1) return []; - return ["smpppd", "ppp", "pptp", "linux-atm-lib"]; + return ["smpppd", "ppp", "pptp", "libatm1"]; } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/modules/Host.ycp new/yast2-network-2.21.0/src/modules/Host.ycp --- old/yast2-network-2.20.10/src/modules/Host.ycp 2010-12-20 15:31:59.000000000 +0100 +++ new/yast2-network-2.21.0/src/modules/Host.ycp 2011-07-22 17:24:01.000000000 +0200 @@ -303,6 +303,27 @@ return summary; } +list<string> StaticIPs() { + NetworkInterfaces::Read (); + list<string> devs = NetworkInterfaces::Locate ("BOOTPROTO", "static"); + devs = filter(string dev, devs, { return dev != "lo"; }); + list<string> ips = maplist(string dev, devs, { + return NetworkInterfaces::GetValue(dev, "IPADDR"); + }); + y2milestone("ifcfgs: %1 IPs: %2", devs, ips); + return ips; +} + +// if we have a static address, +// make sure /etc/hosts resolves it to our, bnc#664929 +global void ResolveHostnameToStaticIPs() { + list<string> static_ips = StaticIPs(); + if (size(static_ips) > 0) {// excluding lo + string fqhostname = Hostname::MergeFQ( DNS::hostname, DNS::domain); + Update(fqhostname, fqhostname, static_ips); + } +} + /** * Function which returns if the settings were modified * @return boolean settings were modified diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/modules/Lan.ycp new/yast2-network-2.21.0/src/modules/Lan.ycp --- old/yast2-network-2.20.10/src/modules/Lan.ycp 2010-12-20 15:31:58.000000000 +0100 +++ new/yast2-network-2.21.0/src/modules/Lan.ycp 2011-07-22 17:31:40.000000000 +0200 @@ -4,7 +4,7 @@ * Summary: Network card data * Authors: Michal Svec <msvec@suse.cz> * - * $Id: Lan.ycp 63004 2010-12-17 09:59:53Z mzugec $ + * $Id: Lan.ycp 64081 2011-05-20 11:45:06Z mvidner $ * * Representation of the configuration of network cards. * Input and output routines. @@ -431,8 +431,9 @@ if(Abort()) return false; /* Progress step 3 - multiple devices may be present, really plural*/ ProgressNextStage(_("Writing device configuration...")); - if (!Mode::autoinst()) + if (!Mode::autoinst() && LanUdevAuto::AllowUdevModify()) { LanItems::WriteUdevDriverRules(); + } NetworkInterfaces::Write("netcard"); // WriteDevices(); sleep(sl); @@ -448,6 +449,7 @@ ProgressNextStage(_("Writing routing configuration...")); boolean orig = Progress::set (false); Routing::Write(); + Progress::set (orig); sleep(sl); if(Abort()) return false; @@ -455,6 +457,7 @@ ProgressNextStage(_("Writing hostname and DNS configuration...")); // write resolv.conf after change from dhcp to static (#327074) // reload/restart network before this to put correct resolv.conf from dhcp-backup + orig = Progress::set (false); DNS::Write(); Host::EnsureHostnameResolvable(); Host::Write(); @@ -488,7 +491,7 @@ if (Mode::installation() && NetworkService::IsManaged()) y2internal("Export sysconfig settings into NetworkManager %1", SCR::Execute(.target.bash_output, "/usr/lib/NetworkManager/nm-opensuse-sysconfig-merge --connections")); y2internal("virt_net_proposal %1", virt_net_proposal); - if (Stage::cont() && virt_net_proposal && (Linuxrc::usessh() || Linuxrc::vnc() || Linuxrc::display_ip())) { + if (Stage::cont() && virt_net_proposal == true && (Linuxrc::usessh() || Linuxrc::vnc() || Linuxrc::display_ip())) { UI::OpenDialog(`opt(`decorated), `HBox( `HSpacing(1), `HCenter(`HSquash(`VBox( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/modules/LanItems.ycp new/yast2-network-2.21.0/src/modules/LanItems.ycp --- old/yast2-network-2.20.10/src/modules/LanItems.ycp 2011-01-03 16:00:06.000000000 +0100 +++ new/yast2-network-2.21.0/src/modules/LanItems.ycp 2011-07-22 18:02:16.000000000 +0200 @@ -473,119 +473,139 @@ list<string> overview=[]; list<string> links=[]; map startmode_descrs = $[ - // summary description of STARTMODE=auto - "auto": _("Started automatically at boot"), - // summary description of STARTMODE=auto - "onboot": _("Started automatically at boot"), - // summary description of STARTMODE=hotplug - "hotplug": _("Started automatically at boot"), - // summary description of STARTMODE=ifplugd - "ifplugd": _("Started automatically on cable connection"), - // summary description of STARTMODE=managed - "managed": _("Managed by NetworkManager"), - // summary description of STARTMODE=off - "off" : _("Will not be started at all") - ]; - - - foreach(integer key, (list<integer>)Map::Keys(Items), { - string rich = ""; - string ip = _("Not configured"); - string descr = Items[key, "hwinfo", "name"]:""; - type = Items[key, "hwinfo", "type"]:""; - descr = CheckEmptyName (type, descr); - list <string> bullets = []; - - if (hasAnyValue(Items[key, "ifcfg"]:"") ){ - NetworkInterfaces::Select(Items[key, "ifcfg"]:""); - if (!hasAnyValue(type)) type = NetworkInterfaces::GetType(Items[key, "ifcfg"]:""); - descr = BuildDescription(type, NetworkInterfaces::GetType(Items[key, "ifcfg"]:""), NetworkInterfaces::Current, [Items[key, "hwinfo"]:$[]]); - string dev = NetworkInterfaces::Name; //NetworkInterfaces::device_name(type, NetworkInterfaces::Name); - ip = DeviceProtocol(NetworkInterfaces::Current); - string status = DeviceStatus(type, NetworkInterfaces::device_num(NetworkInterfaces::Name), NetworkInterfaces::Current); - - - string startmode_descr = startmode_descrs[NetworkInterfaces::Current["STARTMODE"]:""]:_("Started manually"); - - bullets = [ - sformat(_("Device Name: %1"), dev), - startmode_descr, - ]; - if (NetworkInterfaces::Current["STARTMODE"]:"" != "managed") - { - if (ip != "NONE") - { - string prefixlen = NetworkInterfaces::Current["PREFIXLEN"]:""; - if (size(ip)>0){ - string descr = sformat("%1 %2", _("IP address assigned using"), ip); - if (!issubstring(ip, "DHCP")) descr=(size(prefixlen)>0) ? + // summary description of STARTMODE=auto + "auto": _("Started automatically at boot"), + // summary description of STARTMODE=auto + "onboot": _("Started automatically at boot"), + // summary description of STARTMODE=hotplug + "hotplug": _("Started automatically at boot"), + // summary description of STARTMODE=ifplugd + "ifplugd": _("Started automatically on cable connection"), + // summary description of STARTMODE=managed + "managed": _("Managed by NetworkManager"), + // summary description of STARTMODE=off + "off" : _("Will not be started at all") + ]; + + foreach(integer key, (list<integer>)Map::Keys(Items), { + string rich = ""; + string ip = _("Not configured"); + string descr = Items[key, "hwinfo", "name"]:""; + type = Items[key, "hwinfo", "type"]:""; + descr = CheckEmptyName (type, descr); + list <string> bullets = []; + + if (hasAnyValue(Items[key, "ifcfg"]:"") ){ + NetworkInterfaces::Select(Items[key, "ifcfg"]:""); + if (!hasAnyValue(type)) type = NetworkInterfaces::GetType(Items[key, "ifcfg"]:""); + descr = BuildDescription(type, NetworkInterfaces::GetType(Items[key, "ifcfg"]:""), NetworkInterfaces::Current, [Items[key, "hwinfo"]:$[]]); + string dev = NetworkInterfaces::Name; //NetworkInterfaces::device_name(type, NetworkInterfaces::Name); + ip = DeviceProtocol(NetworkInterfaces::Current); + string status = DeviceStatus(type, NetworkInterfaces::device_num(NetworkInterfaces::Name), NetworkInterfaces::Current); + + string startmode_descr = startmode_descrs[NetworkInterfaces::Current["STARTMODE"]:""]:_("Started manually"); + + bullets = [ + sformat(_("Device Name: %1"), dev), + startmode_descr, + ]; + + if (NetworkInterfaces::Current["STARTMODE"]:"" != "managed") { + if (ip != "NONE") { + string prefixlen = NetworkInterfaces::Current["PREFIXLEN"]:""; + if (size(ip)>0) { + string descr = sformat("%1 %2", _("IP address assigned using"), ip); + if (!issubstring(ip, "DHCP")) + descr=(size(prefixlen)>0) ? sformat(_("IP address: %1/%2"), ip, prefixlen) : sformat(_("IP address: %1, subnet mask %2") - , ip, NetworkInterfaces::Current["NETMASK"]:""); - bullets = bullets + [ descr ]; - } - } - // build aliases overview - if (size(NetworkInterfaces::Current["_aliases"]:$[])>0 && !NetworkService::IsManaged()){ - foreach(string key, map<string, any> desc, (map<string ,map<string, any> >) NetworkInterfaces::Current["_aliases"]:$[], { - string parameters = sformat("%1/%2", desc["IPADDR"]:"", desc["PREFIXLEN"]:""); - bullets = add(bullets, sformat("%1 (%2)", desc["LABEL"]:"", parameters) ); - }); - } - } - - if (type == "wlan" && - !(NetworkInterfaces::Current["WIRELESS_AUTH_MODE"]:"" != "open") && - !hasAnyValue(NetworkInterfaces::Current["WIRELESS_KEY_0"]:"")) - { - // avoid colons - dev = mergestring (splitstring (dev, ":"), "/"); - string href = "lan--wifi-encryption-" + dev; - // interface summary: WiFi without encryption - string warning = HTML::Colorize (_("Warning: no encryption is used."), "red"); - status = status + " " + warning + " " + - // Hyperlink: Change the configuration of an interface - Hyperlink (href, _("Change.")); - links = add (links, href); - } - - overview = add(overview, Summary::Device(descr, status)); - } else - overview = add(overview, Summary::Device(descr, Summary::NotConfigured())); - - string conn = HTML::Bold ( (Items[key, "hwinfo", "link"]:false == true)?"":sformat("(%1)", _("Not connected") )); - - if (size(Items[key, "hwinfo"]:$[])==0) conn = HTML::Bold(sformat("(%1)", _("No hwinfo"))); - string mac_dev = HTML::Bold ("MAC : ") + Items[key, "hwinfo", "mac"]:"" + "<br>"; - string bus_id = HTML::Bold ("BusID : ") + Items[key, "hwinfo", "busid"]:"" + "<br>"; - if (hasAnyValue(Items[key, "hwinfo", "mac"]:"")) rich = " " + conn + "<br>" + mac_dev; - if (hasAnyValue(Items[key, "hwinfo", "busid"]:"")) rich = rich + bus_id; - rich = HTML::Bold ( descr ) + rich; - - if (!hasAnyValue(Items[key, "hwinfo", "dev_name"]:"") && size(Items[key, "hwinfo"]:$[])>0 && !Arch::s390()) - rich = rich + _("<p>Unable to configure the network card because the kernel device (eth0, wlan0) is not present. This is mostly caused by missing firmware (for wlan devices). See dmesg output for details.</p>"); - else if (hasAnyValue(Items[key, "ifcfg"]:"") ) rich = rich + HTML::List (bullets); - else { - rich = rich + _("<p>The device is not configured. Press <b>Edit</b> + , ip, NetworkInterfaces::Current["NETMASK"]:""); + bullets = bullets + [ descr ]; + } + } + // build aliases overview + if (size(NetworkInterfaces::Current["_aliases"]:$[])>0 && !NetworkService::IsManaged()){ + foreach(string key, map<string, any> desc, (map<string ,map<string, any> >) NetworkInterfaces::Current["_aliases"]:$[], { + string parameters = sformat("%1/%2", desc["IPADDR"]:"", desc["PREFIXLEN"]:""); + bullets = add(bullets, sformat("%1 (%2)", desc["LABEL"]:"", parameters) ); + }); + } + } + + if (type == "wlan" && + !(NetworkInterfaces::Current["WIRELESS_AUTH_MODE"]:"" != "open") && + !hasAnyValue(NetworkInterfaces::Current["WIRELESS_KEY_0"]:"")) { + // avoid colons + dev = mergestring (splitstring (dev, ":"), "/"); + string href = "lan--wifi-encryption-" + dev; + // interface summary: WiFi without encryption + string warning = HTML::Colorize (_("Warning: no encryption is used."), "red"); + status = status + " " + warning + " " + + // Hyperlink: Change the configuration of an interface + Hyperlink (href, _("Change.")); + links = add (links, href); + } + + overview = add(overview, Summary::Device(descr, status)); + } + else { + overview = add(overview, Summary::Device(descr, Summary::NotConfigured())); + } + + string conn = HTML::Bold ( (Items[key, "hwinfo", "link"]:false == true)?"":sformat("(%1)", _("Not connected") )); + + if (size(Items[key, "hwinfo"]:$[])==0) { + conn = HTML::Bold(sformat("(%1)", _("No hwinfo"))); + } + + string mac_dev = HTML::Bold ("MAC : ") + Items[key, "hwinfo", "mac"]:"" + "<br>"; + string bus_id = HTML::Bold ("BusID : ") + Items[key, "hwinfo", "busid"]:"" + "<br>"; + + if (hasAnyValue(Items[key, "hwinfo", "mac"]:"")) { + rich = rich + " " + conn + "<br>"; + rich = rich + mac_dev; + } + if (hasAnyValue(Items[key, "hwinfo", "busid"]:"")) { + rich = rich + bus_id; + } + // display it only if we need it, don't duplicate "dev" above + if (hasAnyValue(Items[key, "hwinfo", "dev_name"]:"") && + ! hasAnyValue(Items[key, "ifcfg"]:"")) { + string dev_name = sformat(_("Device Name: %1"), Items[key, "hwinfo", "dev_name"]:"" ); + string dev_name_r = HTML::Bold(dev_name) + "<br>"; + rich = rich + dev_name_r; + } + + rich = HTML::Bold ( descr ) + rich; + + if (!hasAnyValue(Items[key, "hwinfo", "dev_name"]:"") && size(Items[key, "hwinfo"]:$[])>0 && !Arch::s390()) { + rich = rich + _("<p>Unable to configure the network card because the kernel device (eth0, wlan0) is not present. This is mostly caused by missing firmware (for wlan devices). See dmesg output for details.</p>"); + } + else if (hasAnyValue(Items[key, "ifcfg"]:"") ) { + rich = rich + HTML::List (bullets); + } + else { + rich = rich + _("<p>The device is not configured. Press <b>Edit</b> to configure.</p> "); - integer curr=current; - current=key; - if(needFirmwareCurrentItem()){ - string fw = GetFirmwareForCurrentItem(); - rich = rich+ sformat("%1 : %2", - _("Needed firmware"), (fw!="") ? fw : _("unknown")); - } - current=curr; - } - - Items[key, "table_descr"] = $[ - "rich_descr" : rich, - "table_descr": [descr, ip] - ]; - }); - return [ Summary::DevicesList(overview), links ]; + integer curr = current; + current = key; + if (needFirmwareCurrentItem()) { + string fw = GetFirmwareForCurrentItem(); + rich = rich+ sformat("%1 : %2", + _("Needed firmware"), + (fw!="") ? fw : _("unknown")); + } + current=curr; + } + + Items[key, "table_descr"] = $[ + "rich_descr" : rich, + "table_descr": [descr, ip] + ]; + }); + return [ Summary::DevicesList(overview), links ]; } @@ -833,7 +853,8 @@ usercontrol = GetDeviceVar (devmap, defaults, "USERCONTROL") == "yes"; description = GetDeviceVar (devmap, defaults, "NAME"); bond_option = GetDeviceVar(devmap, defaults, "BONDING_MODULE_OPTS"); - vlan_id = GetDeviceVar(devmap, defaults, "VLAN_ID"); + vlan_etherdevice = GetDeviceVar(devmap, defaults, "ETHERDEVICE"); + vlan_id = GetDeviceVar(devmap, defaults, "VLAN_ID"); // FIXME, remember that it can be implied from the name. probably bond_slaves=[]; foreach(any key, any value, devmap, @@ -927,7 +948,7 @@ "WIRELESS_FREQUENCY": "", "WIRELESS_BITRATE": "auto", "WIRELESS_AP": "", - "WIRELESS_POWER": "yes", + "WIRELESS_POWER": "", "PORTNAME": "", // aliases = devmap["_aliases"]:$[]; // ? "WIRELESS_EAP_MODE": "", @@ -1063,11 +1084,6 @@ newdev["BOOTPROTO"] = bootproto; } newdev["NAME"] = description; - // L3: bnc#585458 -// if (!issubstring(Items[current, "ifcfg"]:"", type)) newdev["INTERFACETYPE"]=type; - // exception for VLAN - // because of ethX.Y -// if (deletechars(Items[current, "ifcfg"]:"", "0123456789")!=type && type!="vlan") newdev["INTERFACETYPE"]=type; if(hotplug == "pcmcia") newdev["DHCLIENT_SET_DOWN_LINK"] = "yes"; @@ -1161,6 +1177,14 @@ "TUNNEL_SET_GROUP" : tunnel_set_group ]; } + + // L3: bnc#585458 + // FIXME: INTERFACETYPE confuses sysconfig, bnc#458412 + // Only test when newdev has enough info for GetTypeFromIfcfg to work. + if (NetworkInterfaces::GetTypeFromIfcfg(newdev) != type) { + newdev["INTERFACETYPE"]=type; + } + NetworkInterfaces::Name = Items[current, "ifcfg"]:""; NetworkInterfaces::Current = newdev; y2internal("%1", newdev); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/modules/LanUdevAuto.ycp new/yast2-network-2.21.0/src/modules/LanUdevAuto.ycp --- old/yast2-network-2.20.10/src/modules/LanUdevAuto.ycp 2010-12-20 15:31:58.000000000 +0100 +++ new/yast2-network-2.21.0/src/modules/LanUdevAuto.ycp 2011-07-22 17:31:40.000000000 +0200 @@ -12,6 +12,7 @@ { module "LanUdevAuto"; import "LanItems"; + import "Map"; include "network/routines.ycp"; textdomain "network"; @@ -20,6 +21,42 @@ list<map> s390_devices=[]; list <map> hardware=nil; +/** + * @return parameter from /etc/install.inf or nil + * @param name parameter name, case sensitive + */ +string InstallInfParameter(string name) { + path p = add(.etc.install_inf, name); + return (string) SCR::Read(p); +} + +/** + * @return parameter from the kernel(boot) command line or nil + * @param name parameter name, case sensitive + */ +string KernelCmdlineParameter(string name) { + string cmdline = InstallInfParameter("Cmdline"); + map cmdmap = Map::FromString(cmdline); // handles nil too + return (string) cmdmap[name]:nil; +} + +/** + * @return installation parameter or nil + * @param name parameter name, case sensitive + */ +string InstallationParameter(string name) { + string value = InstallInfParameter(name); + if (value == nil) { + value = KernelCmdlineParameter(name); + } + return value; +} + +// FATE#311332 +global boolean AllowUdevModify() { + return InstallationParameter("biosdevname") != "1"; +} + global string getDeviceName(string oldname){ string newname=oldname; if (hardware==nil) hardware=ReadHardware("netcard"); @@ -117,8 +154,10 @@ }); if (size(rules)>0){ y2milestone("Writing AY udev rules for network (will replace original rules from 1st stage)"); - SCR::Write(.udev_persistent.rules_comment, comment); - SCR::Write(.udev_persistent.rules, rules); + if (AllowUdevModify()){ + SCR::Write(.udev_persistent.rules_comment, comment); + SCR::Write(.udev_persistent.rules, rules); + } } else y2milestone("No udev rules defined by AY, nothing to write (keep original file)"); if (Arch::s390()){ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/remote/dialogs.ycp new/yast2-network-2.21.0/src/remote/dialogs.ycp --- old/yast2-network-2.20.10/src/remote/dialogs.ycp 2009-03-02 15:58:05.000000000 +0100 +++ new/yast2-network-2.21.0/src/remote/dialogs.ycp 2011-04-13 16:29:35.000000000 +0200 @@ -4,7 +4,7 @@ * Summary: Dialog for Remote Administration * Authors: Arvin Schnell <arvin@suse.de> * - * $Id: dialogs.ycp 54992 2009-01-26 11:43:30Z mzugec $ + * $Id: dialogs.ycp 63773 2011-04-13 14:29:35Z mvidner $ */ { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-2.20.10/src/services/dns.ycp new/yast2-network-2.21.0/src/services/dns.ycp --- old/yast2-network-2.20.10/src/services/dns.ycp 2010-03-16 13:41:08.000000000 +0100 +++ new/yast2-network-2.21.0/src/services/dns.ycp 2011-07-01 13:42:31.000000000 +0200 @@ -5,7 +5,7 @@ * Authors: Michal Svec <msvec@suse.cz> * Martin Vidner <mvidner@suse.cz> * - * $Id: dns.ycp 60556 2010-01-27 14:21:30Z kmachalkova $ + * $Id: dns.ycp 64700 2011-07-01 11:42:29Z mvidner $ */ { @@ -209,7 +209,7 @@ if (!dhn || value != "") { if (value=="local"){ - if (!Popup::YesNo(_("It's not recomended to use .local as domainname due to Multicast DNS. Use it on your own risk?"))) return false; + if (!Popup::YesNo(_("It's not recommended to use .local as domainname due to Multicast DNS. Use it at your own risk?"))) return false; } return Hostname::CheckDomain (value); } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de