openSUSE Commits
Threads by month
- ----- 2024 -----
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
March 2014
- 1 participants
- 1614 discussions
Hello community,
here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2014-03-01 14:38:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-network (Old)
and /work/SRC/openSUSE:Factory/.yast2-network.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-network"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2014-02-21 13:48:27.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-network.new/yast2-network.changes 2014-03-01 14:38:29.000000000 +0100
@@ -1,0 +2,45 @@
+Fri Feb 28 15:30:41 UTC 2014 - jreidinger(a)suse.com
+
+- fix installation crash - do not mess ruby global namespace
+- 3.1.29
+
+-------------------------------------------------------------------
+Fri Feb 28 11:21:19 UTC 2014 - mfilka(a)suse.com
+
+- bnc#864614
+ - exclude already configured devices from dhcp candidates when
+ attempting to do an autoconfiguration at the begining of
+ installation
+- 3.1.28
+
+-------------------------------------------------------------------
+Fri Feb 28 08:25:53 UTC 2014 - mfilka(a)suse.com
+
+- bnc#866224
+ - inst_install_inf.rb is present in instsys
+- 3.1.27
+
+-------------------------------------------------------------------
+Thu Feb 27 10:44:09 UTC 2014 - mfilka(a)suse.com
+
+- bnc#865199
+ - netmask generated corectly when handling static net
+ configuration provided by install.inf
+- 3.1.26
+
+-------------------------------------------------------------------
+Wed Feb 26 23:00:17 UTC 2014 - mfilka(a)suse.com
+
+- fixed internal error in save_network client
+- 3.1.25
+
+-------------------------------------------------------------------
+Wed Feb 26 13:19:08 UTC 2014 - mfilka(a)suse.com
+
+- bnc#859213
+ - generate install.inf based netconfig at the begining of
+ installation. Generated configuration is copied to target at the
+ end of installation
+- 3.1.24
+
+-------------------------------------------------------------------
Old:
----
yast2-network-3.1.23.tar.bz2
New:
----
yast2-network-3.1.29.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-network.spec ++++++
--- /var/tmp/diff_new_pack.0Y8IHl/_old 2014-03-01 14:38:30.000000000 +0100
+++ /var/tmp/diff_new_pack.0Y8IHl/_new 2014-03-01 14:38:30.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-network
-Version: 3.1.23
+Version: 3.1.29
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ yast2-network-3.1.23.tar.bz2 -> yast2-network-3.1.29.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.23/package/yast2-network.changes new/yast2-network-3.1.29/package/yast2-network.changes
--- old/yast2-network-3.1.23/package/yast2-network.changes 2014-02-19 16:33:34.000000000 +0100
+++ new/yast2-network-3.1.29/package/yast2-network.changes 2014-02-28 17:03:50.000000000 +0100
@@ -1,4 +1,49 @@
-------------------------------------------------------------------
+Fri Feb 28 15:30:41 UTC 2014 - jreidinger(a)suse.com
+
+- fix installation crash - do not mess ruby global namespace
+- 3.1.29
+
+-------------------------------------------------------------------
+Fri Feb 28 11:21:19 UTC 2014 - mfilka(a)suse.com
+
+- bnc#864614
+ - exclude already configured devices from dhcp candidates when
+ attempting to do an autoconfiguration at the begining of
+ installation
+- 3.1.28
+
+-------------------------------------------------------------------
+Fri Feb 28 08:25:53 UTC 2014 - mfilka(a)suse.com
+
+- bnc#866224
+ - inst_install_inf.rb is present in instsys
+- 3.1.27
+
+-------------------------------------------------------------------
+Thu Feb 27 10:44:09 UTC 2014 - mfilka(a)suse.com
+
+- bnc#865199
+ - netmask generated corectly when handling static net
+ configuration provided by install.inf
+- 3.1.26
+
+-------------------------------------------------------------------
+Wed Feb 26 23:00:17 UTC 2014 - mfilka(a)suse.com
+
+- fixed internal error in save_network client
+- 3.1.25
+
+-------------------------------------------------------------------
+Wed Feb 26 13:19:08 UTC 2014 - mfilka(a)suse.com
+
+- bnc#859213
+ - generate install.inf based netconfig at the begining of
+ installation. Generated configuration is copied to target at the
+ end of installation
+- 3.1.24
+
+-------------------------------------------------------------------
Wed Feb 19 16:30:43 CET 2014 - snwint(a)suse.de
- copy also ifroute-* files into installed system
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.23/package/yast2-network.spec new/yast2-network-3.1.29/package/yast2-network.spec
--- old/yast2-network-3.1.23/package/yast2-network.spec 2014-02-19 16:33:34.000000000 +0100
+++ new/yast2-network-3.1.29/package/yast2-network.spec 2014-02-28 17:03:50.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-network
-Version: 3.1.23
+Version: 3.1.29
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.23/src/Makefile.am new/yast2-network-3.1.29/src/Makefile.am
--- old/yast2-network-3.1.23/src/Makefile.am 2014-02-19 16:33:34.000000000 +0100
+++ new/yast2-network-3.1.29/src/Makefile.am 2014-02-28 17:03:50.000000000 +0100
@@ -40,7 +40,8 @@
clients/remote.rb \
clients/dns.rb \
clients/lan_proposal.rb \
- clients/host.rb
+ clients/host.rb \
+ clients/inst_install_inf.rb
yncludedir = @yncludedir@/network/installation
ynclude_DATA = \
@@ -109,7 +110,8 @@
ylibdir = @ylibdir@/network
ylib_DATA = \
lib/network/edit_nic_name.rb \
- lib/network/confirm_virt_proposal.rb
+ lib/network/confirm_virt_proposal.rb \
+ lib/network/install_inf_convertor.rb
EXTRA_DIST = \
$(module_DATA) \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.23/src/clients/inst_install_inf.rb new/yast2-network-3.1.29/src/clients/inst_install_inf.rb
--- old/yast2-network-3.1.23/src/clients/inst_install_inf.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-network-3.1.29/src/clients/inst_install_inf.rb 2014-02-28 17:03:50.000000000 +0100
@@ -0,0 +1,16 @@
+require "yast"
+require "network/install_inf_convertor"
+
+module Yast
+
+ class InstInstallInfClient < Client
+ def main
+ InstallInfConvertor.instance.write_netconfig
+
+ :next
+ end
+ end
+
+end
+
+Yast::InstInstallInfClient.new.main
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.23/src/clients/inst_setup_dhcp.rb new/yast2-network-3.1.29/src/clients/inst_setup_dhcp.rb
--- old/yast2-network-3.1.23/src/clients/inst_setup_dhcp.rb 2014-02-19 16:33:34.000000000 +0100
+++ new/yast2-network-3.1.29/src/clients/inst_setup_dhcp.rb 2014-02-28 17:03:50.000000000 +0100
@@ -48,9 +48,21 @@
NetworkInterfaces.Write("")
end
+ def self.configured?(devname)
+ # TODO:
+ # one day there should be LanItems.IsItemConfigured, but we currently
+ # miss index -> devname translation. As this LanItems internal structure
+ # will be subject of refactoring, we will use NetworkInterfaces directly.
+ # It currently doesn't hurt as it currently writes configuration for both
+ # wicked even sysconfig.
+ NetworkInterfaces.Check(devname)
+ end
+
+ include Logger
# TODO time consuming, some progress would be nice
- dhcp_cards = network_cards.select { |c| get_lease?(c) }
+ dhcp_cards = network_cards.select { |c| !configured?(c) && get_lease?(c) }
+ log.info "Candidates for enabling DHCP: #{dhcp_cards}"
dhcp_cards.each do |dcard|
setup_dhcp(dcard) # make DHCP setup persistent
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.23/src/clients/save_network.rb new/yast2-network-3.1.29/src/clients/save_network.rb
--- old/yast2-network-3.1.23/src/clients/save_network.rb 2014-02-19 16:33:34.000000000 +0100
+++ new/yast2-network-3.1.29/src/clients/save_network.rb 2014-02-28 17:03:50.000000000 +0100
@@ -28,7 +28,11 @@
#
#
module Yast
+ require "network/install_inf_convertor"
+
class SaveNetworkClient < Client
+ include Logger
+
def main
Yast.import "UI"
@@ -50,646 +54,38 @@
Yast.include self, "network/routines.rb"
Yast.include self, "network/complex.rb"
- @InstallInf = {}
-
- # global variable because chrooted environment
- @network_disk = :no # `nfs `iscsi `fcoe
- @netdevice = ""
-
- @hardware = ReadHardware("netcard")
- Builtins.y2milestone("hardware %1", @hardware)
-
# for update system don't copy network from inst_sys (#325738)
if !Mode.update
save_network
else
Builtins.y2milestone("update - skip save_network")
- end
- # EOF
-
- nil
- end
-
- # Read one install.inf item
- # @param [String] item InstallInf map key
- # @param [String] var install.inf SCR variable
- # @return true on success
- def ReadInstallInfItem(install_inf, item, var)
- return false if item == nil || item == "" || var == nil || var == ""
-
- val = Convert.to_string(SCR.Read(Builtins.add(install_inf, var)))
- return false if val == nil
-
- Ops.set(@InstallInf, item, val) if val != ""
-
- true
- end
-
- def DeleteFirstWord(s)
- ret = Builtins.regexpsub(s, "^[^ ]* +(.*)", "\\1")
- ret == nil ? s : ret
- end
-
- # Read install.inf from the correct location
- # @return true on success
- def ReadInstallInf
- Builtins.y2milestone("ReadInstallInf()")
-
- # Detect install.inf location
- install_inf = nil
- if Ops.greater_than(SCR.Read(path(".target.size"), "/etc/install.inf"), 0)
- install_inf = path(".etc.install_inf")
- Ops.set(@InstallInf, "installation", "yes")
- else
- # FIXME
- # else if(SCR::Read(.target.size,"/var/lib/YaST2/install.inf") > 0)
- # install_inf = .var.lib.YaST2.install_inf;
- return false
- end
-
- # Read install.inf items
- ReadInstallInfItem(install_inf, "firststage_network", "ConfigureNetwork")
- ReadInstallInfItem(install_inf, "ipaddr", "IP")
- ReadInstallInfItem(install_inf, "ipaddr6", "IP6")
- ReadInstallInfItem(install_inf, "netmask", "Netmask")
- ReadInstallInfItem(install_inf, "bcast", "Broadcast")
- ReadInstallInfItem(install_inf, "remote_ip", "Pointopoint")
- ReadInstallInfItem(install_inf, "mtu", "IP_MTU")
- ReadInstallInfItem(install_inf, "bootproto", "NetConfig")
- ReadInstallInfItem(install_inf, "netdevice", "Netdevice")
- ReadInstallInfItem(install_inf, "gateway", "Gateway")
- ReadInstallInfItem(install_inf, "nameserver", "Nameserver")
- ReadInstallInfItem(install_inf, "nameserver2", "Nameserver2")
- ReadInstallInfItem(install_inf, "nameserver3", "Nameserver3")
- ReadInstallInfItem(install_inf, "domain", "Domain")
- ReadInstallInfItem(install_inf, "nisdomain", "NISDomain")
- ReadInstallInfItem(install_inf, "hostname", "Hostname")
- ReadInstallInfItem(install_inf, "module", "Alias")
- ReadInstallInfItem(install_inf, "proxyUrl", "ProxyUrl")
- ReadInstallInfItem(install_inf, "proxyProto", "ProxyProto")
- # ReadInstallInfItem(install_inf, "options", "Options");
- # OSAHwAddr parameter s390
- ReadInstallInfItem(install_inf, "hwaddr", "HWAddr")
- ReadInstallInfItem(install_inf, "ethtool_options", "ethtool")
- ReadInstallInfItem(install_inf, "unique", "NetUniqueID")
- ReadInstallInfItem(install_inf, "connect_wait", "ConnectWait")
-
- ReadInstallInfItem(install_inf, "QETH_LAYER2_SUPPORT", "Layer2")
- # ReadInstallInfItem(install_inf, "LLADDR", "OSAHWAddr");
- ReadInstallInfItem(install_inf, "dhcptimeout", "DHCPTimeout")
-
- ReadInstallInfItem(install_inf, "WESSID", "WlanESSID")
- ReadInstallInfItem(install_inf, "WAuth", "WlanAuth")
- ReadInstallInfItem(install_inf, "WKey", "WlanKey")
- ReadInstallInfItem(install_inf, "WkeyType", "WlanKeyType")
- ReadInstallInfItem(install_inf, "WkeyLen", "WlanKeyLen")
-
-
- # Split network device
- @netdevice = Ops.get_string(@InstallInf, "netdevice", "")
- Builtins.y2milestone("InstallInf::netdevice:%1", @netdevice)
- if Mode.autoinst
- # if possible, for temporary installation network use same device
- # with same MAC address (even if devicename changed) (bnc#648270)
- new_devname = LanUdevAuto.GetDevnameByMAC(
- Ops.get_string(@InstallInf, "hwaddr", "")
- )
- Builtins.y2milestone("LanUdevAuto::netdevice:%1", new_devname)
- if Ops.greater_than(Builtins.size(new_devname), 0)
- Builtins.y2milestone(
- "old devname: %1, new devname: %2",
- @netdevice,
- new_devname
- )
- @netdevice = new_devname
- end
- end
- if @netdevice != ""
- devtype = NetworkInterfaces.device_type(@netdevice)
- Ops.set(@InstallInf, "type", devtype) if devtype != nil && devtype != ""
- # InstallInf = remove(InstallInf, "netdevice");
- end
-
- if Arch.s390
- Builtins.y2milestone(
- "Interface type: %1",
- Ops.get_string(@InstallInf, "type", "")
- )
- # only some card types need a persistent MAC (bnc#658708)
- sysfs_id = dev_name_to_sysfs_id(@netdevice, @hardware)
- if !s390_device_needs_persistent_mac(sysfs_id, @hardware)
- @InstallInf = Builtins.remove(@InstallInf, "hwaddr")
- end
- # hsi devices do not support setting hwaddr (bnc #479481)
- if Ops.get_string(@InstallInf, "type", "") == "hsi" &&
- Builtins.haskey(@InstallInf, "hwaddr")
- @InstallInf = Builtins.remove(@InstallInf, "hwaddr")
- end
- # set HW address only for qeth set to Layer 2 (bnc #479481)
- if Ops.get_string(@InstallInf, "type", "") == "eth" &&
- Ops.get_string(@InstallInf, "QETH_LAYER2_SUPPORT", "0") != "1"
- @InstallInf = Builtins.remove(@InstallInf, "hwaddr")
- end
- end
-
- # Split FQ hostname
- hostname = Ops.get_string(@InstallInf, "hostname", "")
- if hostname != "" && !IP.Check(hostname)
- split = Hostname.SplitFQ(hostname)
-
- # hostname is supposed to be FQDN (http://en.opensuse.org/Linuxrc)
- # so we should not cut off domain name ... anyway remember domain,
- # use it as fallback below, if there is no DNS search domain (#476208)
- if Ops.greater_than(Builtins.size(split), 1)
- Ops.set(@InstallInf, "fqdomain", Ops.get_string(split, 1, ""))
- end
- else
- # do not have numeric hostname, #152218
- Ops.set(@InstallInf, "hostname", "")
end
-
- # #180821, todo cleanup
- if @netdevice != ""
- mod = Convert.to_string(
- SCR.Read(Builtins.add(path(".etc.install_inf_alias"), @netdevice))
- )
- if mod != "" && mod != nil
- Ops.set(@InstallInf, "module", mod)
- options = Convert.to_string(
- SCR.Read(Builtins.add(path(".etc.install_inf_options"), mod))
- )
- if options != "" && options != nil
- Ops.set(@InstallInf, "options", options)
- end
- end
- else
- # FIXME: alias = eth0 tulip
- # FIXME: options = ne io=0x200
-
- # #42203: correctly parse module and options for proposal
- # "eth0 qeth" -> "qeth"
- # FIXME: this only works for a single module
- mod = Ops.get_string(@InstallInf, "module", "")
- Ops.set(@InstallInf, "module", DeleteFirstWord(mod)) if mod != ""
-
- options = Ops.get_string(@InstallInf, "options", "")
- if options != ""
- Ops.set(@InstallInf, "options", DeleteFirstWord(options))
- end
- end
-
- Builtins.y2milestone("InstallInf(%1)", @InstallInf)
- true
- end
-
-
- # Read module options from /etc/install.inf
- # @param [String] module_name Module name
- # @return module options, empty string if none
- def InstallModuleOptions(module_name)
- if Ops.greater_than(SCR.Read(path(".target.size"), "/etc/install.inf"), 0)
- modules = SCR.Dir(path(".etc.install_inf_options"))
- Builtins.y2milestone(
- "Module with options in /etc/install.inf: %1",
- modules
- )
- if Builtins.contains(modules, module_name)
- options = SCR.Read(
- Builtins.add(path(".etc.install_inf_options"), module_name)
- )
- return Convert.to_string(options) if options != nil && options != ""
- end
- end
- ""
- end
-
- def StdoutOf(command)
- out = Convert.to_map(SCR.Execute(path(".target.bash_output"), command))
- Ops.get_string(out, "stdout", "")
- end
-
- def CreateIfcfg
- ifcfg = ""
-
- if @network_disk == :iscsi &&
- Builtins.contains(
- NetworkStorage.getiBFTDevices,
- Ops.get_string(@InstallInf, "netdevice", "")
- )
- ifcfg = Builtins.sformat(
- "%1STARTMODE='nfsroot'\nBOOTPROTO='ibft'\n",
- ifcfg
- )
- else
- # set BOOTPROTO=[ static | dhcp ]
- if Ops.get_string(@InstallInf, "bootproto", "dhcp") == "static"
- # add broadcast interface #suse49131
- ifcfg = Builtins.sformat(
- "BOOTPROTO='static'\n" +
- "IPADDR='%1/%2'\n" +
- "BROADCAST='%3'\n",
- Ops.get_string(@InstallInf, "ipaddr", ""),
- Netmask.ToBits(Ops.get_string(@InstallInf, "netmask", "")),
- Ops.get_string(@InstallInf, "bcast", "")
- )
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "ipaddr6", "")),
- 0
- )
- ifcfg = Builtins.sformat(
- "%1\n%2",
- ifcfg,
- Builtins.sformat(
- "LABEL_ipv6='ipv6'\nIPADDR_ipv6='%1'\n",
- Ops.get_string(@InstallInf, "ipaddr6", "")
- )
- )
- end
- else
- #DHCP (also for IPv6) setup
- if Ops.get_string(@InstallInf, "bootproto", "") == "dhcp"
- ifcfg = "BOOTPROTO='dhcp4'\n"
- elsif Ops.get_string(@InstallInf, "bootproto", "") == "dhcp6"
- ifcfg = "BOOTPROTO='dhcp6'\n"
- elsif Ops.get_string(@InstallInf, "bootproto", "") == "dhcp,dhcp6"
- ifcfg = "BOOTPROTO='dhcp'\n"
- end
-
- # set DHCP_SET_HOSTNAME=yes #suse30528
- Builtins.y2milestone(
- "set DHCLIENT_SET_HOSTNAME=yes on installed system"
- )
- SCR.Execute(
- path(".target.bash_output"),
- "sed -i s/\"DHCLIENT_SET_HOSTNAME=.*\"/'DHCLIENT_SET_HOSTNAME=\"yes\"'/g /etc/sysconfig/network/dhcp"
- )
- end
-
- if @network_disk == :no
- ifcfg = Builtins.sformat("%1STARTMODE='onboot'\n", ifcfg)
- else
- ifcfg = Builtins.sformat("%1STARTMODE='nfsroot'\n", ifcfg)
- end
- end
-
- # wireless devices (bnc#223570)
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "WESSID", "")),
- 0
- )
- ifcfg = Builtins.sformat(
- "%1WIRELESS_ESSID='%2'\n",
- ifcfg,
- Ops.get_string(@InstallInf, "WESSID", "")
- )
-
- case Ops.get_string(@InstallInf, "WAuth", "")
- when "", "psk"
- ifcfg = Builtins.sformat(
- "%1WIRELESS_WPA_PSK='%2'\n",
- ifcfg,
- Ops.get_string(@InstallInf, "WKey", "")
- )
- ifcfg = Builtins.sformat("%1WIRELESS_AUTH_MODE='psk'\n", ifcfg)
- when "open"
- ifcfg = Builtins.sformat(
- "%1WIRELESS_AUTH_MODE='no-encryption'\n",
- ifcfg
- )
- when "wep_open", "wep_restricted"
- @type = ""
- if Ops.get_string(@InstallInf, "WkeyType", "") == "password"
- @type = "h:"
- elsif Ops.get_string(@InstallInf, "WkeyType", "") == "ascii"
- @type = "s:"
- end
- ifcfg = Builtins.sformat(
- "%1WIRELESS_AUTH_MODE='%2'\n",
- ifcfg,
- Ops.get_string(@InstallInf, "WAuth", "") == "wep-open" ? "open" : "sharedkey"
- )
- ifcfg = Builtins.sformat("%1WIRELESS_DEFAULT_KEY='0'\n", ifcfg)
- ifcfg = Builtins.sformat(
- "%1WIRELESS_KEY_0='%2%3'\n",
- ifcfg,
- @type,
- Ops.get_string(@InstallInf, "WKey", "")
- )
- ifcfg = Builtins.sformat(
- "%1WIRELESS_KEY_LENGTH='%2'\n",
- ifcfg,
- Ops.get_string(@InstallInf, "WKeyLen", "")
- )
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "WKeyType", "")),
- 0
- ) &&
- Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "WKey", "")),
- 0
- )
- ifcfg = Builtins.sformat(
- "%1WIRELESS_KEY_0='%2:%3'\n",
- ifcfg,
- Builtins.substring(
- Ops.get_string(@InstallInf, "WKeyType", ""),
- 0,
- 1
- ),
- Ops.get_string(@InstallInf, "WKey", "")
- )
- end
- end
- end
-
- # if available, write MTU
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "mtu", "")),
- 0
- )
- ifcfg = Builtins.sformat(
- "%1MTU='%2'\n",
- ifcfg,
- Ops.get_string(@InstallInf, "mtu", "")
- )
- end
-
- # for queth devices (s390)
- # bnc#578689 - YaST2 should not write the MAC address into ifcfg file
- if Arch.s390 &&
- Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "hwaddr", "")),
- 0
- )
- ifcfg = Builtins.sformat(
- "%1LLADDR='%2'\n",
- ifcfg,
- Ops.get_string(@InstallInf, "hwaddr", "")
- )
- end
-
- # point to point interface
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "remote_ip", "")),
- 0
- )
- ifcfg = Builtins.sformat(
- "%1REMOTE_IPADDR='%2'\n",
- ifcfg,
- Ops.get_string(@InstallInf, "remote_ip", "")
- )
- end
-
- new_netdevice = @netdevice
- if !LanUdevAuto.AllowUdevModify
- # bnc#821427: use same options as in /lib/udev/rules.d/71-biosdevname.rules
- cmd = Builtins.sformat(
- "biosdevname --policy physical --smbios 2.6 --nopirq -i %1",
- @netdevice
- )
- out = String.FirstChunk(StdoutOf(cmd), "\n")
- if out != ""
- Builtins.y2milestone("biosdevname renames %1 to %2", @netdevice, out)
- new_netdevice = out
- end
- end
-
- ifcfg_name = Builtins.sformat("ifcfg-%1", new_netdevice)
-
- hw_name = BuildDescription(
- NetworkInterfaces.device_type(@netdevice),
- NetworkInterfaces.device_num(ifcfg_name),
- { "dev_name" => @netdevice },
- @hardware
- )
- # protect special characters, #305343
- if Ops.greater_than(Builtins.size(hw_name), 0)
- ifcfg = Builtins.sformat("%1NAME='%2'\n", ifcfg, String.Quote(hw_name))
- end
-
- Builtins.y2milestone(
- "Network Configuration:\n%1\nifcfg file: %2",
- ifcfg,
- ifcfg_name
- )
-
- # write only if file doesn't exists
- dev_file = Builtins.sformat("/etc/sysconfig/network/%1", ifcfg_name)
-
- SCR.Write(path(".target.string"), dev_file, ifcfg)
- Builtins.y2milestone("ifcfg file: %1", dev_file)
+ # EOF
nil
end
- # create all network files except ifcfg and hwcfg
- # directly to installed system
-
- def CreateOtherNetworkFiles
- # create hostname
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "hostname", "")),
- 0
- )
- Builtins.y2milestone(
- "Write HOSTNAME: %1",
- Ops.get_string(@InstallInf, "hostname", "")
- )
- SCR.Write(
- path(".target.string"),
- "/etc/HOSTNAME",
- Ops.get_string(@InstallInf, "hostname", "")
- )
- end
-
- if Ops.get_string(@InstallInf, "bootproto", "dhcp") == "static"
- # create routes file
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "gateway", "")),
- 0
- )
- Builtins.y2milestone(
- "Writing route : %1",
- Ops.get_string(@InstallInf, "gateway", "")
- )
- SCR.Write(
- path(".target.string"),
- "/etc/sysconfig/network/routes",
- Builtins.sformat(
- "default %1 - -\n",
- Ops.get_string(@InstallInf, "gateway", "")
- )
- )
- elsif Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "remote_ip", "")),
- 0
- )
- Builtins.y2milestone(
- "Writing Peer-to-Peer route: %1",
- Ops.get_string(@InstallInf, "remote_ip", "")
- )
- SCR.Write(
- path(".target.string"),
- "/etc/sysconfig/network/routes",
- Builtins.sformat(
- "default %1 - -\n",
- Ops.get_string(@InstallInf, "remote_ip", "")
- )
- )
- else
- Builtins.y2warning("No routing information in install.inf")
- end
-
- # write DHCPTimeout linuxrc parameter as /etc/sysconfig/network/config.WAIT_FOR_INTERFACES (bnc#396824)
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "dhcptimeout", "")),
- 0
- )
- SCR.Write(
- path(".sysconfig.network.config.WAIT_FOR_INTERFACES"),
- Ops.get_string(@InstallInf, "dhcptimeout", "")
- )
- Builtins.y2milestone(
- "Writing WAIT_FOR_INTERFACES=%1",
- Ops.get_string(@InstallInf, "dhcptimeout", "")
- )
- end
-
-
- # create resolv.conf only for static configuration
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "nameserver", "")),
- 0
- )
- serverlist = Ops.get_string(@InstallInf, "nameserver", "")
- # write also secondary and third nameserver when available (bnc#446101)
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "nameserver2", "")),
- 0
- )
- serverlist = Builtins.sformat(
- "%1 %2",
- serverlist,
- Ops.get_string(@InstallInf, "nameserver2", "")
- )
- end
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "nameserver3", "")),
- 0
- )
- serverlist = Builtins.sformat(
- "%1 %2",
- serverlist,
- Ops.get_string(@InstallInf, "nameserver3", "")
- )
- end
- #Do not write /etc/resolv.conf directly, feed the data to sysconfig instead,
- #'netconfig' will do the job later on network startup (FaTE #303618)
- SCR.Write(
- path(".sysconfig.network.config.NETCONFIG_DNS_STATIC_SERVERS"),
- serverlist
- )
- Builtins.y2milestone(
- "Writing static nameserver entry: %1",
- Ops.get_string(@InstallInf, "nameserver", "")
- )
-
- #Enter search domain data only if present
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "domain", "")),
- 0
- )
- SCR.Write(
- path(".sysconfig.network.config.NETCONFIG_DNS_STATIC_SEARCHLIST"),
- Ops.get_string(@InstallInf, "domain", "")
- )
- Builtins.y2milestone(
- "Writing static searchlist entry: %1",
- Ops.get_string(@InstallInf, "domain", "")
- )
- elsif Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "fqdomain", "")),
- 0
- )
- SCR.Write(
- path(".sysconfig.network.config.NETCONFIG_DNS_STATIC_SEARCHLIST"),
- Ops.get_string(@InstallInf, "fqdomain", "")
- )
- Builtins.y2milestone(
- "No DNS search domain defined, using FQ domain name %1 as a fallback",
- Ops.get_string(@InstallInf, "fqdomain", "")
- )
- end
-
- #We're done. It is OK not to touch NETCONFIG_DNS_POLICY now as it is set to 'auto' by default
- #and user did not have a chance to modify it up to now
- SCR.Write(path(".sysconfig.network.config"), nil)
- end
- end
-
- # create proxy sysconfig file
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "proxyProto", "")),
- 0
- ) &&
- Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "proxyUrl", "")),
- 0
- )
- Builtins.y2milestone(
- "Writing proxy settings: %1",
- Ops.get_string(@InstallInf, "proxyUrl", "")
- )
-
- Proxy.Read
- ex = Proxy.Export
-
- # bnc#693640 - update Proxy module's configuration
- # username and password is stored in url because it is handled by linuxrc this way and it is impossible
- # to distinguish how the user inserted it (separate or as a part of url?)
- Ops.set(
- ex,
- Ops.add(Ops.get_string(@InstallInf, "proxyProto", ""), "_proxy"),
- Ops.get_string(@InstallInf, "proxyUrl", "")
- )
+ def adjust_for_network_disks(file)
+ # known net devices: `nfs `iscsi `fcoe
+ device = NetworkStorage.getDevice(Installation.destdir)
+ network_disk = NetworkStorage.isDiskOnNetwork(device)
- Proxy.Import(ex)
- Proxy.Write
+ log.info("Network based device: #{network_disk}")
- Builtins.y2debug("Written proxy settings: %1", ex)
- end
- # create defaultdomain
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "nisdomain", "")),
- 0
- ) &&
- FileUtils.Exists("/etc/defaultdomain")
- Builtins.y2milestone(
- "Write defaultdomain: %1",
- Ops.get_string(@InstallInf, "nisdomain", "")
- )
- SCR.Write(
- path(".target.string"),
- "/etc/defaultdomain",
- Ops.get_string(@InstallInf, "nisdomain", "")
+ # overwrite configuration created during network setup e.g. in InstInstallInfClient
+ if network_disk == :iscsi &&
+ NetworkStorage.getiBFTDevices.include?(
+ InstallInfConvertor::InstallInf["Netdevice"]
)
- end
-
- # write wait_for_interfaces if needed
- if Ops.greater_than(
- Builtins.size(Ops.get_string(@InstallInf, "connect_wait", "")),
- 0
+ SCR.Execute(
+ path(".target.bash"),
+ "sed -i s/STARTMODE.*/STARTMODE='nfsroot'/ #{file}"
)
SCR.Execute(
- path(".target.bash_output"),
- Builtins.sformat(
- "sed -i s/^WAIT_FOR_INTERFACES=.*/WAIT_FOR_INTERFACES=%1/g /etc/sysconfig/network/config",
- Ops.get_string(@InstallInf, "connect_wait", "")
- )
+ path(".target.bash"),
+ "sed -i s/BOOTPROTO.*/BOOTPROTO='ibft'/ #{file}"
)
end
-
- nil
end
def CopyConfiguredNetworkFiles
@@ -703,6 +99,10 @@
# just copy files
Builtins.foreach(["ifcfg-*", "ifroute-*", "routes"]) do |file|
+ if file.include?("ifcfg-")
+ adjust_for_network_disks("#{sysconfig}/#{file}")
+ end
+
copy_from = String.Quote(Builtins.sformat("%1%2", sysconfig, file))
Builtins.y2milestone("Copy %1 into %2", copy_from, copy_to)
cmd = Builtins.sformat("cp %1 %2", copy_from, copy_to)
@@ -765,9 +165,6 @@
Installation.destdir,
device
)
- @network_disk = NetworkStorage.isDiskOnNetwork(device)
- Builtins.y2milestone("Network based device: %1", @network_disk)
-
if Arch.s390
Builtins.y2milestone(
@@ -854,11 +251,7 @@
Builtins.y2milestone("Not copying file %1 - it already exists", net_destfile)
end
- if ReadInstallInf()
- CopyConfiguredNetworkFiles()
- else
- Builtins.y2error("Error while reading install.inf!")
- end
+ CopyConfiguredNetworkFiles()
# close and chroot back
WFM.SCRSetDefault(old_SCR)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.23/src/lib/network/install_inf_convertor.rb new/yast2-network-3.1.29/src/lib/network/install_inf_convertor.rb
--- old/yast2-network-3.1.23/src/lib/network/install_inf_convertor.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-network-3.1.29/src/lib/network/install_inf_convertor.rb 2014-02-28 17:03:50.000000000 +0100
@@ -0,0 +1,403 @@
+require "yast"
+
+
+module Yast
+
+ class InstallInfConvertor
+ include Singleton
+ include Logger
+ include Yast # for path shortcuts
+ include I18n # for textdomain
+
+ BASH_PATH = Path.new(".target.bash")
+
+ class InstallInf
+ INSTALL_INF = Path.new(".etc.install_inf")
+
+ def self.[](item)
+ SCR.Read(INSTALL_INF + Path.new(".#{item}")).to_s
+ end
+ end
+
+ def initialize
+ Yast.import "Hostname"
+ Yast.import "IP"
+ Yast.import "NetworkInterfaces"
+ Yast.import "FileUtils"
+ Yast.import "Netmask"
+ Yast.import "NetworkStorage"
+ Yast.import "Proxy"
+ Yast.import "Installation"
+ Yast.import "String"
+ Yast.import "Mode"
+ Yast.import "Arch"
+ Yast.import "LanUdevAuto"
+
+ Yast.include self, "network/routines.rb"
+ Yast.include self, "network/complex.rb"
+ end
+
+ def write_netconfig
+ write_ifcfg(create_ifcfg)
+ write_global_netconfig
+ end
+
+ private
+
+ def create_ifcfg
+ ifcfg = ""
+
+ # set BOOTPROTO=[ static | dhcp ], linuxrc names it "NetConfig"
+ bootproto = InstallInf["NetConfig"]
+ case bootproto
+ when "static"
+ # add broadcast interface #suse49131
+ ifcfg << "BOOTPROTO='static'\n"
+ ifcfg << "IPADDR='%s/%s'\n" % [
+ InstallInf["IP"],
+ Netmask.ToBits(InstallInf["Netmask"])
+ ]
+ ifcfg << "BROADCAST='%s'\n" % InstallInf["Broadcast"]
+
+ ip6_addr = InstallInf["IP6"]
+ if !ip6_addr.empty?
+ ifcfg << "LABEL_ipv6='ipv6'\n"
+ ifcfg << "IPADDR_ipv6='#{ip6_addr}'\n"
+ end
+
+ when "dhcp"
+ ifcfg << "BOOTPROTO='dhcp4'\n"
+
+ when "dhcp6"
+ ifcfg << "BOOTPROTO='dhcp6'\n"
+
+ when "dhcp,dhcp6"
+ ifcfg << "BOOTPROTO='dhcp'\n"
+ end
+
+ # set DHCP_SET_HOSTNAME=yes #suse30528
+ if bootproto =~ /dhcp/
+ log.info("set DHCLIENT_SET_HOSTNAME=yes on installed system")
+ SCR.Execute(
+ BASH_PATH,
+ "sed -i s/\"DHCLIENT_SET_HOSTNAME=.*\"/'DHCLIENT_SET_HOSTNAME=\"yes\"'/g /etc/sysconfig/network/dhcp"
+ )
+ end
+
+ ifcfg << "STARTMODE='onboot'\n"
+
+ # wireless devices (bnc#223570)
+ ifcfg << create_wlan_ifcfg
+
+ # if available, write MTU
+ mtu = InstallInf["IP_MTU"]
+ ifcfg << "MTU='#{mtu}'\n" if !mtu.empty?
+
+ # for qeth devices (s390)
+ # bnc#578689 - YaST2 should not write the MAC address into ifcfg file
+ hardware = ReadHardware("netcard")
+ log.info("hardware: #{hardware}")
+
+ ifcfg << create_s390_ifcfg(hardware) if Arch.s390
+
+ # point to point interface
+ remote_ip = InstallInf["Pointopoint"]
+ ifcfg << "REMOTE_IPADDR='#{remote_ip}'\n" if !remote_ip.empty?
+
+ ifcfg << create_device_name_ifcfg(hardware)
+
+ log.info("Network Configuration:\n#{ifcfg}")
+
+ ifcfg
+ end
+
+ # create all network files except ifcfg and hwcfg
+ # directly to installed system
+ def write_global_netconfig
+ # create hostname
+ write_hostname
+
+ if InstallInf["NetConfig"] == "static"
+ write_gateway
+
+ # write DHCPTimeout linuxrc parameter as /etc/sysconfig/network/config.WAIT_FOR_INTERFACES (bnc#396824)
+ write_dhcp_timeout
+
+ # create resolv.conf only for static configuration
+ write_dns
+ end
+
+ # create proxy sysconfig file
+ write_proxy
+
+ # create defaultdomain
+ write_nis_domain
+
+ # write wait_for_interfaces if needed
+ write_connect_wait
+
+ nil
+ end
+
+ def write_dhcp_timeout
+ dhcp_timeout = InstallInf["DHCPTimeout"].to_s
+
+ return false if dhcp_timeout.empty?
+
+ log.info("Writing WAIT_FOR_INTERFACES=#{dhcp_timeout}")
+ SCR.Write(path(".sysconfig.network.config.WAIT_FOR_INTERFACES"), dhcp_timeout)
+ end
+
+ def write_gateway
+ gateway = InstallInf["Gateway"].to_s
+ ptp = InstallInf["Pointopoint"].to_s
+
+ # create routes file
+ if !gateway.empty?
+ log.info("Writing route : #{gateway}")
+ return SCR.Write(
+ path(".target.string"),
+ "/etc/sysconfig/network/routes",
+ "default #{gateway} - -\n")
+ elsif !ptp.empty?
+ log.info("Writing Peer-to-Peer route: #{ptp}")
+ return SCR.Write(
+ path(".target.string"),
+ "/etc/sysconfig/network/routes",
+ "default #{ptp} - -\n"
+ )
+ else
+ log.warn("No routing information in install.inf")
+ return false
+ end
+ end
+
+ def hostname
+ hostname = InstallInf["Hostname"].to_s
+
+ # do not have numeric hostname, #152218
+ return "" if hostname.empty? || IP.Check(hostname)
+ return hostname
+ end
+
+ def write_hostname
+ return false if hostname.empty?
+
+ log.info("Write HOSTNAME: #{hostname}")
+ SCR.Write(path(".target.string"), "/etc/HOSTNAME", hostname)
+ end
+
+ def write_dns
+ nameserver = InstallInf["Nameserver"].to_s
+
+ return false if nameserver.empty?
+
+ # hostname is supposed to be FQDN (http://en.opensuse.org/Linuxrc)
+ # remember domain, use it as fallback below, if there is no DNS search
+ # domain (#476208)
+ split = Hostname.SplitFQ(hostname) if !hostname.empty? && !IP.Check(hostname)
+ fqdomain = ""
+ fqdomain = split[1].to_s if split
+
+ serverlist = nameserver
+ # write also secondary and third nameserver when available (bnc#446101)
+ nameserver2 = InstallInf["Nameserver2"].to_s
+ serverlist << " " << nameserver2 if !nameserver2.empty?
+
+ nameserver3 = InstallInf["Nameserver3"].to_s
+ serverlist << " " << nameserver3 if !nameserver3.empty?
+
+ # Do not write /etc/resolv.conf directly, feed the data to sysconfig instead,
+ # 'netconfig' will do the job later on network startup (FaTE #303618)
+ SCR.Write(
+ path(".sysconfig.network.config.NETCONFIG_DNS_STATIC_SERVERS"),
+ serverlist
+ )
+ log.info("Writing static nameserver entry: #{nameserver}")
+
+ # Enter search domain data only if present
+ domain = InstallInf["Domain"].to_s
+ if !domain.empty?
+ SCR.Write(
+ path(".sysconfig.network.config.NETCONFIG_DNS_STATIC_SEARCHLIST"),
+ domain
+ )
+ log.info("Writing static searchlist entry: #{domain}")
+ elsif !fqdomain.empty?
+ SCR.Write(
+ path(".sysconfig.network.config.NETCONFIG_DNS_STATIC_SEARCHLIST"),
+ fqdomain
+ )
+ log.info("No DNS search domain defined, using FQ domain name #{fqdomain} as a fallback")
+ end
+
+ #We're done. It is OK not to touch NETCONFIG_DNS_POLICY now as it is set to 'auto' by default
+ #and user did not have a chance to modify it up to now
+ SCR.Write(path(".sysconfig.network.config"), nil)
+ end
+
+ def write_proxy
+ proxyUrl = InstallInf["ProxyUrl"].to_s
+ proxyProto = InstallInf["ProxyProto"].to_s
+
+ return false if proxyProto.empty? || proxyUrl.empty?
+
+ log.info("Writing proxy settings: #{proxyProto}_proxy = '#{proxyUrl}'")
+
+ Proxy.Read
+ ex = Proxy.Export
+
+ # bnc#693640 - update Proxy module's configuration
+ # username and password is stored in url because it is handled by linuxrc this way and it is impossible
+ # to distinguish how the user inserted it (separate or as a part of url?)
+ ex["#{proxyProto}_proxy"] = proxyUrl if ex
+ log.debug("Written proxy settings: #{ex}")
+
+ Proxy.Import(ex)
+ Proxy.Write
+ end
+
+ def write_nis_domain
+ nisdomain = InstallInf["NISDomain"].to_s
+
+ return false if nisdomain.empty? || !FileUtils.Exists("/etc/defaultdomain")
+
+ log.info("Write defaultdomain: #{nisdomain}")
+ SCR.Write(path(".target.string"), "/etc/defaultdomain", nisdomain)
+ end
+
+ def write_connect_wait
+ connect_wait = InstallInf["ConnectWait"].to_s
+
+ return false if connect_wait.empty?
+
+ ret = SCR.Execute(
+ BASH_PATH,
+ "sed -i s/^WAIT_FOR_INTERFACES=.*/WAIT_FOR_INTERFACES=%s/g /etc/sysconfig/network/config" % connect_wait
+ )
+
+ return ret == 0
+ end
+
+ def dev_name
+ netdevice = InstallInf["Netdevice"].to_s
+
+ if Mode.autoinst
+ # if possible, for temporary installation network use same device
+ # with same MAC address (even if devicename changed) (bnc#648270)
+ new_devname = LanUdevAuto.GetDevnameByMAC(InstallInf["HWAddr"])
+
+ netdevice = new_devname if !new_devname.empty?
+ end
+
+ log.info("InstInstallInfClient#dev_name:#{netdevice}")
+ return netdevice
+ end
+
+ def stdout_of(command)
+ SCR.Execute(path(".target.bash_output"), command)["stdout"].to_s
+ end
+
+ def create_wlan_ifcfg
+ wlan_key = InstallInf["WlanKey"]
+ wlan_essid = InstallInf["WlanESSID"]
+ wlan_key_type = InstallInf["WlanKeyType"]
+ wlan_auth = InstallInf["WlanAuth"]
+ wlan_key_len = InstallInf["WlanKeyLen"]
+
+ return "" if wlan_essid.empty?
+
+ ifcfg = "WIRELESS_ESSID='#{wlan_essid}'\n"
+
+ case wlan_auth
+ when "", "psk"
+ ifcfg << "WIRELESS_WPA_PSK='#{wlan_key}'\n"
+ ifcfg << "WIRELESS_AUTH_MODE='psk'\n"
+
+ when "open"
+ ifcfg << "WIRELESS_AUTH_MODE='no-encryption'\n"
+
+ when "wep_open", "wep_restricted"
+ if wlan_key_type == "password"
+ type = "h:"
+ elsif wlan_key_type == "ascii"
+ type = "s:"
+ else
+ type = wlan_key_type[0] + ":"
+ end
+
+ auth_mode = wlan_auth == "wep-open" ? "open" : "sharedkey"
+
+ ifcfg << "WIRELESS_AUTH_MODE='%s'\n" % wlan_auth_mode
+ ifcfg << "WIRELESS_DEFAULT_KEY='0'\n"
+ ifcfg << "WIRELESS_KEY_0='#{type}#{wlan_key}'\n"
+ ifcfg << "WIRELESS_KEY_LENGTH='#{wlan_key_len}'\n"
+ end
+
+ return ifcfg
+ end
+
+ def create_s390_ifcfg(hardware)
+ hwaddr = InstallInf["HWAddr"]
+ return "" if hwaddr.empty?
+
+ netdevice = dev_name
+ return "" if netdevice.empty?
+
+ devtype = NetworkInterfaces.GetType(netdevice)
+
+ log.info("Interface type: #{devtype}")
+
+ # only some card types need a persistent MAC (bnc#658708)
+ sysfs_id = dev_name_to_sysfs_id(netdevice, hardware)
+ return "" if !s390_device_needs_persistent_mac(sysfs_id, hardware)
+
+ # hsi devices do not support setting hwaddr (bnc #479481)
+ return "" if devtype == "hsi"
+
+ # set HW address only for qeth set to Layer 2 (bnc #479481)
+ return "" if devtype == "eth" && InstallInf["QETH_LAYER2_SUPPORT"] != "1"
+
+ return "LLADDR='#{hwaddr}'\n"
+ end
+
+ def create_device_name_ifcfg(hardware)
+ device_name = dev_name
+
+ hw_name = BuildDescription(
+ NetworkInterfaces.device_type(device_name),
+ NetworkInterfaces.device_num(device_name),
+ { "dev_name" => device_name },
+ hardware
+ )
+
+ return "" if hw_name.empty?
+
+ # protect special characters, #305343
+ return "NAME='%s'\n" % String.Quote(hw_name)
+ end
+
+ def write_ifcfg(ifcfg)
+ device_name = dev_name
+
+ return false if device_name.empty?
+
+ if !LanUdevAuto.AllowUdevModify
+ # bnc#821427: use same options as in /lib/udev/rules.d/71-biosdevname.rules
+ cmd = "biosdevname --policy physical --smbios 2.6 --nopirq -i %s" % dev_name
+ out = String.FirstChunk(stdout_of(cmd), "\n")
+ if !out.empty?
+ device_name = out
+ log.info("biosdevname renames #{dev_name} to #{device_name}")
+ end
+ end
+
+ dev_file = "/etc/sysconfig/network/ifcfg-#{device_name}"
+
+ log.info("ifcfg file: #{dev_file}")
+ SCR.Write(path(".target.string"), dev_file, ifcfg)
+ end
+
+ end
+
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.23/test/Makefile.am new/yast2-network-3.1.29/test/Makefile.am
--- old/yast2-network-3.1.23/test/Makefile.am 2014-02-19 16:33:34.000000000 +0100
+++ new/yast2-network-3.1.29/test/Makefile.am 2014-02-28 17:03:50.000000000 +0100
@@ -5,7 +5,8 @@
bridge_test.rb \
routing_test.rb \
new_device_startmode_test.rb \
- widgets_test.rb
+ widgets_test.rb \
+ install_inf_convertor_test.rb
TEST_EXTENSIONS = .rb
RB_LOG_COMPILER = rspec
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.23/test/install_inf_convertor_test.rb new/yast2-network-3.1.29/test/install_inf_convertor_test.rb
--- old/yast2-network-3.1.23/test/install_inf_convertor_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-network-3.1.29/test/install_inf_convertor_test.rb 2014-02-28 17:03:50.000000000 +0100
@@ -0,0 +1,199 @@
+#!/usr/bin/env rspec
+
+ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)
+
+require "yast"
+require "network/install_inf_convertor"
+include Yast # for path shortcut and avoid namespace
+
+describe "InstallInfConvertor" do
+
+ context "in case of no network config in /etc/install.inf" do
+
+ before(:each) do
+ @install_inf_convertor = Yast::InstallInfConvertor.instance
+
+ expect(Yast::InstallInfConvertor::InstallInf)
+ .to receive(:[])
+ .at_least(:once) { nil }
+ end
+
+ describe "#write_dhcp_timeout" do
+ it "returns false" do
+ expect(@install_inf_convertor.send(:write_dhcp_timeout)).to be_false
+ end
+ end
+
+ describe "#hostname" do
+ it "returns empty string" do
+ expect(@install_inf_convertor.send(:hostname)).to be_empty
+ end
+ end
+
+ describe "#write_hostname" do
+ it "returns false" do
+ expect(@install_inf_convertor.send(:write_hostname)).to be_false
+ end
+ end
+
+ describe "#write_dns" do
+ it "returns false" do
+ expect(@install_inf_convertor.send(:write_dns)).to be_false
+ end
+ end
+
+ describe "#write_proxy" do
+ it "returns false" do
+ expect(@install_inf_convertor.send(:write_proxy)).to be_false
+ end
+ end
+
+ describe "#write_nis_domain" do
+ it "returns false" do
+ expect(@install_inf_convertor.send(:write_nis_domain)).to be_false
+ end
+ end
+
+ describe "#write_connect_wait" do
+ it "returns false" do
+ expect(@install_inf_convertor.send(:write_connect_wait)).to be_false
+ end
+ end
+
+ describe "#dev_name" do
+ it "returns empty string" do
+ expect(@install_inf_convertor.send(:dev_name)).to be_empty
+ end
+
+ it "returns empty string even in autoinst mode" do
+ Yast.import "Mode"
+ Mode.stub(:autoinst) { true }
+
+ expect(@install_inf_convertor.send(:dev_name)).to be_empty
+ end
+ end
+
+ describe "#write_ifcfg" do
+ it "returns false when attempting to write nil content" do
+ expect(@install_inf_convertor.send(:write_ifcfg, nil)).to eql false
+ end
+
+ it "returns false even when written content is not nil" do
+ expect(@install_inf_convertor.send(:write_ifcfg, "STARTMODE='onboot'\n")).to eql false
+ end
+ end
+ end
+
+ context "linuxrc provides dhcp configuration" do
+
+ before(:each) do
+ @device = "enp0s3"
+ @netconfig = "dhcp"
+
+ @install_inf_convertor = Yast::InstallInfConvertor.instance
+
+ Yast::InstallInfConvertor::InstallInf
+ .stub(:[]) { "" }
+ Yast::InstallInfConvertor::InstallInf
+ .stub(:[])
+ .with("Netdevice") { @device }
+ Yast::InstallInfConvertor::InstallInf
+ .stub(:[])
+ .with("NetConfig") { @netconfig }
+ end
+
+ describe "#dev_name" do
+ it "returns expected device name" do
+ expect(@install_inf_convertor.send(:dev_name)).to eql @device
+ end
+ end
+
+ describe "#write_ifcfg" do
+ it "creates ifcfg file for #{@device}" do
+ expect(SCR)
+ .to receive(:Write)
+ .with(path(".target.string"), /.*-#{@device}/, "") { true }
+ expect(@install_inf_convertor.send(:write_ifcfg, "")).to eql true
+ end
+ end
+
+ describe "#create_ifcfg" do
+ it "creates a valid ifcfg for netconfig" do
+ expect(ifcfg = @install_inf_convertor.send(:create_ifcfg)).not_to be_empty
+ expect(ifcfg).to match /BOOTPROTO='dhcp4'/
+ expect(ifcfg).to match /STARTMODE='onboot'/
+ expect(ifcfg).to match /NAME='.*'/
+ end
+ end
+ end
+
+ context "linuxrc provides static configuration" do
+
+ before(:each) do
+ Yast.import "Netmask"
+
+ @device = "enp0s3"
+ @ip = "10.121.157.133"
+ @netmask = "255.255.240.0"
+ @netconfig = "static"
+ @nameserver = "10.120.0.1"
+
+ @install_inf_convertor = Yast::InstallInfConvertor.instance
+
+ Yast::InstallInfConvertor::InstallInf
+ .stub(:[]) { "" }
+ Yast::InstallInfConvertor::InstallInf
+ .stub(:[])
+ .with("Netdevice") { @device }
+ Yast::InstallInfConvertor::InstallInf
+ .stub(:[])
+ .with("NetConfig") { @netconfig }
+ Yast::InstallInfConvertor::InstallInf
+ .stub(:[])
+ .with("IP") { @ip }
+ Yast::InstallInfConvertor::InstallInf
+ .stub(:[])
+ .with("Netmask") { @netmask }
+ Yast::InstallInfConvertor::InstallInf
+ .stub(:[])
+ .with("Nameserver") { @nameserver }
+ end
+
+ describe "#create_ifcfg" do
+ it "creates a valid ifcfg for netconfig" do
+ expect(ifcfg = @install_inf_convertor.send(:create_ifcfg)).not_to be_empty
+ expect(ifcfg).to match /BOOTPROTO='static'/
+ expect(ifcfg).to match /IPADDR='#{@ip}\/#{Netmask.ToBits(@netmask)}'/
+ end
+ end
+
+ describe "#write_global_netconfig" do
+ it "writes all expected configuration" do
+ expect(@install_inf_convertor)
+ .to receive(:write_dns)
+ expect(@install_inf_convertor.send(:write_global_netconfig))
+ .to eql nil
+ end
+ end
+
+ describe "#write_dns" do
+ it "updates global netconfig file" do
+ expect(Yast::SCR)
+ .to receive(:Write)
+ .with(
+ path(".sysconfig.network.config"),
+ nil
+ ) { true }
+ expect(Yast::SCR)
+ .to receive(:Write)
+ .with(
+ path(".sysconfig.network.config.NETCONFIG_DNS_STATIC_SERVERS"),
+ @nameserver
+ ).once { true }
+ expect(@install_inf_convertor.send(:write_dns)).to eql true
+ end
+ end
+
+ end
+
+end
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2014-03-01 14:38:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old)
and /work/SRC/openSUSE:Factory/.yast2-packager.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-packager"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2014-02-21 13:48:05.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes 2014-03-01 14:38:28.000000000 +0100
@@ -1,0 +2,13 @@
+Fri Feb 28 13:24:48 UTC 2014 - jreidinger(a)suse.com
+
+- Fix iso detection for DVD capable UEFI boot(BNC#852436)
+- 3.1.6
+
+-------------------------------------------------------------------
+Wed Feb 26 14:46:40 UTC 2014 - lslezak(a)suse.cz
+
+- Always prefer DVD medium to download (not only during update)
+ (bnc#865819)
+- 3.1.5
+
+-------------------------------------------------------------------
Old:
----
yast2-packager-3.1.4.tar.bz2
New:
----
yast2-packager-3.1.6.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-packager.spec ++++++
--- /var/tmp/diff_new_pack.1az6Sl/_old 2014-03-01 14:38:29.000000000 +0100
+++ /var/tmp/diff_new_pack.1az6Sl/_new 2014-03-01 14:38:29.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-packager
-Version: 3.1.4
+Version: 3.1.6
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ yast2-packager-3.1.4.tar.bz2 -> yast2-packager-3.1.6.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.4/package/yast2-packager.changes new/yast2-packager-3.1.6/package/yast2-packager.changes
--- old/yast2-packager-3.1.4/package/yast2-packager.changes 2014-02-19 14:21:58.000000000 +0100
+++ new/yast2-packager-3.1.6/package/yast2-packager.changes 2014-02-28 14:44:49.000000000 +0100
@@ -1,4 +1,17 @@
-------------------------------------------------------------------
+Fri Feb 28 13:24:48 UTC 2014 - jreidinger(a)suse.com
+
+- Fix iso detection for DVD capable UEFI boot(BNC#852436)
+- 3.1.6
+
+-------------------------------------------------------------------
+Wed Feb 26 14:46:40 UTC 2014 - lslezak(a)suse.cz
+
+- Always prefer DVD medium to download (not only during update)
+ (bnc#865819)
+- 3.1.5
+
+-------------------------------------------------------------------
Mon Feb 17 16:30:26 CET 2014 - locilka(a)suse.com
- Package tightvnc is no more required while installing over VNC
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.4/package/yast2-packager.spec new/yast2-packager-3.1.6/package/yast2-packager.spec
--- old/yast2-packager-3.1.4/package/yast2-packager.spec 2014-02-19 14:21:58.000000000 +0100
+++ new/yast2-packager-3.1.6/package/yast2-packager.spec 2014-02-28 14:44:49.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-packager
-Version: 3.1.4
+Version: 3.1.6
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.4/src/clients/inst_kickoff.rb new/yast2-packager-3.1.6/src/clients/inst_kickoff.rb
--- old/yast2-packager-3.1.4/src/clients/inst_kickoff.rb 2014-02-19 14:21:59.000000000 +0100
+++ new/yast2-packager-3.1.6/src/clients/inst_kickoff.rb 2014-02-28 14:44:50.000000000 +0100
@@ -60,6 +60,10 @@
end
end
+ # prefer CD/DVD media to download during installation/update
+ Builtins.y2milestone("Prefer CD/DVD media to download")
+ Pkg.SetZConfig({ "download_media_prefer_download" => false })
+
# installation, for instance...
if !Mode.update
# make some directories
@@ -162,10 +166,6 @@
WFM.CallFunction("inst_bootloader", WFM.Args)
# }
else
- # prefer CD/DVD media to download during installation/update
- Builtins.y2milestone("Update mode - prefer CD/DVD media to download")
- Pkg.SetZConfig({ "download_media_prefer_download" => false })
-
if Stage.normal
Yast.import "Kernel"
@kernel = Kernel.ComputePackage
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.1.4/src/modules/SourceDialogs.rb new/yast2-packager-3.1.6/src/modules/SourceDialogs.rb
--- old/yast2-packager-3.1.4/src/modules/SourceDialogs.rb 2014-02-19 14:21:59.000000000 +0100
+++ new/yast2-packager-3.1.6/src/modules/SourceDialogs.rb 2014-02-28 14:44:50.000000000 +0100
@@ -910,13 +910,15 @@
file = "/usr/bin/file"
# try to detect ISO image by file if it's present
if Ops.greater_than(SCR.Read(path(".target.size"), file), 0)
- command = Builtins.sformat("%1 -b -- '%2'", file, String.Quote(s))
+ # Use also -k as new images contain at first DOS boot sector for UEFI
+ # then iso magic block
+ command = Builtins.sformat("%1 -kb -- '%2'", file, String.Quote(s))
- out = Convert.to_map(SCR.Execute(path(".target.bash_output"), command))
+ out = SCR.Execute(path(".target.bash_output"), command)
- stdout = Ops.get_string(out, "stdout", "")
+ stdout = out["stdout"] || ""
- if Builtins.issubstring(stdout, "ISO 9660 CD-ROM filesystem")
+ if stdout.include? "ISO 9660 CD-ROM filesystem"
Builtins.y2milestone("ISO 9660 image detected")
else
# continue/cancel popup, %1 is a file name
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package yast2-storage for openSUSE:Factory checked in at 2014-03-01 14:38:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-storage (Old)
and /work/SRC/openSUSE:Factory/.yast2-storage.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-storage"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-storage/yast2-storage.changes 2014-02-26 23:20:31.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-storage.new/yast2-storage.changes 2014-03-01 14:38:27.000000000 +0100
@@ -1,0 +2,6 @@
+Tue Feb 25 15:37:49 CET 2014 - aschnell(a)suse.de
+
+- fixed snapshots handling in proposal (bnc#865004)
+- version 3.1.11
+
+-------------------------------------------------------------------
Old:
----
yast2-storage-3.1.10.tar.bz2
New:
----
yast2-storage-3.1.11.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-storage.spec ++++++
--- /var/tmp/diff_new_pack.QkNTqa/_old 2014-03-01 14:38:27.000000000 +0100
+++ /var/tmp/diff_new_pack.QkNTqa/_new 2014-03-01 14:38:27.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-storage
-Version: 3.1.10
+Version: 3.1.11
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ yast2-storage-3.1.10.tar.bz2 -> yast2-storage-3.1.11.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/package/yast2-storage.changes new/yast2-storage-3.1.11/package/yast2-storage.changes
--- old/yast2-storage-3.1.10/package/yast2-storage.changes 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/package/yast2-storage.changes 2014-02-28 15:20:23.000000000 +0100
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Tue Feb 25 15:37:49 CET 2014 - aschnell(a)suse.de
+
+- fixed snapshots handling in proposal (bnc#865004)
+- version 3.1.11
+
+-------------------------------------------------------------------
Mon Feb 24 16:15:28 CET 2014 - aschnell(a)suse.de
- disallow to create and delete partitions on ECKD DASDs if other
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/package/yast2-storage.spec new/yast2-storage-3.1.11/package/yast2-storage.spec
--- old/yast2-storage-3.1.10/package/yast2-storage.spec 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/package/yast2-storage.spec 2014-02-28 15:20:23.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-storage
-Version: 3.1.10
+Version: 3.1.11
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/src/include/partitioning/ep-btrfs-dialogs.rb new/yast2-storage-3.1.11/src/include/partitioning/ep-btrfs-dialogs.rb
--- old/yast2-storage-3.1.10/src/include/partitioning/ep-btrfs-dialogs.rb 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/src/include/partitioning/ep-btrfs-dialogs.rb 2014-02-28 15:20:23.000000000 +0100
@@ -33,7 +33,8 @@
Builtins.y2milestone("DlgEditBtrfsVolume %1", data.value)
device = Ops.get_string(data.value, "device", "error")
- aliases = { "FormatMount" => lambda do
+ aliases = {
+ "FormatMount" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepFormatMount_result = MiniWorkflowStepFormatMount(
@@ -42,15 +43,16 @@
data.value = data_ref.value;
_MiniWorkflowStepFormatMount_result
)
- end, "Password" => lambda(
- ) do
+ end,
+ "Password" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepPassword_result = MiniWorkflowStepPassword(data_ref);
data.value = data_ref.value;
_MiniWorkflowStepPassword_result
)
- end }
+ end
+ }
sequence = {
"FormatMount" => { :next => "Password", :finish => :finish },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/src/include/partitioning/ep-dm-dialogs.rb new/yast2-storage-3.1.11/src/include/partitioning/ep-dm-dialogs.rb
--- old/yast2-storage-3.1.10/src/include/partitioning/ep-dm-dialogs.rb 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/src/include/partitioning/ep-dm-dialogs.rb 2014-02-28 15:20:23.000000000 +0100
@@ -32,7 +32,8 @@
def DlgEditDmVolume(data)
device = Ops.get_string(data.value, "device", "error")
- aliases = { "FormatMount" => lambda do
+ aliases = {
+ "FormatMount" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepFormatMount_result = MiniWorkflowStepFormatMount(
@@ -41,15 +42,16 @@
data.value = data_ref.value;
_MiniWorkflowStepFormatMount_result
)
- end, "Password" => lambda(
- ) do
+ end,
+ "Password" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepPassword_result = MiniWorkflowStepPassword(data_ref);
data.value = data_ref.value;
_MiniWorkflowStepPassword_result
)
- end }
+ end
+ }
sequence = {
"FormatMount" => { :next => "Password", :finish => :finish },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/src/include/partitioning/ep-hd-dialogs.rb new/yast2-storage-3.1.11/src/include/partitioning/ep-hd-dialogs.rb
--- old/yast2-storage-3.1.10/src/include/partitioning/ep-hd-dialogs.rb 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/src/include/partitioning/ep-hd-dialogs.rb 2014-02-28 15:20:23.000000000 +0100
@@ -553,7 +553,8 @@
def DlgEditPartition(data)
device = Ops.get_string(data.value, "device", "error")
- aliases = { "FormatMount" => lambda do
+ aliases = {
+ "FormatMount" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepFormatMount_result = MiniWorkflowStepFormatMount(
@@ -562,15 +563,16 @@
data.value = data_ref.value;
_MiniWorkflowStepFormatMount_result
)
- end, "Password" => lambda(
- ) do
+ end,
+ "Password" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepPassword_result = MiniWorkflowStepPassword(data_ref);
data.value = data_ref.value;
_MiniWorkflowStepPassword_result
)
- end }
+ end
+ }
sequence = {
"FormatMount" => { :next => "Password", :finish => :finish },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/src/include/partitioning/ep-loop-dialogs.rb new/yast2-storage-3.1.11/src/include/partitioning/ep-loop-dialogs.rb
--- old/yast2-storage-3.1.10/src/include/partitioning/ep-loop-dialogs.rb 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/src/include/partitioning/ep-loop-dialogs.rb 2014-02-28 15:20:23.000000000 +0100
@@ -295,7 +295,8 @@
def DlgEditLoop(data)
device = Ops.get_string(data.value, "device", "error")
- aliases = { "FormatMount" => lambda do
+ aliases = {
+ "FormatMount" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepFormatMount_result = MiniWorkflowStepFormatMount(
@@ -304,15 +305,16 @@
data.value = data_ref.value;
_MiniWorkflowStepFormatMount_result
)
- end, "Password" => lambda(
- ) do
+ end,
+ "Password" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepPassword_result = MiniWorkflowStepPassword(data_ref);
data.value = data_ref.value;
_MiniWorkflowStepPassword_result
)
- end }
+ end
+ }
sequence = {
"FormatMount" => { :next => "Password", :finish => :finish },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/src/include/partitioning/ep-lvm-dialogs.rb new/yast2-storage-3.1.11/src/include/partitioning/ep-lvm-dialogs.rb
--- old/yast2-storage-3.1.10/src/include/partitioning/ep-lvm-dialogs.rb 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/src/include/partitioning/ep-lvm-dialogs.rb 2014-02-28 15:20:23.000000000 +0100
@@ -458,14 +458,16 @@
def DlgCreateVolumeGroupNew(data)
- aliases = { "TheOne" => lambda do
+ aliases = {
+ "TheOne" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepVg_result = MiniWorkflowStepVg(data_ref);
data.value = data_ref.value;
_MiniWorkflowStepVg_result
)
- end }
+ end
+ }
sequence = { "TheOne" => { :finish => :finish } }
@@ -1031,7 +1033,8 @@
def DlgEditLogicalVolume(data)
device = Ops.get_string(data.value, "device", "error")
- aliases = { "FormatMount" => lambda do
+ aliases = {
+ "FormatMount" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepFormatMount_result = MiniWorkflowStepFormatMount(
@@ -1040,15 +1043,16 @@
data.value = data_ref.value;
_MiniWorkflowStepFormatMount_result
)
- end, "Password" => lambda(
- ) do
+ end,
+ "Password" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepPassword_result = MiniWorkflowStepPassword(data_ref);
data.value = data_ref.value;
_MiniWorkflowStepPassword_result
)
- end }
+ end
+ }
sequence = {
"FormatMount" => { :next => "Password", :finish => :finish },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/src/include/partitioning/ep-raid-dialogs.rb new/yast2-storage-3.1.11/src/include/partitioning/ep-raid-dialogs.rb
--- old/yast2-storage-3.1.10/src/include/partitioning/ep-raid-dialogs.rb 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/src/include/partitioning/ep-raid-dialogs.rb 2014-02-28 15:20:23.000000000 +0100
@@ -645,7 +645,8 @@
def DlgResizeRaid(data)
- aliases = { "TheOne" => lambda do
+ aliases = {
+ "TheOne" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepResizeRaid_result = MiniWorkflowStepResizeRaid(
@@ -654,7 +655,8 @@
data.value = data_ref.value;
_MiniWorkflowStepResizeRaid_result
)
- end }
+ end
+ }
sequence = { "TheOne" => { :finish => :finish } }
@@ -679,7 +681,8 @@
def DlgEditRaid(data)
device = Ops.get_string(data.value, "device", "error")
- aliases = { "FormatMount" => lambda do
+ aliases = {
+ "FormatMount" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepFormatMount_result = MiniWorkflowStepFormatMount(
@@ -688,15 +691,16 @@
data.value = data_ref.value;
_MiniWorkflowStepFormatMount_result
)
- end, "Password" => lambda(
- ) do
+ end,
+ "Password" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepPassword_result = MiniWorkflowStepPassword(data_ref);
data.value = data_ref.value;
_MiniWorkflowStepPassword_result
)
- end }
+ end
+ }
sequence = {
"FormatMount" => { :next => "Password", :finish => :finish },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/src/include/partitioning/ep-tmpfs-dialogs.rb new/yast2-storage-3.1.11/src/include/partitioning/ep-tmpfs-dialogs.rb
--- old/yast2-storage-3.1.10/src/include/partitioning/ep-tmpfs-dialogs.rb 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/src/include/partitioning/ep-tmpfs-dialogs.rb 2014-02-28 15:20:23.000000000 +0100
@@ -30,7 +30,8 @@
end
def DlgCreateTmpfs(data)
- aliases = { "FormatMount" => lambda do
+ aliases = {
+ "FormatMount" => lambda do
(
data_ref = arg_ref(data.value);
_MiniWorkflowStepFormatMount_result = MiniWorkflowStepFormatMount(
@@ -39,7 +40,8 @@
data.value = data_ref.value;
_MiniWorkflowStepFormatMount_result
)
- end }
+ end
+ }
sequence = { "FormatMount" => { :finish => :finish } }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/src/modules/StorageProposal.rb new/yast2-storage-3.1.11/src/modules/StorageProposal.rb
--- old/yast2-storage-3.1.10/src/modules/StorageProposal.rb 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/src/modules/StorageProposal.rb 2014-02-28 15:20:23.000000000 +0100
@@ -4040,6 +4040,7 @@
if Ops.get_boolean(ps1, "ok", false)
ret = Ops.get_list(ps1, ["disk", "partitions"], [])
end
+ ret = post_process_partitions(ret)
Builtins.y2milestone("get_proposal ret:%1", ret)
deep_copy(ret)
end
@@ -4393,31 +4394,40 @@
end
- def post_process_target(target)
+ def post_process_partitions(partitions)
- target.each do |device, container|
- container["partitions"].each do |volume|
+ partitions.each do |volume|
- # if we have a home volume remove the home subvolume
- if PropDefaultFs() == :btrfs && GetProposalHome()
- if volume["mount"] == "/"
- if FileSystems.default_subvol.empty?
- home = "home"
- else
- home = FileSystems.default_subvol + "/" + "home"
- end
- volume["subvol"].delete_if { |subvol| subvol["name"] == home }
+ # if we have a home volume remove the home subvolume
+ if PropDefaultFs() == :btrfs && GetProposalHome()
+ if volume["mount"] == "/"
+ if FileSystems.default_subvol.empty?
+ home = "home"
+ else
+ home = FileSystems.default_subvol + "/" + "home"
end
+ volume["subvol"].delete_if { |subvol| subvol["name"] == home }
end
+ end
- # enable snapshots for root volume if desired
- if PropDefaultFs() == :btrfs && GetProposalSnapshots()
- if volume["mount"] == "/"
- volume["userdata"] = { "/" => "snapshots" }
- end
+ # enable snapshots for root volume if desired
+ if PropDefaultFs() == :btrfs && GetProposalSnapshots()
+ if volume["mount"] == "/"
+ volume["userdata"] = { "/" => "snapshots" }
end
-
end
+
+ end
+
+ return partitions
+
+ end
+
+
+ def post_process_target(target)
+
+ target.each do |device, container|
+ container["partitions"] = post_process_partitions(container["partitions"])
end
return target
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/empty-efi1.out new/yast2-storage-3.1.11/testsuite/tests/empty-efi1.out
--- old/yast2-storage-3.1.10/testsuite/tests/empty-efi1.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/empty-efi1.out 2014-02-28 15:20:23.000000000 +0100
@@ -14,3 +14,5 @@
Dump Create subvolume var/opt on device /dev/sda3
Dump Create subvolume var/spool on device /dev/sda3
Dump Create subvolume var/tmp on device /dev/sda3
+Dump
+Dump Extra Data:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/empty-efi2.out new/yast2-storage-3.1.11/testsuite/tests/empty-efi2.out
--- old/yast2-storage-3.1.10/testsuite/tests/empty-efi2.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/empty-efi2.out 2014-02-28 15:20:23.000000000 +0100
@@ -14,3 +14,5 @@
Dump Create subvolume var/opt on device /dev/sda3
Dump Create subvolume var/spool on device /dev/sda3
Dump Create subvolume var/tmp on device /dev/sda3
+Dump
+Dump Extra Data:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/empty-s390x1.out new/yast2-storage-3.1.11/testsuite/tests/empty-s390x1.out
--- old/yast2-storage-3.1.10/testsuite/tests/empty-s390x1.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/empty-s390x1.out 2014-02-28 15:20:23.000000000 +0100
@@ -13,3 +13,6 @@
Dump Create subvolume var/opt on device /dev/sda3
Dump Create subvolume var/spool on device /dev/sda3
Dump Create subvolume var/tmp on device /dev/sda3
+Dump
+Dump Extra Data:
+Dump device:/dev/sda3 userdata:{"/"=>"snapshots"}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/empty-s390x1.rb new/yast2-storage-3.1.11/testsuite/tests/empty-s390x1.rb
--- old/yast2-storage-3.1.10/testsuite/tests/empty-s390x1.rb 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/empty-s390x1.rb 2014-02-28 15:20:23.000000000 +0100
@@ -17,6 +17,7 @@
ProductFeatures.SetBooleanFeature("partitioning", "proposal_lvm", false)
ProductFeatures.SetStringFeature("partitioning", "vm_desired_size", "30 GB")
ProductFeatures.SetStringFeature("partitioning", "root_base_size", "20 GB")
+ ProductFeatures.SetBooleanFeature("partitioning", "proposal_snapshots", true)
Yast.include self, "helper1b.rb"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/empty1.out new/yast2-storage-3.1.11/testsuite/tests/empty1.out
--- old/yast2-storage-3.1.10/testsuite/tests/empty1.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/empty1.out 2014-02-28 15:20:23.000000000 +0100
@@ -12,3 +12,5 @@
Dump Create subvolume var/opt on device /dev/sda2
Dump Create subvolume var/spool on device /dev/sda2
Dump Create subvolume var/tmp on device /dev/sda2
+Dump
+Dump Extra Data:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/empty2.out new/yast2-storage-3.1.11/testsuite/tests/empty2.out
--- old/yast2-storage-3.1.10/testsuite/tests/empty2.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/empty2.out 2014-02-28 15:20:23.000000000 +0100
@@ -1,7 +1,7 @@
Dump Proposal:
Dump Create swap volume /dev/sda1 (2.01 GiB)
-Dump Create root volume /dev/sda2 (20.00 GiB) with btrfs
-Dump Create volume /dev/sda3 (276.08 GiB) for /home with xfs
+Dump Create root volume /dev/sda2 (40.00 GiB) with btrfs
+Dump Create volume /dev/sda3 (256.08 GiB) for /home with xfs
Dump Create subvolume boot/grub2/i386-pc on device /dev/sda2
Dump Create subvolume opt on device /dev/sda2
Dump Create subvolume srv on device /dev/sda2
@@ -12,3 +12,6 @@
Dump Create subvolume var/opt on device /dev/sda2
Dump Create subvolume var/spool on device /dev/sda2
Dump Create subvolume var/tmp on device /dev/sda2
+Dump
+Dump Extra Data:
+Dump device:/dev/sda2 userdata:{"/"=>"snapshots"}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/empty2.rb new/yast2-storage-3.1.11/testsuite/tests/empty2.rb
--- old/yast2-storage-3.1.10/testsuite/tests/empty2.rb 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/empty2.rb 2014-02-28 15:20:23.000000000 +0100
@@ -14,7 +14,7 @@
ProductFeatures.SetBooleanFeature("partitioning", "try_separate_home", true)
ProductFeatures.SetBooleanFeature("partitioning", "proposal_lvm", false)
- ProductFeatures.SetBooleanFeature("partitioning", "proposal_snapshots", false)
+ ProductFeatures.SetBooleanFeature("partitioning", "proposal_snapshots", true)
ProductFeatures.SetStringFeature("partitioning", "vm_desired_size", "30 GB")
ProductFeatures.SetStringFeature("partitioning", "root_base_size", "20 GB")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/empty3.out new/yast2-storage-3.1.11/testsuite/tests/empty3.out
--- old/yast2-storage-3.1.10/testsuite/tests/empty3.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/empty3.out 2014-02-28 15:20:23.000000000 +0100
@@ -15,3 +15,5 @@
Dump Create subvolume var/opt on device /dev/system/root
Dump Create subvolume var/spool on device /dev/system/root
Dump Create subvolume var/tmp on device /dev/system/root
+Dump
+Dump Extra Data:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/empty4.out new/yast2-storage-3.1.11/testsuite/tests/empty4.out
--- old/yast2-storage-3.1.10/testsuite/tests/empty4.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/empty4.out 2014-02-28 15:20:23.000000000 +0100
@@ -16,3 +16,5 @@
Dump Create subvolume var/opt on device /dev/system/root
Dump Create subvolume var/spool on device /dev/system/root
Dump Create subvolume var/tmp on device /dev/system/root
+Dump
+Dump Extra Data:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/empty5.out new/yast2-storage-3.1.11/testsuite/tests/empty5.out
--- old/yast2-storage-3.1.10/testsuite/tests/empty5.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/empty5.out 2014-02-28 15:20:23.000000000 +0100
@@ -15,3 +15,5 @@
Dump Create subvolume var/opt on device /dev/system/root
Dump Create subvolume var/spool on device /dev/system/root
Dump Create subvolume var/tmp on device /dev/system/root
+Dump
+Dump Extra Data:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/empty6.out new/yast2-storage-3.1.11/testsuite/tests/empty6.out
--- old/yast2-storage-3.1.10/testsuite/tests/empty6.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/empty6.out 2014-02-28 15:20:23.000000000 +0100
@@ -16,3 +16,5 @@
Dump Create subvolume var/opt on device /dev/system/root
Dump Create subvolume var/spool on device /dev/system/root
Dump Create subvolume var/tmp on device /dev/system/root
+Dump
+Dump Extra Data:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/empty7.out new/yast2-storage-3.1.11/testsuite/tests/empty7.out
--- old/yast2-storage-3.1.10/testsuite/tests/empty7.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/empty7.out 2014-02-28 15:20:23.000000000 +0100
@@ -12,3 +12,6 @@
Dump Create subvolume var/opt on device /dev/sda2
Dump Create subvolume var/spool on device /dev/sda2
Dump Create subvolume var/tmp on device /dev/sda2
+Dump
+Dump Extra Data:
+Dump device:/dev/sda2 userdata:{"/"=>"snapshots"}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/half-empty1.out new/yast2-storage-3.1.11/testsuite/tests/half-empty1.out
--- old/yast2-storage-3.1.10/testsuite/tests/half-empty1.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/half-empty1.out 2014-02-28 15:20:23.000000000 +0100
@@ -13,3 +13,5 @@
Dump Create subvolume var/opt on device /dev/sda6
Dump Create subvolume var/spool on device /dev/sda6
Dump Create subvolume var/tmp on device /dev/sda6
+Dump
+Dump Extra Data:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/helper1b.rb new/yast2-storage-3.1.11/testsuite/tests/helper1b.rb
--- old/yast2-storage-3.1.10/testsuite/tests/helper1b.rb 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/helper1b.rb 2014-02-28 15:20:23.000000000 +0100
@@ -12,22 +12,34 @@
StorageProposal.GetControlCfg
- @target_map = Storage.GetTargetMap
- @prop = StorageProposal.get_inst_prop(@target_map)
+ target_map = Storage.GetTargetMap()
+ prop = StorageProposal.get_inst_prop(target_map)
- if Ops.get_boolean(@prop, "ok", false)
- Storage.SetTargetMap(Ops.get_map(@prop, "target", {}))
+ if prop.fetch("ok", false)
+ Storage.SetTargetMap(prop.fetch("target", {}))
- @infos = Storage.GetCommitInfos
+ infos = Storage.GetCommitInfos
Testsuite.Dump("Proposal:")
- Builtins.foreach(@infos) do |info|
- text = Ops.get_string(info, :text, "")
- if Ops.get_boolean(info, :destructive, false)
- text = Ops.add(text, " [destructive]")
+ infos.each do |info|
+ text = info.fetch(:text, "")
+ if info.fetch(:destructive, false)
+ text += " [destructive]"
end
Testsuite.Dump(text)
end
+
+ Testsuite.Dump("")
+
+ Testsuite.Dump("Extra Data:")
+ prop["target"].each do |device, container|
+ container["partitions"].each do |volume|
+ if !volume.fetch("userdata", {}).empty?
+ Testsuite.Dump("device:#{volume["device"]} userdata:#{volume["userdata"]}")
+ end
+ end
+ end
+
else
Testsuite.Dump("No proposal.")
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/reuse-home1.out new/yast2-storage-3.1.11/testsuite/tests/reuse-home1.out
--- old/yast2-storage-3.1.10/testsuite/tests/reuse-home1.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/reuse-home1.out 2014-02-28 15:20:23.000000000 +0100
@@ -12,3 +12,5 @@
Dump Create subvolume var/tmp on device /dev/sda2
Dump Use /dev/sda1 as swap
Dump Set mount point of /dev/sda3 to /home
+Dump
+Dump Extra Data:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/windows-only-efi1.out new/yast2-storage-3.1.11/testsuite/tests/windows-only-efi1.out
--- old/yast2-storage-3.1.10/testsuite/tests/windows-only-efi1.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/windows-only-efi1.out 2014-02-28 15:20:23.000000000 +0100
@@ -14,3 +14,5 @@
Dump Create subvolume var/spool on device /dev/sda4
Dump Create subvolume var/tmp on device /dev/sda4
Dump Set mount point of /dev/sda1 to /boot/efi
+Dump
+Dump Extra Data:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/windows-only-efi1.rb new/yast2-storage-3.1.11/testsuite/tests/windows-only-efi1.rb
--- old/yast2-storage-3.1.10/testsuite/tests/windows-only-efi1.rb 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/windows-only-efi1.rb 2014-02-28 15:20:23.000000000 +0100
@@ -16,6 +16,7 @@
ProductFeatures.SetBooleanFeature("partitioning", "proposal_lvm", false)
ProductFeatures.SetStringFeature("partitioning", "root_max_size", "20 GB")
ProductFeatures.SetStringFeature("partitioning", "root_base_size", "15 GB")
+ ProductFeatures.SetBooleanFeature("partitioning", "proposal_snapshots", false)
Yast.include self, "helper1b.rb"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/windows-only1.out new/yast2-storage-3.1.11/testsuite/tests/windows-only1.out
--- old/yast2-storage-3.1.10/testsuite/tests/windows-only1.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/windows-only1.out 2014-02-28 15:20:23.000000000 +0100
@@ -14,3 +14,5 @@
Dump Create subvolume var/opt on device /dev/sda6
Dump Create subvolume var/spool on device /dev/sda6
Dump Create subvolume var/tmp on device /dev/sda6
+Dump
+Dump Extra Data:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-3.1.10/testsuite/tests/windows1.out new/yast2-storage-3.1.11/testsuite/tests/windows1.out
--- old/yast2-storage-3.1.10/testsuite/tests/windows1.out 2014-02-24 17:54:58.000000000 +0100
+++ new/yast2-storage-3.1.11/testsuite/tests/windows1.out 2014-02-28 15:20:23.000000000 +0100
@@ -13,3 +13,5 @@
Dump Create subvolume var/opt on device /dev/sda6
Dump Create subvolume var/spool on device /dev/sda6
Dump Create subvolume var/tmp on device /dev/sda6
+Dump
+Dump Extra Data:
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package yast2-installation for openSUSE:Factory checked in at 2014-03-01 14:38:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-installation (Old)
and /work/SRC/openSUSE:Factory/.yast2-installation.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-installation"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-installation/yast2-installation.changes 2014-02-23 07:16:22.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-installation.new/yast2-installation.changes 2014-03-01 14:38:24.000000000 +0100
@@ -1,0 +2,46 @@
+Thu Feb 27 15:08:12 CET 2014 - aschnell(a)suse.de
+
+- reset proposal after rescanning storage (bnc#865579)
+- 3.1.47
+
+-------------------------------------------------------------------
+Thu Feb 27 13:55:16 UTC 2014 - jreidinger(a)suse.com
+
+- revert back complete skip of probing due to disks with activation
+ (BNC#865579)
+- 3.1.46
+
+-------------------------------------------------------------------
+Thu Feb 27 12:54:37 UTC 2014 - jreidinger(a)suse.com
+
+- Do not rerun system probing as it is already done (BNC#865579)
+- 3.1.45
+
+-------------------------------------------------------------------
+Wed Feb 26 09:15:50 UTC 2014 - jreidinger(a)suse.com
+
+- implement cio ignore feature during installation for s390x
+ (FATE#315586)
+- 3.1.44
+
+-------------------------------------------------------------------
+Tue Feb 25 16:11:08 CET 2014 - locilka(a)suse.com
+
+- Removed an icon from License Agreement dialog (bnc#865575)
+- 3.1.43
+
+-------------------------------------------------------------------
+Tue Feb 25 14:14:59 CET 2014 - locilka(a)suse.com
+
+- Adapted ignored_features to handle possibly missing Cmdline entry
+ from Linuxrc (bnc#861465)
+- 3.1.42
+
+-------------------------------------------------------------------
+Tue Feb 25 13:27:34 CET 2014 - locilka(a)suse.cz
+
+- Removed hard-coded color and RichText formatting from
+ installation confirmation dialog (#bnc#865371)
+- 3.1.41
+
+-------------------------------------------------------------------
Old:
----
yast2-installation-3.1.40.tar.bz2
New:
----
yast2-installation-3.1.47.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-installation.spec ++++++
--- /var/tmp/diff_new_pack.HnZUEp/_old 2014-03-01 14:38:25.000000000 +0100
+++ /var/tmp/diff_new_pack.HnZUEp/_new 2014-03-01 14:38:25.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-installation
-Version: 3.1.40
+Version: 3.1.47
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ yast2-installation-3.1.40.tar.bz2 -> yast2-installation-3.1.47.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/package/yast2-installation.changes new/yast2-installation-3.1.47/package/yast2-installation.changes
--- old/yast2-installation-3.1.40/package/yast2-installation.changes 2014-02-21 15:15:55.000000000 +0100
+++ new/yast2-installation-3.1.47/package/yast2-installation.changes 2014-02-27 16:14:09.000000000 +0100
@@ -1,4 +1,50 @@
-------------------------------------------------------------------
+Thu Feb 27 15:08:12 CET 2014 - aschnell(a)suse.de
+
+- reset proposal after rescanning storage (bnc#865579)
+- 3.1.47
+
+-------------------------------------------------------------------
+Thu Feb 27 13:55:16 UTC 2014 - jreidinger(a)suse.com
+
+- revert back complete skip of probing due to disks with activation
+ (BNC#865579)
+- 3.1.46
+
+-------------------------------------------------------------------
+Thu Feb 27 12:54:37 UTC 2014 - jreidinger(a)suse.com
+
+- Do not rerun system probing as it is already done (BNC#865579)
+- 3.1.45
+
+-------------------------------------------------------------------
+Wed Feb 26 09:15:50 UTC 2014 - jreidinger(a)suse.com
+
+- implement cio ignore feature during installation for s390x
+ (FATE#315586)
+- 3.1.44
+
+-------------------------------------------------------------------
+Tue Feb 25 16:11:08 CET 2014 - locilka(a)suse.com
+
+- Removed an icon from License Agreement dialog (bnc#865575)
+- 3.1.43
+
+-------------------------------------------------------------------
+Tue Feb 25 14:14:59 CET 2014 - locilka(a)suse.com
+
+- Adapted ignored_features to handle possibly missing Cmdline entry
+ from Linuxrc (bnc#861465)
+- 3.1.42
+
+-------------------------------------------------------------------
+Tue Feb 25 13:27:34 CET 2014 - locilka(a)suse.cz
+
+- Removed hard-coded color and RichText formatting from
+ installation confirmation dialog (#bnc#865371)
+- 3.1.41
+
+-------------------------------------------------------------------
Fri Feb 21 14:54:01 CET 2014 - snwint(a)suse.de
- Make vnc use real yast theme (bnc #855246) and make vnc screen size configurable.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/package/yast2-installation.spec new/yast2-installation-3.1.47/package/yast2-installation.spec
--- old/yast2-installation-3.1.40/package/yast2-installation.spec 2014-02-21 15:15:55.000000000 +0100
+++ new/yast2-installation-3.1.47/package/yast2-installation.spec 2014-02-27 16:14:09.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-installation
-Version: 3.1.40
+Version: 3.1.47
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/src/Makefile.am new/yast2-installation-3.1.47/src/Makefile.am
--- old/yast2-installation-3.1.40/src/Makefile.am 2014-02-21 15:15:55.000000000 +0100
+++ new/yast2-installation-3.1.47/src/Makefile.am 2014-02-27 16:14:09.000000000 +0100
@@ -8,6 +8,8 @@
modules/SystemFilesCopy.rb
client_DATA = \
+ clients/cio_ignore_finish.rb \
+ clients/cio_ignore_proposal.rb \
clients/clone_proposal.rb \
clients/clone_finish.rb \
clients/copy_files_finish.rb \
@@ -103,7 +105,8 @@
ylibdir = "${yast2dir}/lib/installation"
ylib_DATA = \
lib/installation/clone_settings.rb \
- lib/installation/minimal_installation.rb
+ lib/installation/minimal_installation.rb \
+ lib/installation/cio_ignore.rb
EXTRA_DIST = $(module_DATA) $(client_DATA) $(ynclude_DATA) $(scrconf_DATA) $(schemafiles_DATA) $(desktop_DATA) $(fillup_DATA) $(ylib_DATA)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/src/clients/cio_ignore_finish.rb new/yast2-installation-3.1.47/src/clients/cio_ignore_finish.rb
--- old/yast2-installation-3.1.40/src/clients/cio_ignore_finish.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-installation-3.1.47/src/clients/cio_ignore_finish.rb 2014-02-27 16:14:09.000000000 +0100
@@ -0,0 +1,3 @@
+require "installation/cio_ignore"
+
+::Installation::CIOIgnoreFinish.new.run(*Yast::WFM.Args)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/src/clients/cio_ignore_proposal.rb new/yast2-installation-3.1.47/src/clients/cio_ignore_proposal.rb
--- old/yast2-installation-3.1.40/src/clients/cio_ignore_proposal.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-installation-3.1.47/src/clients/cio_ignore_proposal.rb 2014-02-27 16:14:09.000000000 +0100
@@ -0,0 +1,3 @@
+require "installation/cio_ignore"
+
+::Installation::CIOIgnoreProposal.new.run(*Yast::WFM.Args)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/src/clients/inst_complex_welcome.rb new/yast2-installation-3.1.47/src/clients/inst_complex_welcome.rb
--- old/yast2-installation-3.1.40/src/clients/inst_complex_welcome.rb 2014-02-21 15:15:55.000000000 +0100
+++ new/yast2-installation-3.1.47/src/clients/inst_complex_welcome.rb 2014-02-27 16:14:09.000000000 +0100
@@ -308,11 +308,8 @@
VSpacing(@text_mode ? 21 : 25),
VBox(
Left(
- HBox(
- Icon.Simple("yast-license"),
- # TRANSLATORS: dialog caption
- Heading(_("License Agreement"))
- )
+ # TRANSLATORS: dialog caption
+ Heading(_("License Agreement"))
),
VSpacing(@text_mode ? 0.1 : 0.5),
HSpacing(82),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/src/clients/inst_finish.rb new/yast2-installation-3.1.47/src/clients/inst_finish.rb
--- old/yast2-installation-3.1.40/src/clients/inst_finish.rb 2014-02-21 15:15:55.000000000 +0100
+++ new/yast2-installation-3.1.47/src/clients/inst_finish.rb 2014-02-27 16:14:09.000000000 +0100
@@ -150,6 +150,7 @@
"storage",
"iscsi-client",
"kernel",
+ "cio_ignore",
"x11",
"proxy",
"pkg",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/src/clients/inst_system_analysis.rb new/yast2-installation-3.1.47/src/clients/inst_system_analysis.rb
--- old/yast2-installation-3.1.40/src/clients/inst_system_analysis.rb 2014-02-21 15:15:55.000000000 +0100
+++ new/yast2-installation-3.1.47/src/clients/inst_system_analysis.rb 2014-02-27 16:14:09.000000000 +0100
@@ -77,8 +77,6 @@
@packager_initialized = false
- # <-- Function definitions
-
Wizard.SetContents(_("Analyzing the Computer"), Empty(), "", false, false)
Wizard.SetTitleIcon("yast-controller")
@@ -88,171 +86,73 @@
# constructors might depend on it.
# In autoinst mode, this has been called already.
- @actions_todo = []
- @actions_doing = []
- @actions_functions = []
+ actions_todo = []
+ actions_doing = []
+ actions_functions = []
Builtins.y2milestone("Probing done: %1", Installation.probing_done)
+ # skip part of probes as it doesn't change, but some parts (mostly disks
+ # that can be activated) need rerun see BNC#865579
if !Installation.probing_done
+ # TRANSLATORS: progress steps in system probing
if !(Arch.s390 || Arch.board_iseries)
- # TRANSLATORS: progress step
- @actions_todo = Builtins.add(@actions_todo, _("Probe USB devices"))
- # TRANSLATORS: progress step
- @actions_doing = Builtins.add(
- @actions_doing,
- _("Probing USB devices...")
- )
- @actions_functions = Builtins.add(
- @actions_functions,
- fun_ref(method(:ActionUSB), "boolean ()")
- )
-
- # TRANSLATORS: progress step
- @actions_todo = Builtins.add(
- @actions_todo,
- _("Probe FireWire devices")
- )
- # TRANSLATORS: progress step
- @actions_doing = Builtins.add(
- @actions_doing,
- _("Probing FireWire devices...")
- )
- @actions_functions = Builtins.add(
- @actions_functions,
- fun_ref(method(:ActionFireWire), "boolean ()")
- )
-
- # TRANSLATORS: progress step
- @actions_todo = Builtins.add(
- @actions_todo,
- _("Probe floppy disk devices")
- )
- # TRANSLATORS: progress step
- @actions_doing = Builtins.add(
- @actions_doing,
- _("Probing floppy disk devices...")
- )
- @actions_functions = Builtins.add(
- @actions_functions,
- fun_ref(method(:ActionFloppyDisks), "boolean ()")
- )
+ actions_todo << _("Probe USB devices")
+ actions_doing << _("Probing USB devices...")
+ actions_functions << fun_ref(method(:ActionUSB), "boolean ()")
+
+ actions_todo << _("Probe FireWire devices")
+ actions_doing << _("Probing FireWire devices...")
+ actions_functions << fun_ref(method(:ActionFireWire), "boolean ()")
+
+ actions_todo << _("Probe floppy disk devices")
+ actions_doing << _("Probing floppy disk devices...")
+ actions_functions << fun_ref(method(:ActionFloppyDisks), "boolean ()")
end
- # TRANSLATORS: progress step
- @actions_todo = Builtins.add(
- @actions_todo,
- _("Probe hard disk controllers")
- )
- # TRANSLATORS: progress step
- @actions_doing = Builtins.add(
- @actions_doing,
- _("Probing hard disk controllers...")
- )
- @actions_functions = Builtins.add(
- @actions_functions,
- fun_ref(method(:ActionHHDControllers), "boolean ()")
- )
-
- # TRANSLATORS: progress step
- @actions_todo = Builtins.add(
- @actions_todo,
- _("Load kernel modules for hard disk controllers")
- )
- # TRANSLATORS: progress step
- @actions_doing = Builtins.add(
- @actions_doing,
- _("Loading kernel modules for hard disk controllers...")
- )
- @actions_functions = Builtins.add(
- @actions_functions,
- fun_ref(method(:ActionLoadModules), "boolean ()")
- )
-
- # TRANSLATORS: progress step
- @actions_todo = Builtins.add(@actions_todo, _("Probe hard disks"))
- # TRANSLATORS: progress step
- @actions_doing = Builtins.add(
- @actions_doing,
- _("Probing hard disks...")
- )
- @actions_functions = Builtins.add(
- @actions_functions,
- fun_ref(method(:ActionHDDProbe), "boolean ()")
- )
+ actions_todo << _("Probe hard disk controllers")
+ actions_doing << _("Probing hard disk controllers...")
+ actions_functions << fun_ref(method(:ActionHHDControllers), "boolean ()")
+
+ actions_todo << _("Load kernel modules for hard disk controllers")
+ actions_doing << _("Loading kernel modules for hard disk controllers...")
+ actions_functions << fun_ref(method(:ActionLoadModules), "boolean ()")
+
+ actions_todo << _("Probe hard disks")
+ actions_doing << _("Probing hard disks...")
+ actions_functions << fun_ref(method(:ActionHDDProbe), "boolean ()")
WFM.CallFunction("inst_features", [])
end
- # TRANSLATORS: progress step
- @actions_todo = Builtins.add(
- @actions_todo,
- _("Search for Linux partitions")
- )
- # TRANSLATORS: progress step
- @actions_doing = Builtins.add(
- @actions_doing,
- _("Searching for Linux partitions...")
- )
- @actions_functions = Builtins.add(
- @actions_functions,
- fun_ref(method(:SearchForLinuxPartitions), "boolean ()")
- )
+ actions_todo << _("Search for Linux partitions")
+ actions_doing << _("Searching for Linux partitions...")
+ actions_functions << fun_ref(method(:SearchForLinuxPartitions), "boolean ()")
- # TRANSLATORS: progress step
- @actions_todo = Builtins.add(@actions_todo, _("Search for system files"))
- # TRANSLATORS: progress step
- @actions_doing = Builtins.add(
- @actions_doing,
- _("Searching for system files...")
- )
# FATE #302980: Simplified user config during installation
- @actions_functions = Builtins.add(
- @actions_functions,
- fun_ref(method(:FilesFromOlderSystems), "boolean ()")
- )
-
- # TRANSLATORS: progress step
- @actions_todo = Builtins.add(
- @actions_todo,
- _("Evaluate update possibility")
- )
- # TRANSLATORS: progress step
- @actions_doing = Builtins.add(
- @actions_doing,
- _("Evaluating update possibility...")
- )
- @actions_functions = Builtins.add(
- @actions_functions,
- fun_ref(method(:EvaluateUpdatePossibilities), "boolean ()")
- )
-
- # TRANSLATORS: progress step
- @actions_todo = Builtins.add(
- @actions_todo,
- _("Initialize software manager")
- )
- # TRANSLATORS: progress step
- @actions_doing = Builtins.add(
- @actions_doing,
- _("Initializing software manager...")
- )
- @actions_functions = Builtins.add(
- @actions_functions,
- fun_ref(method(:InitInstallationRepositories), "boolean ()")
- )
+ actions_todo << _("Search for system files")
+ actions_doing << _("Searching for system files...")
+ actions_functions << fun_ref(method(:FilesFromOlderSystems), "boolean ()")
+
+ actions_todo << _("Evaluate update possibility")
+ actions_doing << _("Evaluating update possibility...")
+ actions_functions << fun_ref(method(:EvaluateUpdatePossibilities), "boolean ()")
+
+ actions_todo << _("Initialize software manager")
+ actions_doing << _("Initializing software manager...")
+ actions_functions << fun_ref(method(:InitInstallationRepositories), "boolean ()")
Progress.New(
# TRANSLATORS: dialog caption
_("System Probing"),
" ",
- Builtins.size(@actions_todo),
- @actions_todo,
- @actions_doing,
+ actions_todo.size,
+ actions_todo,
+ actions_doing,
# TRANSLATORS: dialog help
_("YaST is probing computer hardware and installed systems now.")
)
- Builtins.foreach(@actions_functions) do |run_function|
+ actions_functions.each do |run_function|
Progress.NextStage
# Bugzilla #298049
# Allow to abort the probing
@@ -265,13 +165,8 @@
next :abort
end
end
- Builtins.y2milestone("Running function: %1", run_function)
- run_this = Convert.convert(
- run_function,
- :from => "any",
- :to => "boolean ()"
- )
- ret = run_this.call
+
+ ret = run_function.call
Builtins.y2milestone("Function %1 returned %2", run_function, ret)
end
Installation.probing_done = true
@@ -280,9 +175,8 @@
return :abort if ProductProfile.CheckCompliance(nil) == false
Progress.Finish
- Builtins.sleep(500)
- return :abort if !@packager_initialized
+ return :abort unless @packager_initialized
Builtins.y2milestone(
"Have Linux: %1, Offer Update: %2",
@@ -290,9 +184,8 @@
InstData.offer_update
)
- :next
+ :next
- # EOF
end
# Function definitions -->
@@ -425,18 +318,18 @@
true
end
- def SearchForLinuxPartitions
- Storage.ReReadTargetMap
- if Storage.HaveLinuxPartitions
- InstData.have_linux = true
- else
- InstData.have_linux = false
- end
+ def SearchForLinuxPartitions
+ # ReReadTargetMap is needed to fix bug #806454
+ Storage.ReReadTargetMap()
+ # SetPartProposalFirst is needed to fix bug #865579
+ Storage.SetPartProposalFirst(true)
+ InstData.have_linux = Storage.HaveLinuxPartitions()
true
end
- def InitInstallationRepositoriesReal
+
+ def InitInstallationRepositories
# disable callbacks
PackageCallbacks.RegisterEmptyProgressCallbacks
@@ -469,18 +362,6 @@
ret
end
-
- def InitInstallationRepositories
- #boolean progress_orig = Progress::set (false);
- #y2milestone ("Pregress was: %1", progress_orig);
-
- ret = InitInstallationRepositoriesReal()
-
- #y2milestone ("Adjusting progress: %1", progress_orig);
- #Progress::set (progress_orig);
-
- ret
- end
def FilesFromOlderSystems
# FATE #300421: Import ssh keys from previous installations
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/src/include/installation/misc.rb new/yast2-installation-3.1.47/src/include/installation/misc.rb
--- old/yast2-installation-3.1.40/src/include/installation/misc.rb 2014-02-21 15:15:55.000000000 +0100
+++ new/yast2-installation-3.1.47/src/include/installation/misc.rb 2014-02-27 16:14:09.000000000 +0100
@@ -239,7 +239,7 @@
confirm_button_label = Label.InstallButton
else
# Heading for confirmation popup before the update really starts
- heading = "<h3>" + _("Confirm Update") + "</h3>"
+ heading = HTML.Heading(_("Confirm Update"))
body =
# Text for confirmation popup before the update really starts 1/3
@@ -258,18 +258,7 @@
confirm_button_label = _("Start &Update")
end
- heading_bg_color = "#A9CEDD"
-
display_info = UI.GetDisplayInfo
- text = Ops.get_boolean(display_info, "RichTextSupportsTable", false) ?
- Builtins.sformat(
- "<table bgcolor=\"%1\"><tr><td>%2</td></tr></table>%3",
- heading_bg_color,
- heading,
- body
- ) :
- Ops.add(heading, body)
-
size_x = Builtins.tointeger(Ops.get_integer(display_info, "Width", 800))
size_y = Builtins.tointeger(Ops.get_integer(display_info, "Height", 600))
@@ -290,7 +279,7 @@
HBox(
HSpacing(0.7),
VSpacing(size_y), # force height
- RichText(text),
+ RichText(heading + body),
HSpacing(0.7)
),
ButtonBox(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/src/lib/installation/cio_ignore.rb new/yast2-installation-3.1.47/src/lib/installation/cio_ignore.rb
--- old/yast2-installation-3.1.40/src/lib/installation/cio_ignore.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-installation-3.1.47/src/lib/installation/cio_ignore.rb 2014-02-27 16:14:09.000000000 +0100
@@ -0,0 +1,158 @@
+require "yast"
+
+module Installation
+ class CIOIgnore
+ include Singleton
+ attr_accessor :enabled
+
+ def initialize
+ reset
+ end
+
+ def reset
+ #default value requested in FATE#315586
+ @enabled = true
+ end
+ end
+
+ class CIOIgnoreProposal
+ include Yast::Logger
+ include Yast::I18n
+
+ CIO_ENABLE_LINK = "cio_enable"
+ CIO_DISABLE_LINK = "cio_disable"
+ CIO_ACTION_ID = "cio"
+
+ def initialize
+ textdomain "installation"
+ end
+
+ def run(*args)
+ func = args.first
+ param = args[1] || {}
+
+ log.debug "cio ignore proposal client called with #{func} and #{param}"
+
+ case func
+ when "MakeProposal"
+ proposal_entry
+ when "Description"
+ {
+ # this is a heading
+ "rich_text_title" => _("Blacklist Devices"),
+ # this is a menu entry
+ "menu_title" => _("B&lacklist Devices"),
+ "id" => CIO_ACTION_ID
+ }
+ when "AskUser"
+ edit param["chosen_id"]
+ else
+ raise "Uknown action passed as first parameter"
+ end
+ end
+
+ private
+
+ def proposal_entry
+ Yast.import "HTML"
+ enabled = CIOIgnore.instance.enabled
+
+ text = if enabled
+ # TRANSLATORS: Installation overview
+ # IMPORTANT: Please, do not change the HTML link <a href="...">...</a>, only visible text
+ (_(
+ "Blacklist devices enabled (<a href=\"%s\">disable</a>)."
+ ) % CIO_DISABLE_LINK)
+ else
+ # TRANSLATORS: Installation overview
+ # IMPORTANT: Please, do not change the HTML link <a href="...">...</a>, only visible text
+ (_(
+ "Blacklist devices disabled (<a href=\"%1\">enable</a>)."
+ ) % CIO_ENABLE_LINK)
+ end
+
+ {
+ "preformatted_proposal" => Yast::HTML.List([text]),
+ "links" => [CIO_ENABLE_LINK, CIO_DISABLE_LINK],
+ # TRANSLATORS: help text
+ "help" => _(
+ "<p>Use <b>Blacklist devices</b> if you want to create blacklist channels to such devices which will reduce kernel memory footprint.</p>"
+ )
+ }
+ end
+
+ def edit edit_id
+ raise "Internal error: no id passed to proposal edit" unless edit_id
+
+ log.info "CIO proposal change requested, id #{edit_id}"
+
+ cio_ignore = CIOIgnore.instance
+
+ cio_ignore.enabled = case edit_id
+ when CIO_DISABLE_LINK then false
+ when CIO_ENABLE_LINK then true
+ when CIO_ACTION_ID then !cio_ignore.enabled
+ else
+ raise "INTERNAL ERROR: Unexpected value #{edit_id}"
+ end
+
+ { "workflow_sequence" => :next }
+ end
+ end
+
+
+ class CIOIgnoreFinish
+ include Yast::Logger
+ include Yast::I18n
+
+ USABLE_WORKFLOWS = [
+ :installation,
+ :live_installation,
+ :autoinst
+ ]
+
+ YAST_BASH_PATH = Yast::Path.new ".target.bash"
+
+
+ def initialize
+ textdomain "installation"
+ end
+
+ def run(*args)
+ func = args.first
+ param = args[1] || {}
+
+ log.debug "cio ignore finish client called with #{func} and #{param}"
+
+ case func
+ when "Info"
+ Yast.import "Arch"
+ usable = Yast::Arch.s390()
+
+ {
+ "steps" => 1,
+ # progress step title
+ "title" => _(
+ "Blacklisting Devices..."
+ ),
+ "when" => usable ? USABLE_WORKFLOWS : []
+ }
+
+ when "Write"
+ return nil unless CIOIgnore.instance.enabled
+
+ res = Yast::SCR.Execute(YAST_BASH_PATH, "cio_ignore --unused --purge")
+
+ log.info "result of cio_ignore call: #{res.inspect}"
+
+ if res["exit"] != 0
+ raise "cio_ignore command failed with stderr: #{res["stderr"]}"
+ end
+
+ nil
+ else
+ raise "Uknown action passed as first parameter"
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/src/modules/InstFunctions.rb new/yast2-installation-3.1.47/src/modules/InstFunctions.rb
--- old/yast2-installation-3.1.40/src/modules/InstFunctions.rb 2014-02-21 15:15:55.000000000 +0100
+++ new/yast2-installation-3.1.47/src/modules/InstFunctions.rb 2014-02-27 16:14:09.000000000 +0100
@@ -60,8 +60,8 @@
polish(Linuxrc.InstallInf(key))
end
- # Features mentioned in 'Cmdline' entry
- cmdline = polish(Linuxrc.InstallInf("Cmdline")).split
+ # Features mentioned in 'Cmdline' entry, it might not be defined (bnc#861465)
+ cmdline = polish(Linuxrc.InstallInf("Cmdline") || "").split
cmdline_features = cmdline.select do |cmd|
cmd =~ /^ignored?features?=/i
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/test/Makefile.am new/yast2-installation-3.1.47/test/Makefile.am
--- old/yast2-installation-3.1.40/test/Makefile.am 2014-02-21 15:15:55.000000000 +0100
+++ new/yast2-installation-3.1.47/test/Makefile.am 2014-02-27 16:14:09.000000000 +0100
@@ -1,5 +1,6 @@
TESTS = \
- inst_functions.rb
+ inst_functions_test.rb \
+ cio_ignore_test.rb
TEST_EXTENSIONS = .rb
RB_LOG_COMPILER = rspec
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/test/cio_ignore_test.rb new/yast2-installation-3.1.47/test/cio_ignore_test.rb
--- old/yast2-installation-3.1.40/test/cio_ignore_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-installation-3.1.47/test/cio_ignore_test.rb 2014-02-27 16:14:09.000000000 +0100
@@ -0,0 +1,148 @@
+#! /usr/bin/env rspec
+
+require_relative "./test_helper"
+
+require "installation/cio_ignore"
+
+describe ::Installation::CIOIgnoreProposal do
+
+ subject { ::Installation::CIOIgnoreProposal.new }
+
+ before(:each) do
+ ::Installation::CIOIgnore.instance.reset
+ end
+
+ describe "#run" do
+ describe "first parameter \"MakeProposal\"" do
+ it "returns proposal entry hash containing \"links\", \"help\" and \"preformatted_proposal\"" do
+ result = subject.run("MakeProposal")
+
+ expect(result).to have_key("links")
+ expect(result).to have_key("help")
+ expect(result).to have_key("preformatted_proposal")
+ end
+ end
+
+ describe "first parameter \"Description\"" do
+ it "returns proposal metadata hash containing \"rich_text_title\", \"id\" and \"menu_title\"" do
+ result = subject.run("Description")
+
+ expect(result).to have_key("rich_text_title")
+ expect(result).to have_key("menu_title")
+ expect(result).to have_key("id")
+ end
+ end
+
+ describe "first parameter \"AskUser\"" do
+ it "changes proposal if passed with chosen_id in second param hash" do
+ params = [
+ "AskUser",
+ "chosen_id" => ::Installation::CIOIgnoreProposal::CIO_DISABLE_LINK
+ ]
+ result = subject.run(*params)
+
+ expect(result["workflow_sequence"]).to eq :next
+ expect(::Installation::CIOIgnore.instance.enabled).to be false
+ end
+
+ it "raises RuntimeError if passed without chosen_id in second param hash" do
+ expect{subject.run("AskUser")}.to(
+ raise_error(RuntimeError)
+ )
+ end
+
+ it "raises RuntimeError if \"AskUser\" passed with non-existing chosen_id in second param hash" do
+ params = [
+ "AskUser",
+ "chosen_id" => "non_existing"
+ ]
+
+ expect{subject.run(*params)}.to raise_error(RuntimeError)
+ end
+ end
+
+ it "raises RuntimeError if unknown action passed as first parameter" do
+ expect{subject.run("non_existing_action")}.to(
+ raise_error(RuntimeError)
+ )
+ end
+ end
+end
+
+describe ::Installation::CIOIgnoreFinish do
+ subject { ::Installation::CIOIgnoreFinish.new }
+
+ describe "#run" do
+ describe "first paramater \"Info\"" do
+ it "returns info entry hash with empty \"when\" key for non s390x architectures" do
+ arch_mock = double("Yast::Arch", :s390 => false)
+ stub_const("Yast::Arch", arch_mock)
+
+ result = subject.run("Info")
+
+ expect(result["when"]).to be_empty
+ end
+
+ it "returns info entry hash with scenarios in \"when\" key for s390x architectures" do
+ arch_mock = double("Yast::Arch", :s390 => true)
+ stub_const("Yast::Arch", arch_mock)
+
+ result = subject.run("Info")
+
+ expect(result["when"]).to_not be_empty
+ end
+
+ end
+
+ describe "first parameter \"Write\"" do
+ describe "Device blacklisting is disabled" do
+ it "do nothing" do
+ ::Installation::CIOIgnore.instance.enabled = false
+
+ expect(Yast::SCR).to_not receive(:Execute)
+
+ subject.run("Write")
+ end
+ end
+
+ describe "Device blacklisting is enabled" do
+
+ it "call `cio_ignore --unused --purge`" do
+ ::Installation::CIOIgnore.instance.enabled = true
+
+ expect(Yast::SCR).to receive(:Execute).
+ with(
+ ::Installation::CIOIgnoreFinish::YAST_BASH_PATH,
+ "cio_ignore --unused --purge"
+ ).
+ once.
+ and_return({"exit" => 0, "stdout" => "", "stderr" => ""})
+
+ subject.run("Write")
+ end
+
+ it "raises RuntimeError if cio_ignore call failed" do
+ ::Installation::CIOIgnore.instance.enabled = true
+ stderr = "HORRIBLE ERROR!!!"
+
+ expect(Yast::SCR).to receive(:Execute).
+ with(
+ ::Installation::CIOIgnoreFinish::YAST_BASH_PATH,
+ "cio_ignore --unused --purge"
+ ).
+ once.
+ and_return({"exit" => 1, "stdout" => "", "stderr" => stderr})
+
+ expect{subject.run("Write")}.to raise_error(RuntimeError, /stderr/)
+ end
+
+ end
+ end
+
+ it "raises RuntimeError if unknown action passed as first parameter" do
+ expect{subject.run("non_existing_action")}.to(
+ raise_error(RuntimeError)
+ )
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/test/inst_functions.rb new/yast2-installation-3.1.47/test/inst_functions.rb
--- old/yast2-installation-3.1.40/test/inst_functions.rb 2014-02-21 15:15:55.000000000 +0100
+++ new/yast2-installation-3.1.47/test/inst_functions.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,177 +0,0 @@
-#! /usr/bin/env rspec
-
-ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)
-
-require "yast"
-
-Yast.import "InstFunctions"
-
-# For mocking
-Yast.import "Linuxrc"
-
-describe "when getting list of ignored features from Linuxrc" do
- before(:each) do
- Yast::InstFunctions.reset_ignored_features
- end
-
- it "returns empty list if no features were ignored on commandline" do
- linuxrc_commandline = "othercommand=xyz no_ignore_features=1 something-else=555"
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.ignored_features.sort).to be_empty
- end
-
- it "returns empty list if features ignored on commandline were empty" do
- linuxrc_commandline = "ignore_features="
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.ignored_features.sort).to be_empty
- end
-
- it "returns list of features set on commandline by two entries" do
- linuxrc_commandline = "ignore_features=aa,b_b,c-c ignoredfeatures=a-a,dd othercommand=xyz"
- ignored_features = ["aa", "bb", "cc", "dd"].sort
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features
- end
-
- it "returns list of features set on commandline by one entry" do
- linuxrc_commandline = "ignore_features=x-x,yy"
- ignored_features = ["xx", "yy"].sort
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features
- end
-
- it "returns list of features set on commandline by several entries, each feature in separate entry" do
- linuxrc_commandline = "trash=install ignore_feature=f.e.a.ture1 ig.n.o.red_features=feature2 ignore_features=feature3"
- ignored_features = ["feature1", "feature2", "feature3"].sort
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features
- end
-
- it "returns one feature set on commandline by one entry" do
- linuxrc_commandline = "i-g-n-o-r-e_feature=fff"
- ignored_features = ["fff"]
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features
- end
-
- it "returns one feature set on commandline by one entry using up/down case" do
- linuxrc_commandline = "Ignore_FeaTUres=ffF"
- ignored_features = ["fff"]
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features
- end
-
- # PTOptions makes a command hidden from 'Cmdline' and creates
- # a new install.inf entry using the exact name as it appears in PTOptions
- # @see http://en.opensuse.org/SDB:Linuxrc#p_ptoptions
- it "returns features set on commandline together with ptoptions" do
- install_inf = {
- 'ignored_features' => 'f1,f2,f3',
- 'IgnoReDfEAtuRes' => 'f2,f4',
- 'i.g.n.o.r.e.d.features' => 'f1,f5',
- 'IGNORE-FEA-T-U-RE' => 'f6,f7,f7,f7',
- 'another_feature' => 'another_value',
- 'Cmdline' => 'splash=silent vga=0x314',
- 'Keyboard' => '1',
- }
- Yast::Linuxrc.stub(:keys).and_return(install_inf.keys)
- install_inf.keys.each do |key|
- Yast::Linuxrc.stub(:InstallInf).with(key).and_return(install_inf[key])
- end
-
- expect(Yast::InstFunctions.ignored_features.sort).to eq(['f1','f2','f3','f4','f5','f6','f7'])
- end
-end
-
-describe "#feature_ignored?" do
- before(:each) do
- Yast::InstFunctions.reset_ignored_features
- end
-
- it "should be true if feature is exactly set on commandline" do
- linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3"
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.feature_ignored?("feature2")).to be_true
- end
-
- it "should be true if feature is exactly on commandline using up/down case" do
- linuxrc_commandline = "trash=install ignore_features=fEAture1 igno-RED_features=f-eatuRE_2 ignore_features=feature3"
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.feature_ignored?("f-e-a-t-u-r-e-2")).to be_true
- end
-
- it "should be true if feature is set on commandline with dashes and underscores" do
- linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3"
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.feature_ignored?("f-e-a-t-u-r-e_2")).to be_true
- end
-
- it "should be false if feature is not set on commandline" do
- linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3"
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.feature_ignored?("no-such-feature")).to be_false
- end
-
- it "should be false if feature to check is empty" do
- linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3"
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.feature_ignored?("")).to be_false
- end
-
- it "should be false if feature to check is undefined" do
- linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3"
-
- Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
- expect(Yast::InstFunctions.feature_ignored?(nil)).to be_false
- end
-
- it "should be true if feature is mentioned as a separate install.inf entry or in Cmdline" do
- install_inf = {
- 'ignored_features' => 'f1,f2,f3',
- 'IgnoReDfEAtuRes' => 'f2,f4',
- 'i.g.n.o.r.e.d.features' => 'f1,f5',
- 'IGNORED-FEA-T-U-RES' => 'f6,f7,f7,f7',
- 'another_feature' => 'another_value',
- 'Cmdline' => 'splash=silent vga=0x314 ignored_feature=f8',
- 'Keyboard' => '1',
- }
- Yast::Linuxrc.stub(:keys).and_return(install_inf.keys)
- install_inf.keys.each do |key|
- Yast::Linuxrc.stub(:InstallInf).with(key).and_return(install_inf[key])
- end
-
- ['f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8'].each do |key|
- expect(Yast::InstFunctions.feature_ignored?(key)).to be_true, "Key #{key} is not ignored"
- end
- end
-
- it "should be false if feature is not mentioned as a separate install.inf entry or in Cmdline" do
- install_inf = {
- 'ignored_features' => 'f1,f2,f3',
- 'IgnoReDfEAtuRes' => 'f2,f4',
- 'i.g.n.o.r.e.d.features' => 'f1,f5',
- 'IGNORE-FEA-T-U-RE' => 'f6,f7,f7,f7',
- 'another_feature' => 'another_value',
- 'Cmdline' => 'splash=silent vga=0x314 ignored_feature=f8',
- 'Keyboard' => '1',
- }
- Yast::Linuxrc.stub(:keys).and_return(install_inf.keys)
- install_inf.keys.each do |key|
- Yast::Linuxrc.stub(:InstallInf).with(key).and_return(install_inf[key])
- end
-
- expect(Yast::InstFunctions.feature_ignored?('f9')).to be_false
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/test/inst_functions_test.rb new/yast2-installation-3.1.47/test/inst_functions_test.rb
--- old/yast2-installation-3.1.40/test/inst_functions_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-installation-3.1.47/test/inst_functions_test.rb 2014-02-27 16:14:09.000000000 +0100
@@ -0,0 +1,184 @@
+#! /usr/bin/env rspec
+
+require_relative "./test_helper"
+
+Yast.import "InstFunctions"
+
+# For mocking
+Yast.import "Linuxrc"
+
+def stub_install_inf(install_inf)
+ Yast::Linuxrc.stub(:keys).and_return(install_inf.keys)
+
+ install_inf.keys.each do |key|
+ Yast::Linuxrc.stub(:InstallInf).with(key).and_return(install_inf[key])
+ end
+end
+
+describe "when getting list of ignored features from Linuxrc" do
+ before(:each) do
+ Yast::InstFunctions.reset_ignored_features
+ end
+
+ it "returns empty list if no features were ignored on commandline" do
+ linuxrc_commandline = "othercommand=xyz no_ignore_features=1 something-else=555"
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.ignored_features.sort).to be_empty
+ end
+
+ it "returns empty list if features ignored on commandline were empty" do
+ linuxrc_commandline = "ignore_features="
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.ignored_features.sort).to be_empty
+ end
+
+ it "returns list of features set on commandline by two entries" do
+ linuxrc_commandline = "ignore_features=aa,b_b,c-c ignoredfeatures=a-a,dd othercommand=xyz"
+ ignored_features = ["aa", "bb", "cc", "dd"].sort
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features
+ end
+
+ it "returns list of features set on commandline by one entry" do
+ linuxrc_commandline = "ignore_features=x-x,yy"
+ ignored_features = ["xx", "yy"].sort
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features
+ end
+
+ it "returns list of features set on commandline by several entries, each feature in separate entry" do
+ linuxrc_commandline = "trash=install ignore_feature=f.e.a.ture1 ig.n.o.red_features=feature2 ignore_features=feature3"
+ ignored_features = ["feature1", "feature2", "feature3"].sort
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features
+ end
+
+ it "returns one feature set on commandline by one entry" do
+ linuxrc_commandline = "i-g-n-o-r-e_feature=fff"
+ ignored_features = ["fff"]
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features
+ end
+
+ it "returns one feature set on commandline by one entry using up/down case" do
+ linuxrc_commandline = "Ignore_FeaTUres=ffF"
+ ignored_features = ["fff"]
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.ignored_features.sort).to eq ignored_features
+ end
+
+ # PTOptions makes a command hidden from 'Cmdline' and creates
+ # a new install.inf entry using the exact name as it appears in PTOptions
+ # @see http://en.opensuse.org/SDB:Linuxrc#p_ptoptions
+ it "returns features set on commandline together with ptoptions" do
+ install_inf = {
+ 'ignored_features' => 'f1,f2,f3',
+ 'IgnoReDfEAtuRes' => 'f2,f4',
+ 'i.g.n.o.r.e.d.features' => 'f1,f5',
+ 'IGNORE-FEA-T-U-RE' => 'f6,f7,f7,f7',
+ 'another_feature' => 'another_value',
+ 'Cmdline' => 'splash=silent vga=0x314',
+ 'Keyboard' => '1',
+ }
+ stub_install_inf(install_inf)
+
+ expect(Yast::InstFunctions.ignored_features.sort).to eq(['f1','f2','f3','f4','f5','f6','f7'])
+ end
+
+ it "handles missing Cmdline in Linuxrc" do
+ install_inf = {
+ # Cmdline is not defined, bnc#861465
+ 'Cmdline' => nil,
+ }
+ stub_install_inf(install_inf)
+
+ expect(Yast::InstFunctions.ignored_features.sort).to be_empty
+ end
+end
+
+describe "#feature_ignored?" do
+ before(:each) do
+ Yast::InstFunctions.reset_ignored_features
+ end
+
+ it "should be true if feature is exactly set on commandline" do
+ linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3"
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.feature_ignored?("feature2")).to be_true
+ end
+
+ it "should be true if feature is exactly on commandline using up/down case" do
+ linuxrc_commandline = "trash=install ignore_features=fEAture1 igno-RED_features=f-eatuRE_2 ignore_features=feature3"
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.feature_ignored?("f-e-a-t-u-r-e-2")).to be_true
+ end
+
+ it "should be true if feature is set on commandline with dashes and underscores" do
+ linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3"
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.feature_ignored?("f-e-a-t-u-r-e_2")).to be_true
+ end
+
+ it "should be false if feature is not set on commandline" do
+ linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3"
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.feature_ignored?("no-such-feature")).to be_false
+ end
+
+ it "should be false if feature to check is empty" do
+ linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3"
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.feature_ignored?("")).to be_false
+ end
+
+ it "should be false if feature to check is undefined" do
+ linuxrc_commandline = "trash=install ignore_features=feature1 ignored_features=feature2 ignore_features=feature3"
+
+ Yast::Linuxrc.stub(:InstallInf).and_return(linuxrc_commandline)
+ expect(Yast::InstFunctions.feature_ignored?(nil)).to be_false
+ end
+
+ it "should be true if feature is mentioned as a separate install.inf entry or in Cmdline" do
+ install_inf = {
+ 'ignored_features' => 'f1,f2,f3',
+ 'IgnoReDfEAtuRes' => 'f2,f4',
+ 'i.g.n.o.r.e.d.features' => 'f1,f5',
+ 'IGNORED-FEA-T-U-RES' => 'f6,f7,f7,f7',
+ 'another_feature' => 'another_value',
+ 'Cmdline' => 'splash=silent vga=0x314 ignored_feature=f8',
+ 'Keyboard' => '1',
+ }
+ stub_install_inf(install_inf)
+
+ ['f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8'].each do |key|
+ expect(Yast::InstFunctions.feature_ignored?(key)).to be_true, "Key #{key} is not ignored"
+ end
+ end
+
+ it "should be false if feature is not mentioned as a separate install.inf entry or in Cmdline" do
+ install_inf = {
+ 'ignored_features' => 'f1,f2,f3',
+ 'IgnoReDfEAtuRes' => 'f2,f4',
+ 'i.g.n.o.r.e.d.features' => 'f1,f5',
+ 'IGNORE-FEA-T-U-RE' => 'f6,f7,f7,f7',
+ 'another_feature' => 'another_value',
+ 'Cmdline' => 'splash=silent vga=0x314 ignored_feature=f8',
+ 'Keyboard' => '1',
+ }
+ stub_install_inf(install_inf)
+
+ expect(Yast::InstFunctions.feature_ignored?('f9')).to be_false
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.1.40/test/test_helper.rb new/yast2-installation-3.1.47/test/test_helper.rb
--- old/yast2-installation-3.1.40/test/test_helper.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-installation-3.1.47/test/test_helper.rb 2014-02-27 16:14:09.000000000 +0100
@@ -0,0 +1,8 @@
+ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)
+
+if ENV["COVERAGE"]
+ require "simplecov"
+ SimpleCov.start
+end
+
+require "yast"
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package yast2-bootloader for openSUSE:Factory checked in at 2014-03-01 14:38:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-bootloader (Old)
and /work/SRC/openSUSE:Factory/.yast2-bootloader.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-bootloader"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-bootloader/yast2-bootloader.changes 2014-02-16 09:10:51.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-bootloader.new/yast2-bootloader.changes 2014-03-01 14:38:22.000000000 +0100
@@ -1,0 +2,8 @@
+Thu Feb 27 08:32:24 UTC 2014 - jreidinger(a)suse.com
+
+- Add support for password in GRUB2 (FATE#315404)
+- restructure details dialog in GRUB2 to have better UX
+- fix crash of GRUB2 module
+- 3.1.6
+
+-------------------------------------------------------------------
Old:
----
yast2-bootloader-3.1.5.tar.bz2
New:
----
yast2-bootloader-3.1.6.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.THekCg/_old 2014-03-01 14:38:23.000000000 +0100
+++ /var/tmp/diff_new_pack.THekCg/_new 2014-03-01 14:38:23.000000000 +0100
@@ -17,13 +17,15 @@
Name: yast2-bootloader
-Version: 3.1.5
+Version: 3.1.6
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: %{name}-%{version}.tar.bz2
+BuildRequires: rubygem-rspec
BuildRequires: update-desktop-files
+BuildRequires: yast2 >= 3.1.0
BuildRequires: yast2-devtools >= 3.1.10
PreReq: /bin/sed %fillup_prereq
# Installation::*version variables
@@ -31,7 +33,7 @@
Requires: parted
Requires: perl-Bootloader-YAML
Requires: perl-Compress-Zlib
-Requires: yast2 >= 2.21.22
+Requires: yast2 >= 3.1.0
Requires: yast2-core >= 2.18.7
Requires: yast2-packager >= 2.17.24
Requires: yast2-pkg-bindings >= 2.17.25
@@ -90,6 +92,9 @@
%build
%yast_build
+%check
+make check VERBOSE=1
+
%install
%yast_install
@@ -125,6 +130,7 @@
%dir %{yast_schemadir}/autoyast
%dir %{yast_schemadir}/autoyast/rnc
%{yast_schemadir}/autoyast/rnc/bootloader.rnc
+%{yast_libdir}/bootloader
%dir %{yast_docdir}
%doc %{yast_docdir}/COPYING
++++++ yast2-bootloader-3.1.5.tar.bz2 -> yast2-bootloader-3.1.6.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/SUBDIRS new/yast2-bootloader-3.1.6/SUBDIRS
--- old/yast2-bootloader-3.1.5/SUBDIRS 2014-02-12 17:28:04.000000000 +0100
+++ new/yast2-bootloader-3.1.6/SUBDIRS 2014-02-27 16:13:28.000000000 +0100
@@ -1 +1 @@
-SUBDIRS = src scripts doc
+SUBDIRS = src scripts doc test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/package/yast2-bootloader.changes new/yast2-bootloader-3.1.6/package/yast2-bootloader.changes
--- old/yast2-bootloader-3.1.5/package/yast2-bootloader.changes 2014-02-12 17:28:04.000000000 +0100
+++ new/yast2-bootloader-3.1.6/package/yast2-bootloader.changes 2014-02-27 16:13:28.000000000 +0100
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Thu Feb 27 08:32:24 UTC 2014 - jreidinger(a)suse.com
+
+- Add support for password in GRUB2 (FATE#315404)
+- restructure details dialog in GRUB2 to have better UX
+- fix crash of GRUB2 module
+- 3.1.6
+
+-------------------------------------------------------------------
Wed Feb 12 10:18:39 UTC 2014 - jreidinger(a)suse.com
- rephrase bootloader proposal on summary screen (BNC#853058)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/package/yast2-bootloader.spec new/yast2-bootloader-3.1.6/package/yast2-bootloader.spec
--- old/yast2-bootloader-3.1.5/package/yast2-bootloader.spec 2014-02-12 17:28:04.000000000 +0100
+++ new/yast2-bootloader-3.1.6/package/yast2-bootloader.spec 2014-02-27 16:13:28.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-bootloader
-Version: 3.1.5
+Version: 3.1.6
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -26,11 +26,13 @@
Group: System/YaST
License: GPL-2.0+
BuildRequires: yast2-devtools >= 3.1.10
+BuildRequires: yast2 >= 3.1.0
BuildRequires: update-desktop-files
+BuildRequires: rubygem-rspec
PreReq: /bin/sed %fillup_prereq
# Installation::*version variables
# Wizard::SetDialogTitleAndIcon
-Requires: yast2 >= 2.21.22
+Requires: yast2 >= 3.1.0
Requires: yast2-packager >= 2.17.24
Requires: yast2-pkg-bindings >= 2.17.25
Requires: perl-Bootloader-YAML
@@ -74,6 +76,9 @@
%build
%yast_build
+%check
+make check VERBOSE=1
+
%install
%yast_install
@@ -110,6 +115,7 @@
%dir %{yast_schemadir}/autoyast
%dir %{yast_schemadir}/autoyast/rnc
%{yast_schemadir}/autoyast/rnc/bootloader.rnc
+%{yast_libdir}/bootloader
%dir %{yast_docdir}
%doc %{yast_docdir}/COPYING
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/src/Makefile.am new/yast2-bootloader-3.1.6/src/Makefile.am
--- old/yast2-bootloader-3.1.5/src/Makefile.am 2014-02-12 17:28:04.000000000 +0100
+++ new/yast2-bootloader-3.1.6/src/Makefile.am 2014-02-27 16:13:28.000000000 +0100
@@ -74,6 +74,11 @@
include/bootloader/ppc/dialogs.rb \
include/bootloader/ppc/helps.rb
+ylibdir = "${yast2dir}/lib/bootloader"
+ylib_DATA = \
+ lib/bootloader/grub2base.rb \
+ lib/bootloader/grub2pwd.rb
+
scrconf_DATA = \
scrconf/cfg_bootloader.scr \
scrconf/cfg_bootsplash.scr \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/src/include/bootloader/grub/options.rb new/yast2-bootloader-3.1.6/src/include/bootloader/grub/options.rb
--- old/yast2-bootloader-3.1.5/src/include/bootloader/grub/options.rb 2014-02-12 17:28:04.000000000 +0100
+++ new/yast2-bootloader-3.1.6/src/include/bootloader/grub/options.rb 2014-02-27 16:13:28.000000000 +0100
@@ -247,6 +247,24 @@
false
end
+ def passwd_content
+ HBox(
+ CheckBoxFrame(
+ Id(:use_pas),
+ _("Prot&ect Boot Loader with Password"),
+ true,
+ HBox(
+ HSpacing(2),
+ # text entry
+ Password(Id(:pw1), Opt(:hstretch), _("&Password")),
+ # text entry
+ HSpacing(2),
+ Password(Id(:pw2), Opt(:hstretch), _("Re&type Password")),
+ HStretch()
+ )
+ )
+ )
+ end
# Build a map describing a widget
@@ -255,22 +273,7 @@
{
"widget" => :custom,
# frame
- "custom_widget" => HBox(
- CheckBoxFrame(
- Id(:use_pas),
- _("Prot&ect Boot Loader with Password"),
- true,
- HBox(
- HSpacing(2),
- # text entry
- Password(Id(:pw1), Opt(:hstretch), _("&Password")),
- # text entry
- HSpacing(2),
- Password(Id(:pw2), Opt(:hstretch), _("Re&type Password")),
- HStretch()
- )
- )
- ),
+ "custom_widget" => passwd_content,
"init" => fun_ref(
method(:InitPasswdWidget),
"void (string)"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/src/include/bootloader/grub2/dialogs.rb new/yast2-bootloader-3.1.6/src/include/bootloader/grub2/dialogs.rb
--- old/yast2-bootloader-3.1.5/src/include/bootloader/grub2/dialogs.rb 2014-02-12 17:28:04.000000000 +0100
+++ new/yast2-bootloader-3.1.6/src/include/bootloader/grub2/dialogs.rb 2014-02-27 16:13:28.000000000 +0100
@@ -25,6 +25,7 @@
Yast.import "Label"
Yast.import "Wizard"
Yast.import "CWM"
+ Yast.import "CWMTab"
Yast.import "BootCommon"
Yast.import "Stage"
@@ -37,60 +38,84 @@
@_grub2_efi_widgets = nil
end
+ def boot_code_tab
+ lt = BootCommon.getLoaderType(false)
+
+ {
+ "id" => "boot_code_tab",
+ "header" => _("Boot Code Options"),
+ # if name is not included, that it is not displayed
+ "widget_names" => lt == "grub2-efi" ? ["distributor"] :
+ ["distributor", "activate", "generic_mbr"],
+ "contents" => VBox(
+ VSpacing(1),
+ MarginBox(1, 0.5, "distributor"),
+ MarginBox(1, 0.5, Left("activate")),
+ MarginBox(1, 0.5, Left("generic_mbr")),
+ VStretch()
+ )
+ }
+ end
+
+ def kernel_tab
+ {
+ "id" => "kernel_tab",
+ "header" => _("Kernel Parameters"),
+ "widget_names" => ["vgamode", "append", "append_failsafe", "console"],
+ "contents" => VBox(
+ VSpacing(1),
+ MarginBox(1, 0.5, "vgamode"),
+ MarginBox(1, 0.5, "append"),
+ MarginBox(1, 0.5, "append_failsafe"),
+ MarginBox(1, 0.5, "console"),
+ VStretch()
+ )
+ }
+ end
+
+ def bootloader_tab
+ {
+ "id" => "bootloader_tab",
+ "header" => _("Bootloader Options"),
+ "widget_names" => ["default", "timeout", "password", "os_prober", "hiddenmenu"],
+ "contents" => VBox(
+ VSpacing(2),
+ HBox(
+ HSpacing(1),
+ "timeout",
+ HSpacing(1),
+ Left(VBox( "os_prober", "hiddenmenu")),
+ HSpacing(1)
+ ),
+ MarginBox(1, 1, "default"),
+ MarginBox(1, 1, "password"),
+ VStretch()
+ )
+ }
+ end
+
# Run dialog for loader installation details for Grub2
# @return [Symbol] for wizard sequencer
def Grub2LoaderDetailsDialog
Builtins.y2milestone("Running Grub2 loader details dialog")
- contents = HBox(
- HSpacing(2),
- VBox(
- VStretch(),
- HBox(HSquash("distributor"), "hiddenmenu", "os_prober", HStretch()),
- HBox("activate", "generic_mbr", HStretch()),
- HBox(HSquash("timeout"), "vgamode", HStretch()),
- Left("append"),
- Left("append_failsafe"),
- Left("default"),
- Left("console"),
- Left("gfxterm"),
- VStretch()
- ),
- HSpacing(2)
- )
+ widgets = Grub2Options()
- lt = BootCommon.getLoaderType(false)
- widget_names = lt == "grub2-efi" ?
- [
- "distributor",
- "hiddenmenu",
- "os_prober",
- "timeout",
- "append",
- "append_failsafe",
- "console",
- "default",
- "vgamode"
- ] :
- [
- "distributor",
- "activate",
- "generic_mbr",
- "hiddenmenu",
- "os_prober",
- "timeout",
- "append",
- "append_failsafe",
- "console",
- "default",
- "vgamode"
- ]
+ tabs = [ bootloader_tab, kernel_tab, boot_code_tab]
+
+ tab_widget = CWMTab.CreateWidget({
+ "tab_order" => tabs.map{ |t| t["id"] },
+ "tabs" => Hash[tabs.map{|tab| [tab["id"], tab]}],
+ "initial_tab" => tabs.first["id"],
+ "widget_descr" => widgets
+ })
+ widgets["tab"] = tab_widget
caption = _("Boot Loader Options")
CWM.ShowAndRun(
{
- "widget_descr" => Grub2Options(),
- "widget_names" => widget_names,
- "contents" => contents,
+ "widget_descr" => widgets,
+ "widget_names" => ["tab"],
+ "contents" => VBox("tab"),
"caption" => caption,
"back_button" => Label.BackButton,
"abort_button" => Label.CancelButton,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/src/include/bootloader/grub2/options.rb new/yast2-bootloader-3.1.6/src/include/bootloader/grub2/options.rb
--- old/yast2-bootloader-3.1.5/src/include/bootloader/grub2/options.rb 2014-02-12 17:28:04.000000000 +0100
+++ new/yast2-bootloader-3.1.6/src/include/bootloader/grub2/options.rb 2014-02-27 16:13:28.000000000 +0100
@@ -18,6 +18,9 @@
#
# $Id: BootGRUB.ycp 63508 2011-03-04 12:53:27Z jreidinger $
#
+
+require "bootloader/grub2pwd"
+
module Yast
module BootloaderGrub2OptionsInclude
def initialize_bootloader_grub2_options(include_target)
@@ -225,6 +228,95 @@
nil
end
+ def ConsoleContent
+ VBox(
+ CheckBoxFrame(
+ Id(:gfxterm_frame),
+ _("Use &graphical console"),
+ true,
+ HBox(
+ HSpacing(2),
+ ComboBox(
+ Id(:gfxmode),
+ Opt(:editable, :hstretch),
+ _("&Console resolution"),
+ [""]
+ ),
+ HBox(
+ Left(
+ InputField(
+ Id(:gfxtheme),
+ Opt(:hstretch),
+ _("&Console theme")
+ )
+ ),
+ VBox(
+ Left(Label("")),
+ Left(
+ PushButton(
+ Id(:browsegfx),
+ Opt(:notify),
+ Label.BrowseButton
+ )
+ )
+ )
+ ),
+ HStretch()
+ )
+ ),
+ CheckBoxFrame(
+ Id(:console_frame),
+ _("Use &serial console"),
+ true,
+ HBox(
+ HSpacing(2),
+ InputField(
+ Id(:console_args),
+ Opt(:hstretch),
+ _("&Console arguments")
+ ),
+ HStretch()
+ )
+ )
+ )
+ end
+
+ MASKED_PASSWORD = "**********"
+
+ def grub2_pwd_store(key, event)
+ usepass = UI.QueryWidget(Id(:use_pas), :Value)
+ if !usepass
+ # we are in proper module that can store password
+ self.password = nil
+ return
+ end
+
+ value = UI.QueryWidget(Id(:pw1), :Value)
+ # special value as we do not know password, so it mean user do not change it
+ if value == MASKED_PASSWORD
+ self.password = ""
+ else
+ self.password = value
+ end
+ end
+
+ def grub2_pwd_init(widget)
+ passwd = GRUB2Pwd.new.used?
+ if passwd
+ UI.ChangeWidget(Id(:use_pas), :Value, true)
+ UI.ChangeWidget(Id(:pw1), :Enabled, true)
+ UI.ChangeWidget(Id(:pw1), :Value, MASKED_PASSWORD)
+ UI.ChangeWidget(Id(:pw2), :Enabled, true)
+ UI.ChangeWidget(Id(:pw2), :Value, MASKED_PASSWORD)
+ else
+ UI.ChangeWidget(Id(:use_pas), :Value, false)
+ UI.ChangeWidget(Id(:pw1), :Enabled, false)
+ UI.ChangeWidget(Id(:pw1), :Value, "")
+ UI.ChangeWidget(Id(:pw2), :Enabled, false)
+ UI.ChangeWidget(Id(:pw2), :Value, "")
+ end
+ end
+
def Grub2Options
grub2_specific = {
"distributor" => CommonInputFieldWidget(
@@ -273,56 +365,7 @@
},
"console" => {
"widget" => :custom,
- "custom_widget" => VBox(
- CheckBoxFrame(
- Id(:gfxterm_frame),
- _("Use &graphical console"),
- true,
- HBox(
- HSpacing(2),
- ComboBox(
- Id(:gfxmode),
- Opt(:editable, :hstretch),
- _("&Console resolution"),
- [""]
- ),
- HBox(
- Left(
- InputField(
- Id(:gfxtheme),
- Opt(:hstretch),
- _("&Console theme")
- )
- ),
- VBox(
- Left(Label("")),
- Left(
- PushButton(
- Id(:browsegfx),
- Opt(:notify),
- Label.BrowseButton
- )
- )
- )
- ),
- HStretch()
- )
- ),
- CheckBoxFrame(
- Id(:console_frame),
- _("Use &serial console"),
- true,
- HBox(
- HSpacing(2),
- InputField(
- Id(:console_args),
- Opt(:hstretch),
- _("&Console arguments")
- ),
- HStretch()
- )
- )
- ),
+ "custom_widget" => ConsoleContent(),
"init" => fun_ref(method(:ConsoleInit), "void (string)"),
"store" => fun_ref(
method(:ConsoleStore),
@@ -334,6 +377,28 @@
),
"handle_events" => [:browsegfx],
"help" => Ops.get(@grub_help_messages, "serial", "")
+ },
+ "password" => {
+ "widget" => :custom,
+ "custom_widget" => passwd_content,
+ "init" => fun_ref(
+ method(:grub2_pwd_init),
+ "void (string)"
+ ),
+ "handle" => fun_ref(
+ method(:HandlePasswdWidget),
+ "symbol (string, map)"
+ ),
+ "store" => fun_ref(
+ method(:grub2_pwd_store),
+ "void (string, map)"
+ ),
+ "validate_type" => :function,
+ "validate_function" => fun_ref(
+ method(:ValidatePasswdWidget),
+ "boolean (string, map)"
+ ),
+ "help" => @grub_help_messages["password"] || ""
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/src/lib/bootloader/grub2base.rb new/yast2-bootloader-3.1.6/src/lib/bootloader/grub2base.rb
--- old/yast2-bootloader-3.1.5/src/lib/bootloader/grub2base.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-bootloader-3.1.6/src/lib/bootloader/grub2base.rb 2014-02-27 16:13:28.000000000 +0100
@@ -0,0 +1,150 @@
+# encoding: utf-8
+require "yast"
+require "bootloader/grub2pwd"
+
+module Yast
+ class GRUB2Base < Module
+ def main
+ Yast.import "UI"
+
+ textdomain "bootloader"
+
+ Yast.import "BootArch"
+ Yast.import "BootCommon"
+ Yast.import "BootStorage"
+ Yast.import "Kernel"
+ Yast.import "Mode"
+ Yast.import "Stage"
+ Yast.import "Storage"
+ Yast.import "StorageDevices"
+ Yast.import "Pkg"
+ Yast.import "HTML"
+ Yast.import "Initrd"
+ Yast.import "Product"
+
+ # includes
+ # for simplified widgets than other
+ Yast.include self, "bootloader/grub2/dialogs.rb"
+
+ # password can have three states
+ # 1. nil -> remove password
+ # 2. "" -> do not change it
+ # 3. "something" -> set password to this value
+ @password = ""
+ end
+
+ # general functions
+
+ # Propose global options of bootloader
+ def StandardGlobals
+ {
+ "timeout" => "8",
+ "default" => "0",
+ "vgamode" => "",
+ "gfxmode" => "auto",
+ "terminal" => "gfxterm",
+ "os_prober" => "true"
+ }
+ end
+
+ # Update read settings to new version of configuration files
+ def Update
+ Read(true, true)
+
+ #we don't handle sections, grub2 section create them for us
+ #BootCommon::UpdateSections ();
+ BootCommon.UpdateGlobals
+
+ nil
+ end
+
+ # Reset bootloader settings
+ # @param [Boolean] init boolean true to repropose also device map
+ def Reset(init)
+ return if Mode.autoinst
+ BootCommon.Reset(init)
+
+ nil
+ end
+
+ def Dialogs
+ Builtins.y2milestone("Called GRUB2 Dialogs")
+ {
+ "installation" => fun_ref(
+ method(:Grub2InstallDetailsDialog),
+ "symbol ()"
+ ),
+ "loader" => fun_ref(
+ method(:Grub2LoaderDetailsDialog),
+ "symbol ()"
+ )
+ }
+ end
+
+ def Propose
+ if BootCommon.was_proposed
+ # workaround autoyast config is Imported thus was_proposed always set
+ if Mode.autoinst
+ Builtins.y2milestone(
+ "autoinst mode we ignore meaningless was_proposed as it always set"
+ )
+ else
+ Builtins.y2milestone(
+ "calling Propose with was_proposed set is really bogus, clear it to force a re-propose"
+ )
+ return
+ end
+ end
+
+
+ BootCommon.globals ||= Hash.new
+ BootCommon.globals.merge! StandardGlobals()
+
+ swap_parts = BootCommon.getSwapPartitions
+ largest_swap_part = swap_parts.max_by{|part, size| size}.first || ""
+
+ resume = BootArch.ResumeAvailable ? largest_swap_part : ""
+ # try to use label or udev id for device name... FATE #302219
+ if resume != "" && resume != nil
+ resume = BootStorage.Dev2MountByDev(resume)
+ end
+
+ BootCommon.globals["append"] = BootArch.DefaultKernelParams(resume)
+ BootCommon.globals["append_failsafe"] = BootArch.FailsafeKernelParams
+ BootCommon.globals["distributor"] = Product.name
+ BootCommon.kernelCmdLine = Kernel.GetCmdLine
+
+ Builtins.y2milestone("Proposed globals: %1", BootCommon.globals)
+
+ nil
+ end
+
+ # overwrite Save to allow generation of modification scripts
+ def Save(clean, init, flush)
+ case @password
+ when nil
+ GRUB2Pwd.new.disable
+ when ""
+ #do nothing
+ else
+ GRUB2Pwd.new.enable @password
+ end
+
+ BootCommon.Save(clean, init, flush)
+ end
+
+ # Initializer of GRUB bootloader
+ def Initializer
+ Builtins.y2milestone("Called GRUB2 initializer")
+ BootCommon.current_bootloader_attribs = {
+ "propose" => false,
+ "read" => false,
+ "scratch" => false,
+ "restore_mbr" => false,
+ "bootloader_on_disk" => false
+ }
+
+ nil
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/src/lib/bootloader/grub2pwd.rb new/yast2-bootloader-3.1.6/src/lib/bootloader/grub2pwd.rb
--- old/yast2-bootloader-3.1.5/src/lib/bootloader/grub2pwd.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-bootloader-3.1.6/src/lib/bootloader/grub2pwd.rb 2014-02-27 16:13:28.000000000 +0100
@@ -0,0 +1,59 @@
+require "yast"
+
+class GRUB2Pwd
+ YAST_BASH_PATH = Yast::Path.new(".target.bash_output")
+ PWD_ENCRYPTION_FILE = "/etc/grub.d/42_password"
+
+ def used?
+ Yast.import "FileUtils"
+
+ Yast::FileUtils.Exists PWD_ENCRYPTION_FILE
+ end
+
+ def enable(password)
+ enc_passwd = encrypt(password)
+
+ file_content = "#! /bin/sh\n" +
+ "exec tail -n +3 $0\n" +
+ "# File created by YaST and next password change in YaST will overwrite it\n" +
+ "set superusers=\"root\"\n" +
+ "password_pbkdf2 root #{enc_passwd}\n" +
+ "export superusers"
+
+ Yast::SCR.Write(
+ Yast::Path.new(".target.string"),
+ [PWD_ENCRYPTION_FILE, 0755],
+ file_content
+ )
+ end
+
+ def disable
+ return unless used?
+
+ Yast::SCR.Execute(YAST_BASH_PATH, "rm '#{PWD_ENCRYPTION_FILE}'")
+ end
+
+private
+
+ def encrypt(password)
+ result = Yast::SCR.Execute(YAST_BASH_PATH,
+ "echo -e \"#{password}\\n#{password}\" | grub2-mkpasswd-pbkdf2"
+ )
+
+ if result["exit"] != 0
+ raise "Failed to create encrypted password for grub2. Command output: #{result["stderr"]}"
+ end
+
+ pwd_line = result["stdout"].split("\n").grep(/password is/).first
+ if !pwd_line
+ raise "INTERNAL ERROR: output do not contain encrypted password. Output: #{result["stdout"]}"
+ end
+
+ ret = pwd_line[/^.*password is\s*(\S+)/,1]
+ if !ret
+ raise "INTERNAL ERROR: output do not contain encrypted password. Output: #{result["stdout"]}"
+ end
+
+ return ret
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/src/modules/BootCommon.rb new/yast2-bootloader-3.1.6/src/modules/BootCommon.rb
--- old/yast2-bootloader-3.1.5/src/modules/BootCommon.rb 2014-02-12 17:28:04.000000000 +0100
+++ new/yast2-bootloader-3.1.6/src/modules/BootCommon.rb 2014-02-27 16:13:28.000000000 +0100
@@ -996,10 +996,6 @@
Builtins.y2milestone(
"It is XEN domU and the bootloader should be installed"
)
- # bnc #766283 - opensuse 12.2 pv guests can not start after installation
- # due to lack of grub2 support in the host
- # fallback to use grub until grub2 really works on it
- @loader_type = "grub" if @loader_type == "grub2"
end
if (Arch.i386 || Arch.x86_64) && Linuxrc.InstallInf("EFI") == "1"
# use grub2-efi as default bootloader for x86_64/i386 EFI
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/src/modules/BootGRUB2.rb new/yast2-bootloader-3.1.6/src/modules/BootGRUB2.rb
--- old/yast2-bootloader-3.1.5/src/modules/BootGRUB2.rb 2014-02-12 17:28:04.000000000 +0100
+++ new/yast2-bootloader-3.1.6/src/modules/BootGRUB2.rb 2014-02-27 16:13:28.000000000 +0100
@@ -19,49 +19,21 @@
# $Id: BootGRUB.ycp 63508 2011-03-04 12:53:27Z jreidinger $
#
require "yast"
+require "bootloader/grub2base"
module Yast
- class BootGRUB2Class < Module
+ class BootGRUB2Class < GRUB2Base
def main
- Yast.import "UI"
-
- textdomain "bootloader"
-
- Yast.import "BootArch"
- Yast.import "BootCommon"
- Yast.import "BootStorage"
- Yast.import "Kernel"
- Yast.import "Mode"
- Yast.import "Stage"
- Yast.import "Storage"
- Yast.import "StorageDevices"
- Yast.import "Pkg"
- Yast.import "HTML"
- Yast.import "Initrd"
- Yast.import "Product"
+ super
# includes
# for shared some routines with grub
Yast.include self, "bootloader/grub2/misc.rb"
- # for simplified widgets than other
- Yast.include self, "bootloader/grub2/dialogs.rb"
BootGRUB2()
end
# general functions
- # Propose global options of bootloader
- def StandardGlobals
- {
- "timeout" => "8",
- "default" => "0",
- "vgamode" => "",
- "gfxmode" => "auto",
- "terminal" => "gfxterm",
- "os_prober" => "true"
- }
- end
-
# Read settings from disk
# @param [Boolean] reread boolean true to force reread settings from system
# @param [Boolean] avoid_reading_device_map do not read new device map from file, use
@@ -109,16 +81,6 @@
ret
end
- # Update read settings to new version of configuration files
- def Update
- Read(true, true)
-
- #we don't handle sections, grub2 section create them for us
- #BootCommon::UpdateSections ();
- BootCommon.UpdateGlobals
-
- nil
- end
# Write bootloader settings to disk
# @return [Boolean] true on success
def Write
@@ -141,87 +103,9 @@
ret
end
- # Reset bootloader settings
- # @param [Boolean] init boolean true to repropose also device map
- def Reset(init)
- return if Mode.autoinst
- BootCommon.Reset(init)
-
- nil
- end
-
- # Propose bootloader settings
-
def Propose
- if BootCommon.was_proposed
- # workaround autoyast config is Imported thus was_proposed always set
- if Mode.autoinst
- Builtins.y2milestone(
- "autoinst mode we ignore meaningless was_proposed as it always set"
- )
- else
- Builtins.y2milestone(
- "calling Propose with was_proposed set is really bogus, clear it to force a re-propose"
- )
- return
- end
- end
-
- if BootCommon.globals == nil || Builtins.size(BootCommon.globals) == 0
- BootCommon.globals = StandardGlobals()
- else
- BootCommon.globals = Convert.convert(
- Builtins.union(BootCommon.globals, StandardGlobals()),
- :from => "map",
- :to => "map <string, string>"
- )
- end
-
- grub_LocationProposal
-
- swap_sizes = BootCommon.getSwapPartitions
- swap_parts = Builtins.maplist(swap_sizes) { |name, size| name }
- swap_parts = Builtins.sort(swap_parts) do |a, b|
- Ops.greater_than(Ops.get(swap_sizes, a, 0), Ops.get(swap_sizes, b, 0))
- end
-
- largest_swap_part = Ops.get(swap_parts, 0, "")
-
- resume = BootArch.ResumeAvailable ? largest_swap_part : ""
- # try to use label or udev id for device name... FATE #302219
- if resume != "" && resume != nil
- resume = BootStorage.Dev2MountByDev(resume)
- end
- Ops.set(
- BootCommon.globals,
- "append",
- BootArch.DefaultKernelParams(resume)
- )
- Ops.set(
- BootCommon.globals,
- "append_failsafe",
- BootArch.FailsafeKernelParams
- )
- Ops.set(
- BootCommon.globals,
- "distributor",
- Ops.add(Ops.add(Product.short_name, " "), Product.version)
- )
- BootCommon.kernelCmdLine = Kernel.GetCmdLine
-
- Builtins.y2milestone("Proposed globals: %1", BootCommon.globals)
-
- # Let grub2 scripts detects correct root= for us. :)
- # BootCommon::globals["root"] = BootStorage::Dev2MountByDev(BootStorage::RootPartitionDevice);
-
- # We don't set vga= if Grub2 gfxterm enabled, because the modesettings
- # will be delivered to kernel by Grub2's gfxpayload set to "keep"
- #if (BootArch::VgaAvailable () && Kernel::GetVgaType () != "")
- #{
- # BootCommon::globals["vgamode"] = Kernel::GetVgaType ();
- #}
-
- nil
+ super
+ grub_LocationProposal if !BootCommon.was_proposed || !Mode.autoinst
end
# FATE#303643 Enable one-click changes in bootloader proposal
@@ -358,6 +242,7 @@
"read" => fun_ref(method(:Read), "boolean (boolean, boolean)"),
"reset" => fun_ref(method(:Reset), "void (boolean)"),
"propose" => fun_ref(method(:Propose), "void ()"),
+ "save" => fun_ref(method(:Save), "boolean (boolean, boolean, boolean)"),
"summary" => fun_ref(method(:Summary), "list <string> ()"),
"update" => fun_ref(method(:Update), "void ()"),
"widgets" => fun_ref(
@@ -369,20 +254,6 @@
}
end
- # Initializer of GRUB bootloader
- def Initializer
- Builtins.y2milestone("Called GRUB2 initializer")
- BootCommon.current_bootloader_attribs = {
- "propose" => false,
- "read" => false,
- "scratch" => false,
- "restore_mbr" => false,
- "bootloader_on_disk" => false
- }
-
- nil
- end
-
# Constructor
def BootGRUB2
Ops.set(
@@ -407,6 +278,7 @@
publish :variable => :grub_descriptions, :type => "map <string, string>"
publish :variable => :grub2_help_messages, :type => "map <string, string>"
publish :variable => :grub2_descriptions, :type => "map <string, string>"
+ publish :variable => :password, :type => "string"
publish :function => :askLocationResetPopup, :type => "boolean (string)"
publish :function => :grub2Widgets, :type => "map <string, map <string, any>> ()"
publish :function => :grub2efiWidgets, :type => "map <string, map <string, any>> ()"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/src/modules/BootGRUB2EFI.rb new/yast2-bootloader-3.1.6/src/modules/BootGRUB2EFI.rb
--- old/yast2-bootloader-3.1.5/src/modules/BootGRUB2EFI.rb 2014-02-12 17:28:04.000000000 +0100
+++ new/yast2-bootloader-3.1.6/src/modules/BootGRUB2EFI.rb 2014-02-27 16:13:28.000000000 +0100
@@ -19,49 +19,18 @@
# $Id: BootGRUB2EFI.ycp 63508 2011-03-04 12:53:27Z jreidinger $
#
require "yast"
+require "bootloader/grub2base"
module Yast
- class BootGRUB2EFIClass < Module
+ class BootGRUB2EFIClass < GRUB2Base
def main
- Yast.import "UI"
+ super
- textdomain "bootloader"
-
- Yast.import "BootArch"
- Yast.import "BootCommon"
- Yast.import "BootStorage"
- Yast.import "Kernel"
- Yast.import "Mode"
- Yast.import "Stage"
- Yast.import "Storage"
- Yast.import "StorageDevices"
- Yast.import "Pkg"
- Yast.import "HTML"
- Yast.import "Initrd"
- Yast.import "Product"
-
- # includes
- # for shared some routines with grub
- # include "bootloader/grub/misc.ycp";
- # for simplified widgets than other
- Yast.include self, "bootloader/grub2/dialogs.rb"
BootGRUB2EFI()
end
# general functions
- # Propose global options of bootloader
- def StandardGlobals
- {
- "timeout" => "8",
- "default" => "0",
- "vgamode" => "",
- "gfxmode" => "auto",
- "terminal" => "gfxterm",
- "os_prober" => "true"
- }
- end
-
# Read settings from disk
# @param [Boolean] reread boolean true to force reread settings from system
# @param [Boolean] avoid_reading_device_map do not read new device map from file, use
@@ -70,30 +39,7 @@
def Read(reread, avoid_reading_device_map)
BootCommon.InitializeLibrary(reread, "grub2-efi")
BootCommon.ReadFiles(avoid_reading_device_map) if reread
- # TODO: check if necessary for grub2efi
- # grub_DetectDisks ();
- ret = BootCommon.Read(false, avoid_reading_device_map)
-
- # TODO: check if necessary for grub2
- # refresh device map if not read
- # if (BootStorage::device_mapping == nil
- # || size (BootStorage::device_mapping) == 0)
- # {
- # BootStorage::ProposeDeviceMap ();
- # }
-
- ret
- end
-
- # Update read settings to new version of configuration files
- def Update
- Read(true, true)
-
- #we don't handle sections, grub2 section create them for us
- #BootCommon::UpdateSections ();
- BootCommon.UpdateGlobals
-
- nil
+ BootCommon.Read(false, avoid_reading_device_map)
end
# Write bootloader settings to disk
@@ -112,87 +58,6 @@
ret
end
- # Reset bootloader settings
- # @param [Boolean] init boolean true to repropose also device map
- def Reset(init)
- return if Mode.autoinst
- BootCommon.Reset(init)
-
- nil
- end
-
- # Propose bootloader settings
-
- def Propose
- if BootCommon.was_proposed
- # workaround autoyast config is Imported thus was_proposed always set
- if Mode.autoinst
- Builtins.y2milestone(
- "autoinst mode we ignore meaningless was_proposed as it always set"
- )
- else
- Builtins.y2milestone(
- "calling Propose with was_proposed set is really bogus, clear it to force a re-propose"
- )
- return
- end
- end
-
- if BootCommon.globals == nil || Builtins.size(BootCommon.globals) == 0
- BootCommon.globals = StandardGlobals()
- else
- BootCommon.globals = Convert.convert(
- Builtins.union(BootCommon.globals, StandardGlobals()),
- :from => "map",
- :to => "map <string, string>"
- )
- end
-
- swap_sizes = BootCommon.getSwapPartitions
- swap_parts = Builtins.maplist(swap_sizes) { |name, size| name }
- swap_parts = Builtins.sort(swap_parts) do |a, b|
- Ops.greater_than(Ops.get(swap_sizes, a, 0), Ops.get(swap_sizes, b, 0))
- end
-
- largest_swap_part = Ops.get(swap_parts, 0, "")
-
- resume = BootArch.ResumeAvailable ? largest_swap_part : ""
- # try to use label or udev id for device name... FATE #302219
- if resume != "" && resume != nil
- resume = BootStorage.Dev2MountByDev(resume)
- end
- Ops.set(
- BootCommon.globals,
- "append",
- BootArch.DefaultKernelParams(resume)
- )
- Ops.set(
- BootCommon.globals,
- "append_failsafe",
- BootArch.FailsafeKernelParams
- )
- Ops.set(
- BootCommon.globals,
- "distributor",
- Ops.add(Ops.add(Product.short_name, " "), Product.version)
- )
- BootCommon.kernelCmdLine = Kernel.GetCmdLine
-
- Builtins.y2milestone("Proposed globals: %1", BootCommon.globals)
-
- # Let grub2 scripts detects correct root= for us. :)
- # BootCommon::globals["root"] = BootStorage::Dev2MountByDev(BootStorage::RootPartitionDevice);
-
- # We don't set vga= if Grub2 gfxterm enabled, because the modesettings
- # will be delivered to kernel by Grub2's gfxpayload set to "keep"
- #if (BootArch::VgaAvailable () && Kernel::GetVgaType () != "")
- #{
- # BootCommon::globals["vgamode"] = Kernel::GetVgaType ();
- #}
-
- nil
- end
-
# Display bootloader summary
# @return a list of summary lines
@@ -214,11 +79,6 @@
deep_copy(result)
end
- def Dialogs
- Builtins.y2milestone("Called GRUB2 Dialogs")
- { "loader" => fun_ref(method(:Grub2LoaderDetailsDialog), "symbol ()") }
- end
-
# Return map of provided functions
# @return a map of functions (eg. $["write":BootGRUB2EFI::Write])
def GetFunctions
@@ -226,6 +86,7 @@
"read" => fun_ref(method(:Read), "boolean (boolean, boolean)"),
"reset" => fun_ref(method(:Reset), "void (boolean)"),
"propose" => fun_ref(method(:Propose), "void ()"),
+ "save" => fun_ref(method(:Save), "boolean (boolean, boolean, boolean)"),
"summary" => fun_ref(method(:Summary), "list <string> ()"),
"update" => fun_ref(method(:Update), "void ()"),
"widgets" => fun_ref(
@@ -238,20 +99,6 @@
end
- # Initializer of GRUB2EFI bootloader
- def Initializer
- Builtins.y2milestone("Called GRUB2EFI initializer")
- BootCommon.current_bootloader_attribs = {
- "propose" => false,
- "read" => false,
- "scratch" => false,
- "restore_mbr" => false,
- "bootloader_on_disk" => false
- }
-
- nil
- end
-
# Constructor
def BootGRUB2EFI
Ops.set(
@@ -273,6 +120,7 @@
publish :variable => :grub_descriptions, :type => "map <string, string>"
publish :variable => :grub2_help_messages, :type => "map <string, string>"
publish :variable => :grub2_descriptions, :type => "map <string, string>"
+ publish :variable => :password, :type => "string"
publish :function => :askLocationResetPopup, :type => "boolean (string)"
publish :function => :grub2Widgets, :type => "map <string, map <string, any>> ()"
publish :function => :grub2efiWidgets, :type => "map <string, map <string, any>> ()"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/test/Makefile.am new/yast2-bootloader-3.1.6/test/Makefile.am
--- old/yast2-bootloader-3.1.5/test/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-bootloader-3.1.6/test/Makefile.am 2014-02-27 16:13:28.000000000 +0100
@@ -0,0 +1,7 @@
+TESTS = \
+ grub2pwd_test.rb
+
+TEST_EXTENSIONS = .rb
+RB_LOG_COMPILER = rspec --format doc
+VERBOSE = 1
+EXTRA_DIST = $(TESTS)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/test/grub2pwd_test.rb new/yast2-bootloader-3.1.6/test/grub2pwd_test.rb
--- old/yast2-bootloader-3.1.5/test/grub2pwd_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-bootloader-3.1.6/test/grub2pwd_test.rb 2014-02-27 16:13:28.000000000 +0100
@@ -0,0 +1,107 @@
+#! /usr/bin/env rspec --format doc
+
+require_relative "./test_helper"
+
+require "bootloader/grub2pwd"
+
+describe GRUB2Pwd do
+ subject { GRUB2Pwd.new }
+
+ def mock_file_presence(exists)
+ Yast.import "FileUtils"
+ expect(Yast::FileUtils).to receive(:Exists).with("/etc/grub.d/42_password").
+ and_return(exists)
+ end
+
+ describe "#used?" do
+ it "return true if exists file #{GRUB2Pwd::PWD_ENCRYPTION_FILE}" do
+ mock_file_presence(true)
+ expect(subject.used?).to be_true
+ end
+ end
+
+ describe "#disable" do
+ it "removes file #{GRUB2Pwd::PWD_ENCRYPTION_FILE} when exists" do
+ mock_file_presence(true)
+
+ expect(Yast::SCR).to receive(:Execute).with(kind_of(Yast::Path),"rm '#{GRUB2Pwd::PWD_ENCRYPTION_FILE}'")
+
+ subject.disable
+ end
+
+ it "do nothing if file #{GRUB2Pwd::PWD_ENCRYPTION_FILE} does not exist" do
+ mock_file_presence(false)
+
+ expect(Yast::SCR).to receive(:Execute).never
+
+ subject.disable
+ end
+ end
+
+ describe "#enabled" do
+ it "write encrypted password to #{GRUB2Pwd::PWD_ENCRYPTION_FILE} with executable permissions" do
+ passwd = "grub.pbkdf2.sha512.10000.774E325959D6D7BCFB7384A0245674D83D0D540A89C02FEA81E35489F8DE7ADFD93988190AD9857A0FFF363825DDF97C8F4E658D8CC49FC4A22C053B08AB3EFE.6FB19FF26FD03D85C40A33D8BA7C04E72EDE3DD5D7080C177553A4FED370F71C579AF0B15B3B93ECECEA355469A4B6D0560BFB53ED35DDA0B80F5363BFBD54E4"
+ success_stdout = <<EOF
+ Enter password:
+
+ Reenter password:
+ PBKDF2 hash of your password is #{passwd}
+EOF
+
+ expect(Yast::SCR).to receive(:Execute).
+ with(kind_of(Yast::Path), /grub2-mkpasswd/).
+ and_return(
+ "exit" => 0,
+ "stderr" => "",
+ "stdout" => success_stdout
+ )
+ expect(Yast::SCR).to receive(:Write).with(
+ kind_of(Yast::Path),
+ [GRUB2Pwd::PWD_ENCRYPTION_FILE, 0755],
+ /#{passwd}/
+ )
+
+ subject.enable("really strong password")
+ end
+
+ it "raise exception if grub2-mkpasswd-pbkdf failed" do
+ expect(Yast::SCR).to receive(:Execute).
+ with(kind_of(Yast::Path),/grub2-mkpasswd/).
+ and_return(
+ "exit" => 1,
+ "stderr" => "bad error",
+ "stdout" => ""
+ )
+ expect(Yast::SCR).to receive(:Write).never
+
+ expect{subject.enable("really strong password")}.to raise_error(RuntimeError, /bad error/)
+ end
+
+ it "raise exception if grub2-mkpasswd-pbkdf do not provide password" do
+ expect(Yast::SCR).to receive(:Execute).
+ with(kind_of(Yast::Path),/grub2-mkpasswd/).
+ and_return(
+ "exit" => 0,
+ "stderr" => "",
+ "stdout" => "bad output"
+ )
+ expect(Yast::SCR).to receive(:Write).never
+
+ expect{subject.enable("really strong password")}.to raise_error(RuntimeError, /bad output/)
+ end
+
+
+ it "raise exception if grub2-mkpasswd-pbkdf create password line but without password" do
+ expect(Yast::SCR).to receive(:Execute).
+ with(kind_of(Yast::Path),/grub2-mkpasswd/).
+ and_return(
+ "exit" => 0,
+ "stderr" => "",
+ "stdout" => "password is"
+ )
+ expect(Yast::SCR).to receive(:Write).never
+
+ expect{subject.enable("really strong password")}.to raise_error(RuntimeError, /password is/)
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-bootloader-3.1.5/test/test_helper.rb new/yast2-bootloader-3.1.6/test/test_helper.rb
--- old/yast2-bootloader-3.1.5/test/test_helper.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-bootloader-3.1.6/test/test_helper.rb 2014-02-27 16:13:28.000000000 +0100
@@ -0,0 +1,8 @@
+ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)
+
+if ENV["COVERAGE"]
+ require "simplecov"
+ SimpleCov.start
+end
+
+require "yast"
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package yast2-ruby-bindings for openSUSE:Factory checked in at 2014-03-01 14:38:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-ruby-bindings (Old)
and /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-ruby-bindings"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-ruby-bindings/yast2-ruby-bindings.changes 2014-02-21 13:48:19.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-ruby-bindings.new/yast2-ruby-bindings.changes 2014-03-01 14:38:21.000000000 +0100
@@ -1,0 +2,20 @@
+Thu Feb 27 12:10:11 UTC 2014 - jreidinger(a)suse.com
+
+- fix precedence of loading files in lib
+- 3.1.13
+
+-------------------------------------------------------------------
+Wed Feb 26 12:22:48 UTC 2014 - lslezak(a)suse.cz
+
+- added N_() and Nn_() gettext equivalents (to only mark a text
+ for translation)
+- 3.1.12
+
+-------------------------------------------------------------------
+Thu Feb 20 07:58:32 UTC 2014 - jreidinger(a)suse.com
+
+- always log full backtrace when type conversion failed, to help
+ with debugging
+- 3.1.11
+
+-------------------------------------------------------------------
Old:
----
yast2-ruby-bindings-3.1.10.tar.bz2
New:
----
yast2-ruby-bindings-3.1.13.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-ruby-bindings.spec ++++++
--- /var/tmp/diff_new_pack.NRhbns/_old 2014-03-01 14:38:22.000000000 +0100
+++ /var/tmp/diff_new_pack.NRhbns/_new 2014-03-01 14:38:22.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-ruby-bindings
-Version: 3.1.10
+Version: 3.1.13
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: yast2-ruby-bindings-%{version}.tar.bz2
++++++ yast2-ruby-bindings-3.1.10.tar.bz2 -> yast2-ruby-bindings-3.1.13.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/package/yast2-ruby-bindings.changes new/yast2-ruby-bindings-3.1.13/package/yast2-ruby-bindings.changes
--- old/yast2-ruby-bindings-3.1.10/package/yast2-ruby-bindings.changes 2014-02-19 13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/package/yast2-ruby-bindings.changes 2014-02-27 16:11:12.000000000 +0100
@@ -1,4 +1,24 @@
-------------------------------------------------------------------
+Thu Feb 27 12:10:11 UTC 2014 - jreidinger(a)suse.com
+
+- fix precedence of loading files in lib
+- 3.1.13
+
+-------------------------------------------------------------------
+Wed Feb 26 12:22:48 UTC 2014 - lslezak(a)suse.cz
+
+- added N_() and Nn_() gettext equivalents (to only mark a text
+ for translation)
+- 3.1.12
+
+-------------------------------------------------------------------
+Thu Feb 20 07:58:32 UTC 2014 - jreidinger(a)suse.com
+
+- always log full backtrace when type conversion failed, to help
+ with debugging
+- 3.1.11
+
+-------------------------------------------------------------------
Mon Feb 17 10:34:13 UTC 2014 - jreidinger(a)suse.com
- fix stack level too deep (BNC#864056,BNC#864180)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/package/yast2-ruby-bindings.spec new/yast2-ruby-bindings-3.1.13/package/yast2-ruby-bindings.spec
--- old/yast2-ruby-bindings-3.1.10/package/yast2-ruby-bindings.spec 2014-02-19 13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/package/yast2-ruby-bindings.spec 2014-02-27 16:11:12.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-ruby-bindings
-Version: 3.1.10
+Version: 3.1.13
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: yast2-ruby-bindings-%{version}.tar.bz2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/src/ruby/yast/convert.rb new/yast2-ruby-bindings-3.1.13/src/ruby/yast/convert.rb
--- old/yast2-ruby-bindings-3.1.10/src/ruby/yast/convert.rb 2014-02-19 13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/src/ruby/yast/convert.rb 2014-02-27 16:11:12.000000000 +0100
@@ -38,7 +38,7 @@
return object if from == to
if from == "any" && allowed_type(object,to)
- return object
+ return object
elsif to == "float"
return nil unless (object.is_a? Fixnum) || (object.is_a? Bignum)
return object.to_f
@@ -51,7 +51,7 @@
elsif to == "string" && from == "locale"
return object
else
- Yast.y2warning "Cannot convert #{object.class} from '#{from}' to '#{to}'"
+ Yast.y2warning -1, "Cannot convert #{object.class} from '#{from}' to '#{to}'"
return nil
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/src/ruby/yast/i18n.rb new/yast2-ruby-bindings-3.1.13/src/ruby/yast/i18n.rb
--- old/yast2-ruby-bindings-3.1.10/src/ruby/yast/i18n.rb 2014-02-19 13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/src/ruby/yast/i18n.rb 2014-02-27 16:11:12.000000000 +0100
@@ -48,6 +48,43 @@
FastGettext.text_domain = old_text_domain
end
+ # No translation, only marks the text to be found by gettext when creating POT file,
+ # the text needs to be translated by {#_} later.
+ #
+ # @example Error messages
+ # begin
+ # # does not translate, the exception contains the untranslated string,
+ # # but it's recognized by gettext like normal _()
+ # raise FooError, N_("Foo failed.")
+ # rescue FooError => e
+ # # log the original (untranslated) error
+ # log.error e.message
+ #
+ # # but display translated error to the user,
+ # # _() does the actual translation
+ # Popup.Error(_(e.message))
+ # end
+ #
+ # @example Translating Constants
+ # class Foo
+ # # ERROR_MSG will not be translated, but the string will be found
+ # # by gettext when creating the POT file
+ # ERROR_MSG = N_("Something failed")
+ # end
+ #
+ # # here the string will be translated using the current locale
+ # puts _(Foo::ERROR_MSG)
+ #
+ def N_(str)
+ str
+ end
+
+ # No translation, only marks the texts to be found by gettext when creating POT file,
+ # the texts need to be translated by {#n_} later.
+ def Nn_(*keys)
+ keys
+ end
+
# Gets translation based on number.
# @param (String) singular text for translators for single value
# @param (String) plural text for translators for bigger value
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/src/ruby/yast.rb new/yast2-ruby-bindings-3.1.13/src/ruby/yast.rb
--- old/yast2-ruby-bindings-3.1.10/src/ruby/yast.rb 2014-02-19 13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/src/ruby/yast.rb 2014-02-27 16:11:12.000000000 +0100
@@ -44,8 +44,9 @@
require "yast/ui_shortcuts"
require "yast/wfm"
-#add yast specific path for ruby libraries, similar to lib directory in rails
-Yast.y2paths.each do |p|
+# add yast specific path for ruby libraries, similar to lib directory in rails
+# unshift it in reverse order to keep precedence
+Yast.y2paths.reverse.each do |p|
dir_path = File.join(p, "lib")
if File.exists? dir_path
$LOAD_PATH.unshift dir_path
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/tests/ruby/CMakeLists.txt new/yast2-ruby-bindings-3.1.13/tests/ruby/CMakeLists.txt
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/CMakeLists.txt 2014-02-19 13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/CMakeLists.txt 2014-02-27 16:11:12.000000000 +0100
@@ -14,5 +14,5 @@
FILE(GLOB Specs "*_spec.rb")
foreach(test ${Specs})
- ADD_TEST(${test} rspec ${test})
+ ADD_TEST(${test} rspec --format doc ${test})
endforeach(test)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/tests/ruby/i18n_spec.rb new/yast2-ruby-bindings-3.1.13/tests/ruby/i18n_spec.rb
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/i18n_spec.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/i18n_spec.rb 2014-02-27 16:11:12.000000000 +0100
@@ -0,0 +1,30 @@
+#!/usr/bin/env rspec
+
+require_relative "test_helper_rspec"
+
+require "yast"
+
+include Yast::I18n
+
+module Yast
+ describe I18n do
+
+ describe ".N_" do
+ it "returns the original parameter" do
+ input = "INPUT TEST"
+ expect(N_(input)).to be input
+ end
+ end
+
+ describe ".Nn_" do
+ it "returns the original parameters" do
+ singular = "singular"
+ plural = "plural"
+ count = 42
+
+ expect(Nn_(singular, plural, count)).to eq [singular, plural, count]
+ end
+ end
+
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/tests/ruby/import_test.rb new/yast2-ruby-bindings-3.1.13/tests/ruby/import_test.rb
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/import_test.rb 2014-02-19 13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/import_test.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,25 +0,0 @@
-#
-# Test Ycp.import
-#
-
-require_relative "test_helper_test_unit"
-
-require "yast"
-
-class YcpImportTest < Yast::TestCase
- def test_import
- Yast.import( "ExampleTestModule" )
- assert Yast::ExampleTestModule.respond_to?(:sparc_map)
- assert Yast::ExampleTestModule.respond_to?(:is_xen)
- assert Yast::ExampleTestModule.respond_to?(:arch_short)
- assert Yast::ExampleTestModule.respond_to?(:example_string)
- assert Yast::ExampleTestModule.respond_to?(:example_string=)
- end
-
- def test_method_call
- Yast.import "ExampleTestModule"
- assert_equal false, Yast::ExampleTestModule.is_xen
- assert_equal "ZX Spectrum", Yast::ExampleTestModule.arch_short
- assert_equal ({"one" => 1, "two" => 2}), Yast::ExampleTestModule.sparc_map
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/tests/ruby/include_test.rb new/yast2-ruby-bindings-3.1.13/tests/ruby/include_test.rb
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/include_test.rb 2014-02-19 13:30:29.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/include_test.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,46 +0,0 @@
-#
-# Test Ycp.import
-#
-
-require_relative "test_helper_test_unit"
-
-require "yast"
-
-module Yast
- class IncludeTest < Module
- def initialize
- @test = 5
- Yast.include self, "example.rb"
- end
-
- attr_reader :test
- end
- IT = IncludeTest.new
-
- class DoubleIncludeTest < Module
- def initialize
- Yast.include self, "example.rb"
- @test = 5
- # second include should not call again init, so @test is kept to 5
- Yast.include self, "example.rb"
- end
-
- attr_reader :test
- end
- DIT = DoubleIncludeTest.new
-end
-
-
-class IncludeTest < Yast::TestCase
- def test_include
- assert_equal 15, Yast::IT.test
- end
-
- def test_included_method_call
- assert_equal 20, Yast::IT.test_plus_five
- end
-
- def test_double_include
- assert_equal 5, Yast::DIT.test
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/tests/ruby/test_module/include/cyclic_yang.rb new/yast2-ruby-bindings-3.1.13/tests/ruby/test_module/include/cyclic_yang.rb
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/test_module/include/cyclic_yang.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/test_module/include/cyclic_yang.rb 2014-02-27 16:11:12.000000000 +0100
@@ -0,0 +1,11 @@
+module Yast
+ module CyclicYangInclude
+ def initialize_cyclic_yang(include_target)
+ Yast.include include_target, "cyclic_yin.rb"
+ end
+
+ def yang
+ "YANG"
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/tests/ruby/test_module/include/cyclic_yin.rb new/yast2-ruby-bindings-3.1.13/tests/ruby/test_module/include/cyclic_yin.rb
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/test_module/include/cyclic_yin.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/test_module/include/cyclic_yin.rb 2014-02-27 16:11:12.000000000 +0100
@@ -0,0 +1,11 @@
+module Yast
+ module CyclicYinInclude
+ def initialize_cyclic_yin(include_target)
+ Yast.include include_target, "cyclic_yang.rb"
+ end
+
+ def yin
+ "YIN"
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ruby-bindings-3.1.10/tests/ruby/yast_spec.rb new/yast2-ruby-bindings-3.1.13/tests/ruby/yast_spec.rb
--- old/yast2-ruby-bindings-3.1.10/tests/ruby/yast_spec.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-ruby-bindings-3.1.13/tests/ruby/yast_spec.rb 2014-02-27 16:11:12.000000000 +0100
@@ -0,0 +1,49 @@
+#!/usr/bin/env rspec
+
+require_relative "test_helper_rspec"
+
+require "yast"
+
+describe Yast do
+ describe ".include" do
+ it "include methods to target class set as first argument" do
+ include_test = Class.new Yast::Module
+ include_test_instance = include_test.new
+
+ Yast.include(include_test_instance, "example.rb")
+
+ expect(include_test_instance).to be_respond_to(:test_plus_five)
+ end
+
+ it "call its initialization method" do
+ include_test = Class.new Yast::Module
+ include_test.send(:define_method, :initialize) do
+ @test = 5
+ # initialization set @test value to 15
+ Yast.include self, "example.rb"
+ end
+ include_test.send(:attr_reader, :test)
+ include_test_instance = include_test.new
+
+ expect(include_test_instance.test).to be 15
+ end
+
+ it "call its initialization only during first include" do
+ include_test = Class.new Yast::Module
+ include_test.send(:define_method, :initialize) do
+ Yast.include self, "example.rb"
+ @test = 5
+ # second initialization should no set @test value to 15
+ Yast.include self, "example.rb"
+ end
+ include_test.send(:attr_reader, :test)
+ include_test_instance = include_test.new
+
+ expect(include_test_instance.test).to be 5
+ end
+
+ it "does not loop endlessly on cyclic includes" do
+ expect { Yast.include(Class.new.new, "cyclic_yin.rb") }.not_to raise_error
+ end
+ end
+end
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package yast2-services-manager for openSUSE:Factory checked in at 2014-03-01 14:38:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-services-manager (Old)
and /work/SRC/openSUSE:Factory/.yast2-services-manager.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-services-manager"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-services-manager/yast2-services-manager.changes 2014-02-21 13:48:12.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-services-manager.new/yast2-services-manager.changes 2014-03-01 14:38:20.000000000 +0100
@@ -1,0 +2,18 @@
+Fri Feb 28 17:06:39 UTC 2014 - vmoravec(a)suse.com
+
+- Reload target detection after install config change (bnc#866292)
+- 3.1.8
+
+-------------------------------------------------------------------
+Wed Feb 26 13:24:10 UTC 2014 - vmoravec(a)suse.com
+
+- Select the current default target in the proposal (bnc#865357)
+- 3.1.7
+
+-------------------------------------------------------------------
+Tue Feb 25 15:43:51 UTC 2014 - vmoravec(a)suse.com
+
+- Fix crashing installer if canceled target proposal (bnc#865354)
+- 3.1.6
+
+-------------------------------------------------------------------
Old:
----
yast2-services-manager-3.1.5.tar.bz2
New:
----
yast2-services-manager-3.1.8.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-services-manager.spec ++++++
--- /var/tmp/diff_new_pack.E2qY8K/_old 2014-03-01 14:38:21.000000000 +0100
+++ /var/tmp/diff_new_pack.E2qY8K/_new 2014-03-01 14:38:21.000000000 +0100
@@ -24,7 +24,7 @@
######################################################################
Name: yast2-services-manager
-Version: 3.1.5
+Version: 3.1.8
Release: 0
BuildArch: noarch
++++++ yast2-services-manager-3.1.5.tar.bz2 -> yast2-services-manager-3.1.8.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-services-manager-3.1.5/package/yast2-services-manager.changes new/yast2-services-manager-3.1.8/package/yast2-services-manager.changes
--- old/yast2-services-manager-3.1.5/package/yast2-services-manager.changes 2014-02-20 14:02:56.000000000 +0100
+++ new/yast2-services-manager-3.1.8/package/yast2-services-manager.changes 2014-02-28 18:42:07.000000000 +0100
@@ -1,4 +1,22 @@
-------------------------------------------------------------------
+Fri Feb 28 17:06:39 UTC 2014 - vmoravec(a)suse.com
+
+- Reload target detection after install config change (bnc#866292)
+- 3.1.8
+
+-------------------------------------------------------------------
+Wed Feb 26 13:24:10 UTC 2014 - vmoravec(a)suse.com
+
+- Select the current default target in the proposal (bnc#865357)
+- 3.1.7
+
+-------------------------------------------------------------------
+Tue Feb 25 15:43:51 UTC 2014 - vmoravec(a)suse.com
+
+- Fix crashing installer if canceled target proposal (bnc#865354)
+- 3.1.6
+
+-------------------------------------------------------------------
Thu Feb 20 12:54:55 UTC 2014 - vmoravec(a)suse.com
- Fix wrong target selection (bnc#864073)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-services-manager-3.1.5/package/yast2-services-manager.spec new/yast2-services-manager-3.1.8/package/yast2-services-manager.spec
--- old/yast2-services-manager-3.1.5/package/yast2-services-manager.spec 2014-02-20 14:02:56.000000000 +0100
+++ new/yast2-services-manager-3.1.8/package/yast2-services-manager.spec 2014-02-28 18:42:07.000000000 +0100
@@ -24,7 +24,7 @@
######################################################################
Name: yast2-services-manager
-Version: 3.1.5
+Version: 3.1.8
Release: 0
BuildArch: noarch
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-services-manager-3.1.5/src/clients/default_target_proposal.rb new/yast2-services-manager-3.1.8/src/clients/default_target_proposal.rb
--- old/yast2-services-manager-3.1.5/src/clients/default_target_proposal.rb 2014-02-20 14:02:56.000000000 +0100
+++ new/yast2-services-manager-3.1.8/src/clients/default_target_proposal.rb 2014-02-28 18:42:07.000000000 +0100
@@ -26,7 +26,6 @@
if Linuxrc.vnc && selected_target != Target::GRAPHICAL
warnings << _('VNC needs graphical system to be available')
end
- warnings << _("\nDo you want to proceed?") unless warnings.empty?
end
end
@@ -50,8 +49,8 @@
def description
{
'id' => 'services-manager',
- 'menu_title' => _("&Default systemd target and services"),
- 'rich_text_title' => _("Default systemd target and services")
+ 'menu_title' => _("&Default systemd target"),
+ 'rich_text_title' => _("Default systemd target")
}
end
@@ -72,24 +71,24 @@
end
def show
- create_dialog
- {'workflow_sequence' => show_dialog}
+ # create the proposal dialog and get the sequence symbol from block
+ sequence = create_dialog { handle_dialog }
+ {'workflow_sequence' => sequence}
end
private
- def show_dialog
+ def handle_dialog
case UI.UserInput
when :next, :ok
selected_target = UI.QueryWidget(Id(:selected_target), :CurrentButton).to_s
Builtins.y2milestone "Target selected by user: #{selected_target}"
detect_warnings(selected_target)
if !warnings.empty?
- return show_dialog unless Popup.YesNo(warnings.join)
+ return handle_dialog unless Popup.ContinueCancel(warnings.join "\n")
end
Builtins.y2milestone "Setting systemd default target to '#{selected_target}'"
SystemdTarget.default_target = selected_target unless selected_target.empty?
- Wizard.CloseDialog
:next
when :cancel
:cancel
@@ -99,7 +98,8 @@
def generate_target_buttons
Builtins.y2milestone "Available targets: #{available_targets}"
radio_buttons = available_targets.map do |target_name|
- Left(RadioButton(Id(target_name), target_name))
+ selected = target_name == SystemdTarget.default_target
+ Left(RadioButton(Id(target_name), target_name, selected))
end
VBox(*radio_buttons)
end
@@ -117,6 +117,9 @@
)
Wizard.SetAbortButton(:cancel, Label.CancelButton)
Wizard.HideBackButton
+ yield
+ ensure
+ Wizard.CloseDialog
end
def help
@@ -163,7 +166,6 @@
def initialize
textdomain 'services-manager'
- self.default_target = ProductFeatures.GetFeature('globals', 'default_target')
change_default_target
detect_warnings(default_target)
end
@@ -179,9 +181,8 @@
private
def change_default_target
- return self.default_target = SystemdTarget.default_target unless SystemdTarget.default_target.empty?
-
- detect_target unless Mode.autoinst
+ self.default_target = ProductFeatures.GetFeature('globals', 'default_target')
+ detect_target
SystemdTarget.default_target = self.default_target
end
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package autoyast2 for openSUSE:Factory checked in at 2014-03-01 14:38:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/autoyast2 (Old)
and /work/SRC/openSUSE:Factory/.autoyast2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "autoyast2"
Changes:
--------
--- /work/SRC/openSUSE:Factory/autoyast2/autoyast2.changes 2014-02-21 13:48:09.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.autoyast2.new/autoyast2.changes 2014-03-01 14:38:19.000000000 +0100
@@ -1,0 +2,10 @@
+Wed Feb 26 13:25:45 CET 2014 - fehr(a)suse.de
+
+- Cloning of software section clones only patterns in state
+ "visible", this is a problem with OES where pattern
+ novell-yast2 is not a visible pattern (bnc#864421), changed so
+ that all patterns are written into cloned patterns list
+- add %{yast_controldir} as directory to package
+- 3.1.18
+
+-------------------------------------------------------------------
Old:
----
autoyast2-3.1.17.tar.bz2
New:
----
autoyast2-3.1.18.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ autoyast2.spec ++++++
--- /var/tmp/diff_new_pack.ZOhb6N/_old 2014-03-01 14:38:20.000000000 +0100
+++ /var/tmp/diff_new_pack.ZOhb6N/_new 2014-03-01 14:38:20.000000000 +0100
@@ -17,7 +17,7 @@
Name: autoyast2
-Version: 3.1.17
+Version: 3.1.18
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -226,6 +226,7 @@
%{yast_yncludedir}/autoinstall/tree.rb
%{yast_yncludedir}/autoinstall/types.rb
+%dir %{yast_controldir}
%{yast_controldir}/*.xml
%{yast_moduledir}/AutoInstall.rb
++++++ autoyast2-3.1.17.tar.bz2 -> autoyast2-3.1.18.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.17/package/autoyast2.changes new/autoyast2-3.1.18/package/autoyast2.changes
--- old/autoyast2-3.1.17/package/autoyast2.changes 2014-02-19 14:26:05.000000000 +0100
+++ new/autoyast2-3.1.18/package/autoyast2.changes 2014-02-26 14:35:43.000000000 +0100
@@ -1,4 +1,14 @@
-------------------------------------------------------------------
+Wed Feb 26 13:25:45 CET 2014 - fehr(a)suse.de
+
+- Cloning of software section clones only patterns in state
+ "visible", this is a problem with OES where pattern
+ novell-yast2 is not a visible pattern (bnc#864421), changed so
+ that all patterns are written into cloned patterns list
+- add %{yast_controldir} as directory to package
+- 3.1.18
+
+-------------------------------------------------------------------
Mon Feb 17 13:37:55 CET 2014 - fehr(a)suse.de
- Remove call to inst_suseconfig from control_continue_autoyast.xml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.17/package/autoyast2.spec new/autoyast2-3.1.18/package/autoyast2.spec
--- old/autoyast2-3.1.17/package/autoyast2.spec 2014-02-19 14:26:05.000000000 +0100
+++ new/autoyast2-3.1.18/package/autoyast2.spec 2014-02-26 14:35:43.000000000 +0100
@@ -17,7 +17,7 @@
Name: autoyast2
-Version: 3.1.17
+Version: 3.1.18
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -226,6 +226,7 @@
%{yast_yncludedir}/autoinstall/tree.rb
%{yast_yncludedir}/autoinstall/types.rb
+%dir %{yast_controldir}
%{yast_controldir}/*.xml
%{yast_moduledir}/AutoInstall.rb
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.1.17/src/modules/AutoinstSoftware.rb new/autoyast2-3.1.18/src/modules/AutoinstSoftware.rb
--- old/autoyast2-3.1.17/src/modules/AutoinstSoftware.rb 2014-02-19 14:26:05.000000000 +0100
+++ new/autoyast2-3.1.18/src/modules/AutoinstSoftware.rb 2014-02-26 14:35:43.000000000 +0100
@@ -954,7 +954,6 @@
all_patterns = Pkg.ResolvableProperties("", :pattern, "")
@all_xpatterns = Pkg.ResolvableDependencies("", :pattern, "")
patterns = []
- visible_patterns = []
patternsFullData = Builtins.filter(all_patterns) do |p|
ret2 = false
@@ -965,12 +964,6 @@
Ops.get_string(p, "name", "no name")
)
ret2 = true
- if Ops.get_boolean(p, "user_visible", true) == true
- visible_patterns = Builtins.add(
- visible_patterns,
- Ops.get_string(p, "name", "no name")
- )
- end
end
ret2
end
@@ -1069,7 +1062,7 @@
!Builtins.regexpmatch(pkg, "kernel-.*") || pkg == "kernel-uml"
end)
)
- Ops.set(software, "patterns", Builtins.sort(visible_patterns))
+ Ops.set(software, "patterns", Builtins.sort(patterns))
Ops.set(software, "remove-packages", Builtins.toset(removepackages))
deep_copy(software)
end
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package perl-Bootloader for openSUSE:Factory checked in at 2014-03-01 14:38:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Bootloader (Old)
and /work/SRC/openSUSE:Factory/.perl-Bootloader.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Bootloader"
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Bootloader/perl-Bootloader.changes 2014-02-21 13:48:25.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.perl-Bootloader.new/perl-Bootloader.changes 2014-03-01 14:38:17.000000000 +0100
@@ -1,0 +2,7 @@
+Thu Feb 27 11:52:10 CET 2014 - snwint(a)suse.de
+
+- propagate serial console setting to xen (bnc #862614)
+- fix reading xen sections
+- 0.805
+
+-------------------------------------------------------------------
Old:
----
perl-Bootloader-0.804.tar.xz
New:
----
perl-Bootloader-0.805.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Bootloader.spec ++++++
--- /var/tmp/diff_new_pack.VtLw2O/_old 2014-03-01 14:38:17.000000000 +0100
+++ /var/tmp/diff_new_pack.VtLw2O/_new 2014-03-01 14:38:17.000000000 +0100
@@ -17,7 +17,7 @@
Name: perl-Bootloader
-Version: 0.804
+Version: 0.805
Release: 0
Requires: coreutils
Requires: e2fsprogs
++++++ perl-Bootloader-0.804.tar.xz -> perl-Bootloader-0.805.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.804/perl-Bootloader.changes new/perl-Bootloader-0.805/perl-Bootloader.changes
--- old/perl-Bootloader-0.804/perl-Bootloader.changes 2014-02-17 13:15:59.000000000 +0100
+++ new/perl-Bootloader-0.805/perl-Bootloader.changes 2014-02-27 11:53:07.000000000 +0100
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Thu Feb 27 11:52:10 CET 2014 - snwint(a)suse.de
+
+- propagate serial console setting to xen (bnc #862614)
+- fix reading xen sections
+- 0.805
+
+-------------------------------------------------------------------
Mon Feb 17 13:15:12 CET 2014 - snwint(a)suse.de
- fix section info not returning initrd (bnc #863909)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.804/src/Core/GRUB2.pm new/perl-Bootloader-0.805/src/Core/GRUB2.pm
--- old/perl-Bootloader-0.804/src/Core/GRUB2.pm 2014-02-17 13:15:59.000000000 +0100
+++ new/perl-Bootloader-0.805/src/Core/GRUB2.pm 2014-02-27 11:53:07.000000000 +0100
@@ -265,7 +265,6 @@
$sect_info{"name"} = $name;
$sect_info{"menuentry"} = $name;
- $sect_info{"type"} = "image";
if ($args =~ m/'gnulinux-[^\s]+-recovery-[^\s]+'/) {
$sect_info{"usage"} = "linux_failsafe";
@@ -273,25 +272,59 @@
$sect_info{"usage"} = "linux";
}
- if ($cfg2 =~ /^\s+linux\s+([^\s]+)\s*(.*)$/m) {
- my $append = $2;
- $sect_info{"image"} = $1;
-
- if ($append =~ /root=/) {
- $append =~ s/root=([^\s]+)\s*//;
- $sect_info{"root"} = $1;
- }
+ if ($args =~ m/--class xen/) {
+
+ $sect_info{"type"} = "xen";
+
+ if ($cfg2 =~ /^\s+multiboot\s+(\S+)\s+\S+\s*(.*)$/m) {
+ $sect_info{"xen"} = $1;
+ $sect_info{"xen_append"} = $2;
+ }
+
+ while ($cfg2 =~ /^\s+module\s+(\S+)\s+\S+\s*(.*)$/gm) {
+
+ if (!exists $sect_info{"image"}) {
+
+ my $append = $2;
+ $sect_info{"image"} = $1;
+
+ if ($append =~ /root=/) {
+ $append =~ s/root=(\S+)\s*//;
+ $sect_info{"root"} = $1;
+ }
+
+ if ($append =~ /vga=/) {
+ $append =~ s/vga=(\S+)\s*//;
+ $sect_info{"vgamode"} = $1;
+ }
- if ($append =~ /vga=/) {
- $append =~ s/vga=([^\s]+)\s*//;
- $sect_info{"vgamode"} = $1;
+ $sect_info{"append"} = $append;
+
+ } elsif (!exists $sect_info{"initrd"}) {
+ $sect_info{"initrd"} = $1;
+ }
}
- $sect_info{"append"} = $append;
- }
+ } else {
+
+ $sect_info{"type"} = "image";
+
+ if ($cfg2 =~ /^\s+linux\s+(\S+)\s*(.*)$/m) {
+ my $append = $2;
+ $sect_info{"image"} = $1;
+
+ if ($append =~ /root=/) {
+ $append =~ s/root=(\S+)\s*//;
+ $sect_info{"root"} = $1;
+ }
+
+ if ($append =~ /vga=/) {
+ $append =~ s/vga=(\S+)\s*//;
+ $sect_info{"vgamode"} = $1;
+ }
- if ($cfg2 =~ /^\s+initrd\s+([^\s]+)/m) {
- $sect_info{"initrd"} = $1;
+ $sect_info{"append"} = $append;
+ }
}
push @{$sect}, \%sect_info;
@@ -777,6 +810,10 @@
$ret{"gfxbackground"} = $val;
} elsif ($key =~ m/@?GRUB_DISABLE_OS_PROBER$/) {
$ret{"os_prober"} = ($val eq "true") ? "false" : "true";
+ } elsif ($key =~ m/@?GRUB_CMDLINE_XEN_DEFAULT$/) {
+ $ret{"xen_append"} = $val;
+ } elsif ($key =~ m/@?GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT$/) {
+ $ret{"xen_kernel_append"} = $val;
}
}
@@ -927,6 +964,8 @@
# my $root = delete $globinfo{"root"} || "";
my $vga = delete $globinfo{"vgamode"} || "";
my $append = delete $globinfo{"append"} || "";
+ my $xen_append = delete $globinfo{"xen_append"} || "";
+ my $xen_kernel_append = delete $globinfo{"xen_kernel_append"} || "";
# YaST doesn't save bootloader settings when 'Timeout in seconds' is set to 0 (bnc#804176)
my $timeout = delete $globinfo{"timeout"} || 0;
my $hiddenmenu = delete $globinfo{"hiddenmenu"} || "";
@@ -952,6 +991,27 @@
$hidden_timeout = "0" if "$hidden_timeout" ne "";
}
+ # bnc#862614 - serial console settings not propagated into xen entry
+ if ($append =~ /console=ttyS(\d+),(\w+)/)
+ {
+ # merge console and speed into xen_append
+ my $console = sprintf("com%d", $1+1);
+ my $speed = sprintf("%s=%s", $console, $2);
+
+ if ($xen_append ne "") {
+ while ($xen_append =~ s/(.*)console=(\S+)\s*(.*)$/$1$3/) {
+ my $del_console = $2;
+ $xen_append =~ s/(.*)${del_console}=\w+\s*(.*)$/$1$2/g;
+ }
+ $xen_append = "console=$console $speed $xen_append";
+ } else {
+ $xen_append = "console=$console $speed";
+ }
+
+ $xen_kernel_append = $append if ($xen_kernel_append eq "");
+ $xen_kernel_append =~ s/console=ttyS(\S+)\s*//g;
+ }
+
@lines = map {
my $line_ref = $_;
my $key = $line_ref->{"key"};
@@ -1017,6 +1077,12 @@
} elsif ($key =~ m/@?GRUB_DISABLE_OS_PROBER$/) {
$line_ref->{"value"} = ($os_prober eq "false") ? "true" : "false";
$os_prober = "";
+ } elsif ($key =~ m/@?GRUB_CMDLINE_XEN_DEFAULT$/) {
+ $line_ref->{"value"} = $xen_append if $xen_append ne "";
+ $xen_append = "";
+ } elsif ($key =~ m/@?GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT$/) {
+ $line_ref->{"value"} = $xen_kernel_append if $xen_kernel_append ne "";
+ $xen_kernel_append = "";
}
defined $line_ref ? $line_ref : ();
} @lines;
@@ -1097,6 +1163,20 @@
"value" => ($os_prober eq "false") ? "true" : "false",
}
}
+
+ if ($xen_append ne "") {
+ push @lines, {
+ "key" => "GRUB_CMDLINE_XEN_DEFAULT",
+ "value" => $xen_append,
+ }
+ }
+
+ if ($xen_kernel_append ne "") {
+ push @lines, {
+ "key" => "GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT",
+ "value" => $xen_kernel_append,
+ }
+ }
return \@lines;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.804/src/Core/GRUB2EFI.pm new/perl-Bootloader-0.805/src/Core/GRUB2EFI.pm
--- old/perl-Bootloader-0.804/src/Core/GRUB2EFI.pm 2014-02-17 13:15:59.000000000 +0100
+++ new/perl-Bootloader-0.805/src/Core/GRUB2EFI.pm 2014-02-27 11:53:07.000000000 +0100
@@ -80,7 +80,6 @@
$sect_info{"name"} = $name;
$sect_info{"menuentry"} = $name;
- $sect_info{"type"} = "image";
if ($args =~ m/'gnulinux-[^\s]+-recovery-[^\s]+'/) {
$sect_info{"usage"} = "linux_failsafe";
@@ -88,34 +87,72 @@
$sect_info{"usage"} = "linux";
}
- # bnc#824609 - installation boot parameters not written to GRUB_CMDLINE_LINUX_DEFAULT
- # we need to match linuxefi command, otherwise the kernel append will lost
- if ($cfg2 =~ /^\s+(linux|linuxefi)\s+([^\s]+)\s*(.*)$/m) {
- my $append = $3;
- $sect_info{"image"} = $2;
- my $command = $1;
-
- if ($append =~ /root=/) {
- $append =~ s/root=([^\s]+)\s*//;
- $sect_info{"root"} = $1;
- }
+ if ($args =~ m/--class xen/) {
- # the ro is part of linuxefi entries created by grub2 scripts
- # not part of kernel append by yast
- if ( $command eq "linuxefi" ) {
- $append =~ s/^ro\s*//;
- }
+ $sect_info{"type"} = "xen";
+
+ if ($cfg2 =~ /^\s+multiboot\s+(\S+)\s+\S+\s*(.*)$/m) {
+ $sect_info{"xen"} = $1;
+ $sect_info{"xen_append"} = $2;
+ }
+
+ while ($cfg2 =~ /^\s+module\s+(\S+)\s+\S+\s*(.*)$/gm) {
+
+ if (!exists $sect_info{"image"}) {
+
+ my $append = $2;
+ $sect_info{"image"} = $1;
+
+ if ($append =~ /root=/) {
+ $append =~ s/root=(\S+)\s*//;
+ $sect_info{"root"} = $1;
+ }
- if ($append =~ /vga=/) {
- $append =~ s/vga=([^\s]+)\s*//;
- $sect_info{"vgamode"} = $1;
+ if ($append =~ /vga=/) {
+ $append =~ s/vga=(\S+)\s*//;
+ $sect_info{"vgamode"} = $1;
+ }
+
+ $sect_info{"append"} = $append;
+
+ } elsif (!exists $sect_info{"initrd"}) {
+ $sect_info{"initrd"} = $1;
+ }
}
- $sect_info{"append"} = $append;
- }
+ } else {
+
+ $sect_info{"type"} = "image";
- if ($cfg2 =~ /^\s+(initrd|initrdefi)\s+([^\s]+)/m) {
- $sect_info{"initrd"} = $2;
+ # bnc#824609 - installation boot parameters not written to GRUB_CMDLINE_LINUX_DEFAULT
+ # we need to match linuxefi command, otherwise the kernel append will lost
+ if ($cfg2 =~ /^\s+(linux|linuxefi)\s+([^\s]+)\s*(.*)$/m) {
+ my $append = $3;
+ $sect_info{"image"} = $2;
+ my $command = $1;
+
+ if ($append =~ /root=/) {
+ $append =~ s/root=([^\s]+)\s*//;
+ $sect_info{"root"} = $1;
+ }
+
+ # the ro is part of linuxefi entries created by grub2 scripts
+ # not part of kernel append by yast
+ if ( $command eq "linuxefi" ) {
+ $append =~ s/^ro\s*//;
+ }
+
+ if ($append =~ /vga=/) {
+ $append =~ s/vga=([^\s]+)\s*//;
+ $sect_info{"vgamode"} = $1;
+ }
+
+ $sect_info{"append"} = $append;
+ }
+
+ if ($cfg2 =~ /^\s+(initrd|initrdefi)\s+([^\s]+)/m) {
+ $sect_info{"initrd"} = $2;
+ }
}
push @{$sect}, \%sect_info;
@@ -353,6 +390,10 @@
$ret{"gfxbackground"} = $val;
} elsif ($key =~ m/@?GRUB_DISABLE_OS_PROBER$/) {
$ret{"os_prober"} = ($val eq "true") ? "false" : "true";
+ } elsif ($key =~ m/@?GRUB_CMDLINE_XEN_DEFAULT$/) {
+ $ret{"xen_append"} = $val;
+ } elsif ($key =~ m/@?GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT$/) {
+ $ret{"xen_kernel_append"} = $val;
}
}
@@ -502,6 +543,8 @@
# my $root = delete $globinfo{"root"} || "";
my $vga = delete $globinfo{"vgamode"} || "";
my $append = delete $globinfo{"append"} || "";
+ my $xen_append = delete $globinfo{"xen_append"} || "";
+ my $xen_kernel_append = delete $globinfo{"xen_kernel_append"} || "";
# YaST doesn't save bootloader settings when 'Timeout in seconds' is set to 0 (bnc#804176)
my $timeout = delete $globinfo{"timeout"} || 0;
my $hiddenmenu = delete $globinfo{"hiddenmenu"} || "";
@@ -533,6 +576,27 @@
$use_linuxefi = $self->{secure_boot} ? "true" : "false";
}
+ # bnc#862614 - serial console settings not propagated into xen entry
+ if ($append =~ /console=ttyS(\d+),(\w+)/)
+ {
+ # merge console and speed into xen_append
+ my $console = sprintf("com%d", $1+1);
+ my $speed = sprintf("%s=%s", $console, $2);
+
+ if ($xen_append ne "") {
+ while ($xen_append =~ s/(.*)console=(\S+)\s*(.*)$/$1$3/) {
+ my $del_console = $2;
+ $xen_append =~ s/(.*)${del_console}=\w+\s*(.*)$/$1$2/g;
+ }
+ $xen_append = "console=$console $speed $xen_append";
+ } else {
+ $xen_append = "console=$console $speed";
+ }
+
+ $xen_kernel_append = $append if ($xen_kernel_append eq "");
+ $xen_kernel_append =~ s/console=ttyS(\S+)\s*//g;
+ }
+
@lines = map {
my $line_ref = $_;
my $key = $line_ref->{"key"};
@@ -601,7 +665,14 @@
} elsif ($key =~ m/@?GRUB_USE_LINUXEFI$/) {
$line_ref->{"value"} = "$use_linuxefi" if "$use_linuxefi" ne "";
$use_linuxefi = "";
+ } elsif ($key =~ m/@?GRUB_CMDLINE_XEN_DEFAULT$/) {
+ $line_ref->{"value"} = $xen_append if $xen_append ne "";
+ $xen_append = "";
+ } elsif ($key =~ m/@?GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT$/) {
+ $line_ref->{"value"} = $xen_kernel_append if $xen_kernel_append ne "";
+ $xen_kernel_append = "";
}
+
defined $line_ref ? $line_ref : ();
} @lines;
@@ -689,6 +760,19 @@
}
}
+ if ($xen_append ne "") {
+ push @lines, {
+ "key" => "GRUB_CMDLINE_XEN_DEFAULT",
+ "value" => $xen_append,
+ }
+ }
+
+ if ($xen_kernel_append ne "") {
+ push @lines, {
+ "key" => "GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT",
+ "value" => $xen_kernel_append,
+ }
+ }
return \@lines;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/perl-Bootloader-0.804/version new/perl-Bootloader-0.805/version
--- old/perl-Bootloader-0.804/version 2014-02-17 13:15:59.000000000 +0100
+++ new/perl-Bootloader-0.805/version 2014-02-27 11:53:07.000000000 +0100
@@ -1 +1 @@
-0.804
+0.805
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0
Hello community,
here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2014-03-01 14:38:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2 (Old)
and /work/SRC/openSUSE:Factory/.yast2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2"
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2014-02-21 13:48:11.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.yast2.new/yast2.changes 2014-03-01 14:38:15.000000000 +0100
@@ -1,0 +2,6 @@
+Thu Feb 27 09:56:16 UTC 2014 - vmoravec(a)suse.com
+
+- Add systemd socket support (bnc#853300)
+- 3.1.20
+
+-------------------------------------------------------------------
Old:
----
yast2-3.1.19.tar.bz2
New:
----
yast2-3.1.20.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2.spec ++++++
--- /var/tmp/diff_new_pack.3mv946/_old 2014-03-01 14:38:16.000000000 +0100
+++ /var/tmp/diff_new_pack.3mv946/_new 2014-03-01 14:38:16.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2
-Version: 3.1.19
+Version: 3.1.20
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ yast2-3.1.19.tar.bz2 -> yast2-3.1.20.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/Makefile.am new/yast2-3.1.20/library/Makefile.am
--- old/yast2-3.1.19/library/Makefile.am 2014-02-21 10:52:55.000000000 +0100
+++ new/yast2-3.1.20/library/Makefile.am 2014-02-27 10:56:49.000000000 +0100
@@ -1,3 +1,3 @@
# Makefile.am for yast2/library
-SUBDIRS = types runlevel sequencer xml commandline desktop wizard control cwm log system packages cron network gpg general
+SUBDIRS = types runlevel sequencer xml commandline desktop wizard control cwm log system packages cron network gpg general systemd
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/Makefile.am new/yast2-3.1.20/library/systemd/Makefile.am
--- old/yast2-3.1.19/library/systemd/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/Makefile.am 2014-02-27 10:56:49.000000000 +0100
@@ -0,0 +1 @@
+SUBDIRS = src test
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/src/Makefile.am new/yast2-3.1.20/library/systemd/src/Makefile.am
--- old/yast2-3.1.19/library/systemd/src/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/src/Makefile.am 2014-02-27 10:56:49.000000000 +0100
@@ -0,0 +1,11 @@
+module_DATA = \
+ modules/systemd_socket.rb
+
+ylibdir = @ylibdir@/yast2
+ylib_DATA = \
+ lib/yast2/systemctl.rb \
+ lib/yast2/systemd_unit.rb
+
+EXTRA_DIST = $(module_DATA) $(ylib_DATA)
+
+include $(top_srcdir)/Makefile.am.common
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/src/lib/yast2/systemctl.rb new/yast2-3.1.20/library/systemd/src/lib/yast2/systemctl.rb
--- old/yast2-3.1.19/library/systemd/src/lib/yast2/systemctl.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/src/lib/yast2/systemctl.rb 2014-02-27 10:56:49.000000000 +0100
@@ -0,0 +1,44 @@
+require "ostruct"
+
+module Yast
+ module Systemctl
+ CONTROL = "systemctl"
+ COMMAND_OPTIONS = " --no-legend --no-pager --no-ask-password "
+ ENV_VARS = " LANG=C TERM=dumb COLUMNS=1024 "
+ SYSTEMCTL = ENV_VARS + CONTROL + COMMAND_OPTIONS
+
+ class << self
+
+ def execute command
+ OpenStruct.new(SCR.Execute(Path.new(".target.bash_output"), SYSTEMCTL + command))
+ end
+
+ def socket_units
+ sockets_from_files = list_unit_files(:type=>:socket).lines.map do |line|
+ line[/\S+/]
+ end
+
+ sockets_from_units = list_units(:type=>:socket).lines.map do |line|
+ line[/\S+/]
+ end
+
+ ( sockets_from_files | sockets_from_units ).compact
+ end
+
+ private
+
+ def list_unit_files type: nil
+ command = " list-unit-files "
+ command << " --type=#{type} " if type
+ execute(command).stdout
+ end
+
+ def list_units type: nil, all: true
+ command = " list-units "
+ command << " --all " if all
+ command << " --type=#{type} " if type
+ execute(command).stdout
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/src/lib/yast2/systemd_unit.rb new/yast2-3.1.20/library/systemd/src/lib/yast2/systemd_unit.rb
--- old/yast2-3.1.19/library/systemd/src/lib/yast2/systemd_unit.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/src/lib/yast2/systemd_unit.rb 2014-02-27 10:56:49.000000000 +0100
@@ -0,0 +1,140 @@
+require 'yast2/systemctl'
+
+require 'ostruct'
+require 'forwardable'
+
+module Yast
+
+ ###
+ # Use this class always as a parent class for implementing various systemd units.
+ # Do not use it directly for add-hoc implemenation of systemd units.
+ #
+ # @example Create a systemd service unit
+ #
+ # class Service < Yast::SystemdUnit
+ # SUFFIX = ".service"
+ # PROPERTIES = {
+ # :before => "Before"
+ # }
+ #
+ # def initialize service_name, properties={}
+ # service_name += SUFFIX unless service_name.end_with?(SUFFIX)
+ # super(service_name, PROPERTIES.merge(properties))
+ # end
+ #
+ # def before
+ # properties.before.split
+ # end
+ # end
+ #
+ # service = Service.new('sshd')
+ #
+ # service.before # ['shutdown.target', 'multi-user.target']
+ #
+ ###
+
+ class SystemdUnit
+
+ SUPPORTED_TYPES = %w( service socket target )
+ SUPPORTED_STATES = %w( enabled disabled )
+
+ DEFAULT_PROPERTIES = {
+ id: "Id",
+ pid: "MainPID",
+ description: "Description",
+ load_state: "LoadState",
+ active_state: "ActiveState",
+ sub_state: "SubState",
+ unit_file_state: "UnitFileState",
+ path: "FragmentPath"
+ }
+
+ extend Forwardable
+
+ def_delegators :@properties, :id, :path,
+ :active?, :enabled?, :running?, :loaded?
+
+ attr_reader :unit_name, :unit_type, :input_properties, :errors, :properties
+
+ def initialize full_unit_name, properties={}
+ @unit_name, @unit_type = full_unit_name.split(".")
+ raise "Missing unit type suffix" unless unit_type
+ raise "Unsupported unit type '#{unit_type}'" unless SUPPORTED_TYPES.member?(unit_type)
+
+ @errors = ""
+ @input_properties = properties.merge!(DEFAULT_PROPERTIES)
+ @properties = show
+ end
+
+ def show
+ Properties.new(self)
+ end
+
+ def status
+ command("status", :options => "2>&1").stdout
+ end
+
+ def start
+ run_command! { command("start") }
+ end
+
+ def stop
+ run_command! { command("stop") }
+ end
+
+ def enable
+ run_command! { command("enable") }
+ end
+
+ def disable
+ run_command! { command("disable") }
+ end
+
+ def command command_name, options={}
+ Systemctl.execute("#{command_name} #{unit_name}.#{unit_type} #{options[:options]}")
+ end
+
+ private
+
+ def run_command!
+ errors.clear
+ command_result = yield
+ errors << command_result.stderr
+ @properties = show
+ command_result.exit.zero?
+ end
+
+ class Properties < OpenStruct
+
+ def initialize systemd_unit
+ super()
+ self[:systemd_unit] = systemd_unit
+ raw_properties = load_systemd_properties
+ self[:raw] = raw_properties.stdout
+ self[:errors] = raw_properties.stderr
+ extract_properties
+ self[:active?] = active_state == "active"
+ self[:running?] = sub_state == "running"
+ self[:loaded?] = load_state == "loaded"
+ self[:not_found?] = load_state == "not-found"
+ self[:enabled?] = unit_file_state == "enabled"
+ self[:supported?] = SUPPORTED_STATES.member?(unit_file_state)
+ end
+
+ private
+
+ def extract_properties
+ systemd_unit.input_properties.each do |name, property|
+ self[name] = raw[/#{property}=(.+)/, 1]
+ end
+ end
+
+ def load_systemd_properties
+ properties = systemd_unit.input_properties.map do |_, property_name|
+ " --property=#{property_name} "
+ end
+ systemd_unit.command("show", :options => properties.join)
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/src/modules/systemd_socket.rb new/yast2-3.1.20/library/systemd/src/modules/systemd_socket.rb
--- old/yast2-3.1.19/library/systemd/src/modules/systemd_socket.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/src/modules/systemd_socket.rb 2014-02-27 10:56:49.000000000 +0100
@@ -0,0 +1,79 @@
+require 'yast2/systemd_unit'
+
+module Yast
+ ###
+ # Systemd.socket unit control API
+ #
+ # @example How to use it in other yast libraries
+ #
+ # require 'yast'
+ #
+ # Yast.import 'SystemdSocket'
+ #
+ # ## Get a socket unit by its name
+ #
+ # socket = Yast::SystemdSocket.find('iscsid')
+ #
+ # ## Get basic unit properties
+ #
+ # socket.unit_name # 'iscsid'
+ # socket.unit_type # 'socket'
+ # socket.id # 'iscsid.socket'
+ # socket.path # '/usr/lib/systemd/system/iscsid.socket' => unit file path
+ # socket.loaded? # true if it's loaded, false otherwise
+ # socket.listening? # true if it's listening, false otherwise
+ # socket.enabled? # true if enabled, false otherwise
+ # socket.disabled? # true if disabled, false otherwise
+ # socket.status # the same string output you get with `systemctl status iscsid.socket`
+ # socket.show # equivalent of calling `systemctl show iscsid.socket`
+ #
+ # ## Socket unit file commands
+ #
+ # # Unit file commands do modifications on the socket unit. Calling them triggers
+ # # socket properties reloading. In case a command fails, the error messages are available
+ # # through the method #errors as a string.
+ #
+ # socket.start # true if unit has been activated successfully
+ # socket.stop # true if unit has been deactivated successfully
+ # socket.enable # true if unit has been enabled successfully
+ # socket.disable # true if unit has been disabled successfully
+ # socket.errors # error string available if some of the actions above fails
+ #
+ # ## Extended socket properties
+ #
+ # # In case you need more details about the socket unit than the default ones,
+ # # you can extend the paramters when getting the socket. Those properties are
+ # # then available under the #properties instance method. To get an overview of
+ # # available socket properties, try e.g., `systemctl show iscsid.socket`
+ #
+ # socket = Yast::SystemdSocket.find('iscsid', :can_start=>'CanStart', :triggers=>'Triggers')
+ # socket.properties.can_start # 'yes'
+ # socket.properties.triggers # 'iscsid.service'
+ #
+ ##
+
+ class SystemdSocketClass < Module
+ UNIT_SUFFIX = ".socket"
+
+ def find socket_name, properties={}
+ socket_name += UNIT_SUFFIX unless socket_name.end_with?(UNIT_SUFFIX)
+ socket = Socket.new(socket_name, properties)
+ return nil if socket.properties.not_found?
+ socket
+ end
+
+ def all properties={}
+ sockets = Systemctl.socket_units.map do |socket_unit|
+ Socket.new(socket_unit, properties)
+ end
+ sockets.select {|s| s.properties.supported?}
+ end
+
+ class Socket < SystemdUnit
+ def listening?
+ properties.sub_state == "listening"
+ end
+ end
+ end
+ SystemdSocket = SystemdSocketClass.new
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/test/Makefile.am new/yast2-3.1.20/library/systemd/test/Makefile.am
--- old/yast2-3.1.19/library/systemd/test/Makefile.am 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/test/Makefile.am 2014-02-27 10:56:49.000000000 +0100
@@ -0,0 +1,12 @@
+TESTS = \
+ test_helper.rb \
+ systemctl_test.rb \
+ systemd_unit_test.rb \
+ systemd_socket_test.rb
+
+TEST_EXTENSIONS = .rb
+RB_LOG_COMPILER = rspec
+VERBOSE = 1
+
+EXTRA_DIST = $(TESTS)
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/test/data/iscsid_socket_properties new/yast2-3.1.20/library/systemd/test/data/iscsid_socket_properties
--- old/yast2-3.1.19/library/systemd/test/data/iscsid_socket_properties 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/test/data/iscsid_socket_properties 2014-02-27 10:56:49.000000000 +0100
@@ -0,0 +1,119 @@
+Id=iscsid.socket
+Names=iscsid.socket
+Requires=sysinit.target
+Wants=system.slice
+Conflicts=shutdown.target
+Before=iscsid.service sockets.target shutdown.target
+After=sysinit.target system.slice
+Triggers=iscsid.service
+Documentation=man:iscsid(8) man:iscsiadm(8)
+Description=Open-iSCSI iscsid Socket
+LoadState=loaded
+ActiveState=active
+SubState=listening
+FragmentPath=/usr/lib/systemd/system/iscsid.socket
+UnitFileState=disabled
+InactiveExitTimestamp=Tue 2014-02-18 11:24:48 CET
+InactiveExitTimestampMonotonic=504143880115
+ActiveEnterTimestamp=Tue 2014-02-18 11:24:48 CET
+ActiveEnterTimestampMonotonic=504143880115
+ActiveExitTimestampMonotonic=0
+InactiveEnterTimestampMonotonic=0
+CanStart=yes
+CanStop=yes
+CanReload=no
+CanIsolate=no
+StopWhenUnneeded=no
+RefuseManualStart=no
+RefuseManualStop=no
+AllowIsolate=no
+DefaultDependencies=yes
+OnFailureIsolate=no
+IgnoreOnIsolate=no
+IgnoreOnSnapshot=no
+NeedDaemonReload=no
+JobTimeoutUSec=0
+ConditionTimestamp=Tue 2014-02-18 11:24:48 CET
+ConditionTimestampMonotonic=504143880077
+ConditionResult=yes
+Transient=no
+Slice=system.slice
+ControlGroup=/system.slice/iscsid.socket
+BindIPv6Only=default
+Backlog=128
+TimeoutUSec=1min 30s
+ControlPID=0
+DirectoryMode=0755
+SocketMode=0666
+Accept=no
+KeepAlive=no
+Priority=-1
+ReceiveBuffer=0
+SendBuffer=0
+IPTOS=-1
+IPTTL=-1
+PipeSize=0
+FreeBind=no
+Transparent=no
+Broadcast=no
+PassCredentials=no
+PassSecurity=no
+ListenStream=@ISCSIADM_ABSTRACT_NAMESPACE
+Mark=-1
+MaxConnections=64
+NConnections=0
+NAccepted=0
+Result=success
+ReusePort=no
+UMask=0022
+LimitCPU=18446744073709551615
+LimitFSIZE=18446744073709551615
+LimitDATA=18446744073709551615
+LimitSTACK=18446744073709551615
+LimitCORE=18446744073709551615
+LimitRSS=18446744073709551615
+LimitNOFILE=4096
+LimitAS=18446744073709551615
+LimitNPROC=7770
+LimitMEMLOCK=65536
+LimitLOCKS=18446744073709551615
+LimitSIGPENDING=7770
+LimitMSGQUEUE=819200
+LimitNICE=0
+LimitRTPRIO=0
+LimitRTTIME=18446744073709551615
+OOMScoreAdjust=0
+Nice=0
+IOScheduling=0
+CPUSchedulingPolicy=0
+CPUSchedulingPriority=0
+TimerSlackNSec=50000
+CPUSchedulingResetOnFork=no
+NonBlocking=no
+StandardInput=null
+StandardOutput=journal
+StandardError=inherit
+TTYReset=no
+TTYVHangup=no
+TTYVTDisallocate=no
+SyslogPriority=30
+SyslogLevelPrefix=yes
+SecureBits=0
+CapabilityBoundingSet=18446744073709551615
+MountFlags=0
+PrivateTmp=no
+PrivateNetwork=no
+SameProcessGroup=no
+IgnoreSIGPIPE=yes
+NoNewPrivileges=no
+KillMode=control-group
+KillSignal=15
+SendSIGKILL=yes
+SendSIGHUP=no
+CPUAccounting=no
+CPUShares=1024
+BlockIOAccounting=no
+BlockIOWeight=1000
+MemoryAccounting=no
+MemoryLimit=18446744073709551615
+DevicePolicy=auto
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/test/systemctl_test.rb new/yast2-3.1.20/library/systemd/test/systemctl_test.rb
--- old/yast2-3.1.19/library/systemd/test/systemctl_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/test/systemctl_test.rb 2014-02-27 10:56:49.000000000 +0100
@@ -0,0 +1,23 @@
+#!/usr/bin/env rspec
+
+require_relative 'test_helper'
+require 'yast2/systemctl'
+
+module Yast
+ describe Systemctl do
+ include SystemctlStubs
+
+ before do
+ stub_systemctl
+ end
+
+ describe ".socket_units" do
+ it "returns a list of socket unit ids registered with systemd" do
+ socket_units = Systemctl.socket_units
+ expect(socket_units).to be_a(Array)
+ expect(socket_units).not_to be_empty
+ socket_units.each {|u| expect(u).to match(/.socket$/) }
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/test/systemd_socket_test.rb new/yast2-3.1.20/library/systemd/test/systemd_socket_test.rb
--- old/yast2-3.1.19/library/systemd/test/systemd_socket_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/test/systemd_socket_test.rb 2014-02-27 10:56:49.000000000 +0100
@@ -0,0 +1,46 @@
+#!/usr/bin/env rspec
+
+require_relative "test_helper"
+
+module Yast
+ import 'SystemdSocket'
+
+ describe SystemdSocket do
+ include SystemdSocketStubs
+
+ before do
+ stub_sockets
+ end
+
+ describe ".find" do
+ it "returns the unit object specified in parameter" do
+ socket = SystemdSocket.find "iscsid"
+ expect(socket).to be_a(SystemdUnit)
+ expect(socket.unit_type).to eq("socket")
+ expect(socket.unit_name).to eq("iscsid")
+ end
+ end
+
+ describe ".all" do
+ it "returns all supported sockets found" do
+ sockets = SystemdSocket.all
+ expect(sockets).to be_a(Array)
+ expect(sockets).not_to be_empty
+ sockets.each {|s| expect(s.unit_type).to eq('socket')}
+ end
+ end
+
+ describe "#listening?" do
+ it "returns true if the socket is accepting connections" do
+ socket = SystemdSocket.find "iscsid"
+ expect(socket.listening?).to be_true
+ end
+
+ it "returns false if the socket is dead" do
+ socket = SystemdSocket.find "iscsid"
+ socket.properties.sub_state = "dead"
+ expect(socket.listening?).to be_false
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/test/systemd_unit_test.rb new/yast2-3.1.20/library/systemd/test/systemd_unit_test.rb
--- old/yast2-3.1.19/library/systemd/test/systemd_unit_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/test/systemd_unit_test.rb 2014-02-27 10:56:49.000000000 +0100
@@ -0,0 +1,195 @@
+#!/usr/bin/env rspec
+
+require_relative 'test_helper'
+require 'yast2/systemd_unit'
+
+module Yast
+ describe SystemdUnit do
+ include SystemdSocketStubs
+
+ def trigger_reloading_properties command
+ unit = SystemdUnit.new("new.socket")
+ properties = unit.properties
+ unit.send(command)
+ expect(unit.properties).not_to equal(properties)
+ end
+
+ before do
+ stub_sockets
+ end
+
+ describe "#properties" do
+ it "always returns struct including default properties" do
+ unit = SystemdUnit.new("iscsi.socket")
+ expect(unit.properties.to_h.keys).to include(*SystemdUnit::DEFAULT_PROPERTIES.keys)
+ end
+
+ it "provides status properties methods" do
+ unit = SystemdUnit.new("iscsid.socket")
+ expect(unit.properties[:enabled?]).not_to be_nil
+ expect(unit.properties[:active?]).not_to be_nil
+ expect(unit.properties[:running?]).not_to be_nil
+ expect(unit.properties[:loaded?]).not_to be_nil
+ expect(unit.properties[:supported?]).not_to be_nil
+ expect(unit.properties[:not_found?]).not_to be_nil
+ expect(unit.properties[:path]).not_to be_nil
+ expect(unit.properties[:errors]).not_to be_nil
+ expect(unit.properties[:raw]).not_to be_nil
+ end
+
+ it "delegates the status properties onto the unit object" do
+ unit = SystemdUnit.new("iscsid.socket")
+ expect(unit).to respond_to(:enabled?)
+ expect(unit).to respond_to(:active?)
+ expect(unit).to respond_to(:running?)
+ expect(unit).to respond_to(:loaded?)
+ expect(unit).to respond_to(:path)
+ end
+ end
+
+ describe ".new" do
+ it "creates a new SystemdUnit instance with unit name and type parsed from first parameter" do
+ instance = SystemdUnit.new("random.socket")
+ expect { SystemdUnit.new("random.socket") }.not_to raise_error
+ expect(instance.unit_name).to eq("random")
+ expect(instance.unit_type).to eq("socket")
+ end
+
+ it "raises an exception if an incomplete unit name is passed" do
+ expect { SystemdUnit.new("sshd") }.to raise_error
+ end
+
+ it "allows to create supported units" do
+ expect { SystemdUnit.new("my.socket") }.not_to raise_error
+ expect { SystemdUnit.new("default.target") }.not_to raise_error
+ expect { SystemdUnit.new("sshd.service") }.not_to raise_error
+ end
+
+ it "raises an exception if unsupported unit name is passed" do
+ expect { SystemdUnit.new("random.unit") }.to raise_error
+ end
+
+ it "accepts parameters to extend the default properties" do
+ unit = SystemdUnit.new("iscsid.socket", :requires => "Requires", :wants => "Wants")
+ expect(unit.properties.wants).not_to be_nil
+ expect(unit.properties.requires).not_to be_nil
+ end
+ end
+
+ describe "#stop" do
+ it "returns true if unit has been stopped" do
+ stub_unit_command
+ unit = SystemdUnit.new("my.socket")
+ expect(unit.stop).to be_true
+ end
+
+ it "returns false if failed" do
+ stub_unit_command(:success=>false)
+ unit = SystemdUnit.new("my.socket")
+ expect(unit.stop).to be_false
+ expect(unit.errors).not_to be_empty
+ end
+
+ it "triggers reloading of unit properties" do
+ trigger_reloading_properties(:stop)
+ end
+ end
+
+ describe "#start" do
+ it "returns true if starts (activates) the unit" do
+ stub_unit_command(:success=>true)
+ unit = SystemdUnit.new("my.socket")
+ expect(unit.start).to be_true
+ end
+
+ it "returns false if failed to start the unit" do
+ stub_unit_command(:success=>false)
+ unit = SystemdUnit.new("my.socket")
+ expect(unit.start).to be_false
+ expect(unit.errors).not_to be_empty
+ end
+
+ it "triggers reloading of unit properties" do
+ trigger_reloading_properties(:start)
+ end
+ end
+
+ describe "#enable" do
+ it "returns true if the unit has been enabled successfully" do
+ stub_unit_command(:success=>true)
+ unit = SystemdUnit.new("your.socket")
+ expect(unit.enable).to be_true
+ end
+
+ it "returns false if unit fails" do
+ stub_unit_command(:success=>false)
+ unit = SystemdUnit.new("your.socket")
+ expect(unit.enable).to be_false
+ end
+
+ it "triggers reloading of unit properties" do
+ trigger_reloading_properties(:enable)
+ end
+ end
+
+ describe "#disable" do
+ it "returns true if the unit has been disabled successfully" do
+ stub_unit_command(:success=>true)
+ unit = SystemdUnit.new("your.socket")
+ expect(unit.disable).to be_true
+ end
+
+ it "returns false if unit disabling fails" do
+ stub_unit_command(:success=>false)
+ unit = SystemdUnit.new("your.socket")
+ expect(unit.disable).to be_false
+ end
+
+ it "triggers reloading of unit properties" do
+ trigger_reloading_properties(:disable)
+ end
+ end
+
+ describe "#show" do
+ it "always returns new unit properties object" do
+ unit = SystemdUnit.new("startrek.socket")
+ expect(unit.show).not_to equal(unit.show)
+ end
+ end
+
+ describe "#errors" do
+ it "returns empty string if the unit commands succeed" do
+ stub_unit_command(:success=>true)
+ unit = SystemdUnit.new("your.socket")
+ unit.start
+ expect(unit.errors).to be_empty
+
+ unit.stop
+ expect(unit.errors).to be_empty
+
+ unit.enable
+ expect(unit.errors).to be_empty
+
+ unit.disable
+ expect(unit.errors).to be_empty
+ end
+
+ it "returns error string if the unit commands fail" do
+ stub_unit_command(:success=>false)
+ unit = SystemdUnit.new("your.socket")
+ unit.start
+ expect(unit.errors).not_to be_empty
+
+ unit.stop
+ expect(unit.errors).not_to be_empty
+
+ unit.enable
+ expect(unit.errors).not_to be_empty
+
+ unit.disable
+ expect(unit.errors).not_to be_empty
+ end
+ end
+
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/library/systemd/test/test_helper.rb new/yast2-3.1.20/library/systemd/test/test_helper.rb
--- old/yast2-3.1.19/library/systemd/test/test_helper.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-3.1.20/library/systemd/test/test_helper.rb 2014-02-27 10:56:49.000000000 +0100
@@ -0,0 +1,91 @@
+require 'rspec'
+
+ENV["Y2DIR"] = File.expand_path("../../src", __FILE__)
+
+require "yast"
+
+module SystemctlStubs
+
+ def stub_systemctl
+ stub_socket_unit_files
+ stub_socket_units
+ stub_execute
+ end
+
+
+ def stub_execute success: true
+ Yast::Systemctl.stub(:execute).and_return(
+ OpenStruct.new \
+ :stdout => 'success',
+ :stderr => ( success ? '' : 'failure'),
+ :exit => ( success ? 0 : 1 )
+ )
+ end
+
+ def stub_socket_unit_files
+ Yast::Systemctl.stub(:list_unit_files).and_return(<<LIST
+iscsid.socket disabled
+avahi-daemon.socket enabled
+cups.socket enabled
+dbus.socket static
+dm-event.socket disabled
+LIST
+ )
+ end
+
+ def stub_socket_units
+ Yast::Systemctl.stub(:list_units).and_return(<<LIST
+iscsid.socket loaded active listening Open-iSCSI iscsid Socket
+avahi-daemon.socket loaded active running Avahi mDNS/DNS-SD Stack Activation Socket
+cups.socket loaded inactive dead CUPS Printing Service Sockets
+dbus.socket loaded active running D-Bus System Message Bus Socket
+dm-event.socket loaded inactive dead Device-mapper event daemon FIFOs
+lvm2-lvmetad.socket loaded inactive dead LVM2 metadata daemon socket
+pcscd.socket loaded active listening PC/SC Smart Card Daemon Activation Socket
+LIST
+ )
+ end
+
+end
+
+module SystemdUnitStubs
+ def stub_unit_command success: true
+ Yast::SystemdUnit
+ .any_instance
+ .stub(:command)
+ .and_return(
+ OpenStruct.new \
+ :stdout => 'success',
+ :stderr => ( success ? '' : 'failure'),
+ :exit => ( success ? 0 : 1 )
+ )
+ end
+end
+
+module SystemdSocketStubs
+ include SystemctlStubs
+ include SystemdUnitStubs
+
+ def socket_properties
+ @properties ||= OpenStruct.new(
+ :stdout => File.read(File.join(__dir__, 'data', 'iscsid_socket_properties')),
+ :stderr => '',
+ :exit => 0
+ )
+ end
+
+ def stub_sockets
+ stub_unit_command
+ stub_systemctl
+ stub_socket_properties
+ end
+
+ def stub_socket_properties
+ Yast::SystemdUnit::Properties
+ .any_instance
+ .stub(:load_systemd_properties)
+ .and_return(socket_properties)
+ end
+
+end
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/package/yast2.changes new/yast2-3.1.20/package/yast2.changes
--- old/yast2-3.1.19/package/yast2.changes 2014-02-21 10:52:55.000000000 +0100
+++ new/yast2-3.1.20/package/yast2.changes 2014-02-27 11:06:54.000000000 +0100
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Feb 27 09:56:16 UTC 2014 - vmoravec(a)suse.com
+
+- Add systemd socket support (bnc#853300)
+- 3.1.20
+
+-------------------------------------------------------------------
Mon Feb 10 13:18:52 UTC 2014 - lslezak(a)suse.cz
- added memory detection code (gh#yast/yast-packager#33)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.19/package/yast2.spec new/yast2-3.1.20/package/yast2.spec
--- old/yast2-3.1.19/package/yast2.spec 2014-02-21 10:52:55.000000000 +0100
+++ new/yast2-3.1.20/package/yast2.spec 2014-02-27 11:06:54.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2
-Version: 3.1.19
+Version: 3.1.20
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org
1
0