Hello community,

here is the log from the commit of package yast2-bootloader for 
openSUSE:Factory checked in at 2015-09-19 06:54:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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        
2015-08-28 08:24:59.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-bootloader.new/yast2-bootloader.changes   
2015-09-19 06:54:10.000000000 +0200
@@ -1,0 +2,45 @@
+Wed Sep 16 08:12:28 UTC 2015 - jreidin...@suse.com
+
+- support custom names for raids (bnc#944041)
+- 3.1.151
+
+-------------------------------------------------------------------
+Tue Sep 15 12:05:28 UTC 2015 - jreidin...@suse.com
+
+- make default distributor value empty to use default one in grub2
+  (bnc#942519)
+- remove distributor entry from ui. Support only changes in text
+  file
+- 3.1.150
+
+-------------------------------------------------------------------
+Tue Sep 15 12:04:28 UTC 2015 - jreidin...@suse.com
+
+- fix typo when invalid architecture is used (bnc#945764)
+- Do not propose bootloader stage1 location for grub2 on EFI
+  (bnc#945764)
+- 3.1.149
+
+-------------------------------------------------------------------
+Fri Sep 11 16:46:11 UTC 2015 - an...@suse.com
+
+- Empty kernel command lines are now properly written (bnc#945479)
+- 3.1.148
+
+-------------------------------------------------------------------
+Thu Sep 10 14:45:51 CEST 2015 - sch...@suse.de
+
+- AutoYaST configuration: Initialize libstorage and do not regard
+  the installed system.
+  (bnc#942360)
+- 3.1.147
+
+-------------------------------------------------------------------
+Fri Sep  4 15:17:27 CEST 2015 - snw...@suse.de
+
+- ensure device map has really been proposed (bsc#943749)
+- when we switch to custom boot, turn off the other boot locations
+  (bsc#943749)
+- 3.1.146
+
+-------------------------------------------------------------------

Old:
----
  yast2-bootloader-3.1.145.tar.bz2

New:
----
  yast2-bootloader-3.1.151.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.5XIjY6/_old  2015-09-19 06:54:11.000000000 +0200
+++ /var/tmp/diff_new_pack.5XIjY6/_new  2015-09-19 06:54:11.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        3.1.145
+Version:        3.1.151
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-bootloader-3.1.145.tar.bz2 -> yast2-bootloader-3.1.151.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.145/package/yast2-bootloader.changes 
new/yast2-bootloader-3.1.151/package/yast2-bootloader.changes
--- old/yast2-bootloader-3.1.145/package/yast2-bootloader.changes       
2015-08-27 15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/package/yast2-bootloader.changes       
2015-09-16 13:02:09.000000000 +0200
@@ -1,4 +1,49 @@
 -------------------------------------------------------------------
+Wed Sep 16 08:12:28 UTC 2015 - jreidin...@suse.com
+
+- support custom names for raids (bnc#944041)
+- 3.1.151
+
+-------------------------------------------------------------------
+Tue Sep 15 12:05:28 UTC 2015 - jreidin...@suse.com
+
+- make default distributor value empty to use default one in grub2
+  (bnc#942519)
+- remove distributor entry from ui. Support only changes in text
+  file
+- 3.1.150
+
+-------------------------------------------------------------------
+Tue Sep 15 12:04:28 UTC 2015 - jreidin...@suse.com
+
+- fix typo when invalid architecture is used (bnc#945764)
+- Do not propose bootloader stage1 location for grub2 on EFI
+  (bnc#945764)
+- 3.1.149
+
+-------------------------------------------------------------------
+Fri Sep 11 16:46:11 UTC 2015 - an...@suse.com
+
+- Empty kernel command lines are now properly written (bnc#945479)
+- 3.1.148
+
+-------------------------------------------------------------------
+Thu Sep 10 14:45:51 CEST 2015 - sch...@suse.de
+
+- AutoYaST configuration: Initialize libstorage and do not regard
+  the installed system.
+  (bnc#942360)
+- 3.1.147
+
+-------------------------------------------------------------------
+Fri Sep  4 15:17:27 CEST 2015 - snw...@suse.de
+
+- ensure device map has really been proposed (bsc#943749)
+- when we switch to custom boot, turn off the other boot locations
+  (bsc#943749)
+- 3.1.146
+
+-------------------------------------------------------------------
 Thu Aug 27 13:21:25 UTC 2015 - jreidin...@suse.com
 
 - use extended partition to boot even for non software raids
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.145/package/yast2-bootloader.spec 
new/yast2-bootloader-3.1.151/package/yast2-bootloader.spec
--- old/yast2-bootloader-3.1.145/package/yast2-bootloader.spec  2015-08-27 
15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/package/yast2-bootloader.spec  2015-09-16 
13:02:09.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        3.1.145
+Version:        3.1.151
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.145/src/include/bootloader/grub2/dialogs.rb 
new/yast2-bootloader-3.1.151/src/include/bootloader/grub2/dialogs.rb
--- old/yast2-bootloader-3.1.145/src/include/bootloader/grub2/dialogs.rb        
2015-08-27 15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/src/include/bootloader/grub2/dialogs.rb        
2015-09-16 13:02:09.000000000 +0200
@@ -27,6 +27,7 @@
       Yast.import "CWM"
       Yast.import "CWMTab"
       Yast.import "BootCommon"
+      Yast.import "BootStorage"
       Yast.import "Stage"
 
       Yast.include include_target, "bootloader/grub2/options.rb"
@@ -45,7 +46,7 @@
 
       legacy_intel = (Arch.x86_64 || Arch.i386) && lt != "grub2-efi"
       pmbr_available = lt == "grub2-efi" || (legacy_intel && gpt_boot_disk?)
-      widget_names = ["distributor", "loader_type", "loader_location"]
+      widget_names = ["loader_type", "loader_location"]
       widget_names << "activate" << "generic_mbr" if legacy_intel
       widget_names << "inst_details" if legacy_intel || Arch.ppc
       widget_names << "pmbr" if pmbr_available
@@ -63,7 +64,6 @@
               Arch.s390 || Arch.aarch64 ? Empty() : "loader_location"
             )
           ),
-          MarginBox(1, 0.5, "distributor"),
           MarginBox(1, 0.5, Left("activate")),
           MarginBox(1, 0.5, Left("generic_mbr")),
           MarginBox(1, 0.5, Left("pmbr")),
@@ -245,7 +245,7 @@
           Id("boot_custom_list"),
           # TRANSLATORS: place where boot code is installed
           _("Boot &Loader Location"),
-          prep_partitions
+          BootStorage.prep_partitions
         )
       )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.145/src/include/bootloader/grub2/helps.rb 
new/yast2-bootloader-3.1.151/src/include/bootloader/grub2/helps.rb
--- old/yast2-bootloader-3.1.145/src/include/bootloader/grub2/helps.rb  
2015-08-27 15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/src/include/bootloader/grub2/helps.rb  
2015-09-16 13:02:09.000000000 +0200
@@ -20,29 +20,25 @@
       textdomain "bootloader"
 
       @grub2_help_messages = {
-        "append"       => _(
+        "append"    => _(
           "<p><b>Optional Kernel Command Line Parameter</b> lets you define 
additional parameters to pass to the kernel.</p>"
         ),
-        "vgamode"      => _(
+        "vgamode"   => _(
           "<p><b>Vga Mode</b> defines the VGA mode the kernel should set the 
<i>console</i> to when booting.</p>"
         ),
-        "os_prober"    => _(
+        "os_prober" => _(
           "<p><b>Probe Foreign OS</b> by means of os-prober for multiboot with 
other foreign distribution </p>"
         ),
-        "pmbr"         => _(
+        "pmbr"      => _(
           "<p><b>Protective MBR flag</b> is expert only settings, that is 
needed only on exotic hardware. For details see Protective MBR in GPT disks. Do 
not touch if you are not sure.</p>"
-        ),
-        "distribution" => _(
-          "<p><b>Distributor</b> specifies name of distributor of kernel used 
to create boot entry name. </p>"
         )
       }
 
       @grub2_descriptions = {
-        "append"      => _("O&ptional Kernel Command Line Parameter"),
-        "distributor" => _("D&istributor"),
-        "vgamode"     => _("&Vga Mode"),
-        "os_prober"   => _("Probe Foreign OS"),
-        "pmbr"        => _("Protective MBR flag")
+        "append"    => _("O&ptional Kernel Command Line Parameter"),
+        "vgamode"   => _("&Vga Mode"),
+        "os_prober" => _("Probe Foreign OS"),
+        "pmbr"      => _("Protective MBR flag")
       }
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.145/src/include/bootloader/grub2/options.rb 
new/yast2-bootloader-3.1.151/src/include/bootloader/grub2/options.rb
--- old/yast2-bootloader-3.1.145/src/include/bootloader/grub2/options.rb        
2015-08-27 15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/src/include/bootloader/grub2/options.rb        
2015-09-16 13:02:09.000000000 +0200
@@ -339,10 +339,6 @@
 
     def Grub2Options
       grub2_specific = {
-        "distributor" => CommonInputFieldWidget(
-          Ops.get(@grub2_descriptions, "distributor", "Distributor"),
-          Ops.get(@grub2_help_messages, "distributor", "")
-        ),
         "activate"    => CommonCheckboxWidget(
           Ops.get(@grub_descriptions, "activate", "activate"),
           Ops.get(@grub_help_messages, "activate", "")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.145/src/include/bootloader/routines/lilolike.rb 
new/yast2-bootloader-3.1.151/src/include/bootloader/routines/lilolike.rb
--- old/yast2-bootloader-3.1.145/src/include/bootloader/routines/lilolike.rb    
2015-08-27 15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/src/include/bootloader/routines/lilolike.rb    
2015-09-16 13:02:09.000000000 +0200
@@ -67,7 +67,8 @@
     # FIXME: replace with grub_ConfigureLocation() when lilo et al. have
     # changed to stop using selected_location and loader_device.
     def ConfigureLocation
-      ::Bootloader::Stage1.new.propose.to_s
+      # configure stage1 only on non-EFI systems
+      ::Bootloader::Stage1.new.propose.to_s if Yast::Bootloader.getLoaderType 
== "grub2"
     end
 
     # Detect /boot and / (root) partition devices
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.145/src/include/bootloader/routines/misc.rb 
new/yast2-bootloader-3.1.151/src/include/bootloader/routines/misc.rb
--- old/yast2-bootloader-3.1.145/src/include/bootloader/routines/misc.rb        
2015-08-27 15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/src/include/bootloader/routines/misc.rb        
2015-09-16 13:02:09.000000000 +0200
@@ -185,6 +185,8 @@
     # @return [String] new kernel command line
     def setKernelParamToLine(line, key, values)
       line ||= ""
+      # bnc#945479, see last line of this method
+      line = "" if line == '""'
       # FIXME: this doesn't work with quotes and spaces
       params = line.split(" ").reject(&:empty?)
       # count occurences of every parameter, initial value is 0
@@ -222,7 +224,8 @@
           end
         end
       end
-      params.join(" ")
+      # bnc#945479 perl-bootloader does not cope well with empty strings
+      params.empty? ? '""' : params.join(" ")
     end
 
     # Rewrite current MBR with /var/lib/YaST2/backup_boot_sectors/%device
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.145/src/lib/bootloader/grub2base.rb 
new/yast2-bootloader-3.1.151/src/lib/bootloader/grub2base.rb
--- old/yast2-bootloader-3.1.145/src/lib/bootloader/grub2base.rb        
2015-08-27 15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/src/lib/bootloader/grub2base.rb        
2015-09-16 13:02:09.000000000 +0200
@@ -123,13 +123,7 @@
 
       BootCommon.globals["append"]          ||= 
BootArch.DefaultKernelParams(resume)
       BootCommon.globals["failsafe_disabled"] = "true" if 
BootCommon.globals["failsafe_disabled"].nil?
-      # long name doesn't fit 800x600 GRUB screens, using short name by default
-      # (bnc#873675)
-      BootCommon.globals["distributor"]     ||= Product.short_name
-      if !BootCommon.globals["distributor"] ||
-          BootCommon.globals["distributor"].empty?
-        BootCommon.globals["distributor"]     = Product.name
-      end
+      BootCommon.globals["distributor"]     ||= ""
 
       # Propose bootloader serial settings from kernel cmdline during install 
(bnc#862388)
       serial = BootCommon.GetSerialFromAppend
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.145/src/lib/bootloader/proposal_client.rb 
new/yast2-bootloader-3.1.151/src/lib/bootloader/proposal_client.rb
--- old/yast2-bootloader-3.1.145/src/lib/bootloader/proposal_client.rb  
2015-08-27 15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/src/lib/bootloader/proposal_client.rb  
2015-09-16 13:02:09.000000000 +0200
@@ -129,10 +129,6 @@
           )
           Yast::Bootloader.blRead(true, true)
           Yast::BootCommon.was_read = true
-          # update the product name
-          prod = Yast::Product.short_name
-          Yast::BootCommon.globals["distributor"] = prod
-          log.info "grub2 menu entry = #{prod}"
         end
       elsif old_bootloader == "none"
         log.info "Bootloader not configured, do not repropose"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.145/src/lib/bootloader/stage1.rb 
new/yast2-bootloader-3.1.151/src/lib/bootloader/stage1.rb
--- old/yast2-bootloader-3.1.145/src/lib/bootloader/stage1.rb   2015-08-27 
15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/src/lib/bootloader/stage1.rb   2015-09-16 
13:02:09.000000000 +0200
@@ -9,8 +9,10 @@
     include Yast::Logger
 
     def initialize
+      Yast.import "Arch"
       Yast.import "BootCommon"
       Yast.import "BootStorage"
+      Yast.import "Kernel"
       Yast.import "Storage"
     end
 
@@ -23,6 +25,25 @@
     # existing values of the output variables (which are respected at other 
times, in AutoYaST).
     # @see for keys in globals to 
https://old-en.opensuse.org/YaST/Bootloader_API#global_options_in_map
     def propose
+      result = case Yast::Arch.architecture
+        when "i386", "x86_64"
+          propose_x86
+        when /ppc/
+          propose_ppc
+        when /s390/
+          propose_s390
+        else
+          raise "unsuported architecture #{Yast::Arch.architecture}"
+        end
+
+      log.info "location configured. Resulting globals 
#{Yast::BootCommon.globals}"
+
+      result
+    end
+
+  private
+
+    def propose_x86
       selected_location = propose_boot_location
       log.info "grub_ConfigureLocation (#{selected_location} on 
#{Yast::BootCommon.GetBootloaderDevices})"
 
@@ -50,12 +71,32 @@
       # for GPT remove protective MBR flag otherwise some systems won't boot
       Yast::BootCommon.pmbr_action = :remove if gpt_boot_disk?
 
-      log.info "location configured. Resulting globals 
#{Yast::BootCommon.globals}"
+      selected_location
+    end
+
+    def propose_s390
+      # s390 do not need any partition as it is stored to predefined zipl 
location
+      selected_location = :none
+      assign_bootloader_device(selected_location)
 
       selected_location
     end
 
-  private
+    def propose_ppc
+      partition = Yast::BootStorage.prep_partitions.first
+      if partition
+        assign_bootloader_device([:custom, partition])
+
+        return :custom
+      # handle diskless setup, in such case do not write boot code anywhere 
(bnc#874466)
+      # we need to detect what is mount on /boot and if it is nfs, then just
+      # skip this proposal. In other case if it is not nfs, then it is error 
and raise exception
+      elsif Yast::BootCommon.getBootDisk == "/dev/nfs"
+        return :none
+      else
+        raise "there is no prep partition"
+      end
+    end
 
     def propose_boot_location
       raise "Boot partition disk not found" if boot_partition_disk.empty?
@@ -149,8 +190,11 @@
     # automatic anyway and perl-Bootloader should be able to make it without 
help
     # from the user or the proposal.
     #
-    # @param [Symbol] selected_location symbol one of `boot `root `mbr 
`extended `mbr_md `none
+    # @param [Symbol, Array] selected_location symbol one of :boot, :root, 
:mbr,
+    #   :extended, `none or Array with first value :custom and second device 
for
+    #   custom devices
     def assign_bootloader_device(selected_location)
+      log.info "assign bootloader device '#{selected_location.inspect}'"
       # first, default to all off:
       ["boot_boot", "boot_root", "boot_mbr", "boot_extended"].each do |flag|
         Yast::BootCommon.globals[flag] = "false"
@@ -168,6 +212,12 @@
         Yast::BootCommon.globals["generic_mbr"] = "false"
       when :none
         log.info "Resetting bootloader device"
+      when Array
+        if selected_location.first != :custom
+          raise "Unknown value to select bootloader device 
#{selected_location.inspect}"
+        end
+
+        Yast::BootCommon.globals["boot_custom"] = selected_location[1]
       else
         raise "Unknown value to select bootloader device 
#{selected_location.inspect}"
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.145/src/lib/bootloader/udev_mapping.rb 
new/yast2-bootloader-3.1.151/src/lib/bootloader/udev_mapping.rb
--- old/yast2-bootloader-3.1.145/src/lib/bootloader/udev_mapping.rb     
2015-08-27 15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/src/lib/bootloader/udev_mapping.rb     
2015-09-16 13:02:09.000000000 +0200
@@ -34,17 +34,28 @@
     end
 
     # Converts full udev name to kernel device ( disk or partition )
-    # @param dev [String] device udev or kernel one like 
/dev/disks/by-id/blabla
+    # @param dev [String] device udev, mdadm or kernel name like 
/dev/disk/by-id/blabla
     # @raise when device have udev format but do not exists
     def to_kernel_device(dev)
-      return dev if dev !~ /^\/dev\/disk\/by-/
+      # for non-udev devices try to see specific raid names (bnc#944041)
+      if dev =~ /^\/dev\/disk\/by-/
+        all_devices[dev] or raise "Unknown udev device #{dev}"
+      else
+        param = Yast::ArgRef.new({})
+        result = Yast::Storage.GetContVolInfo(dev, param)
+        return dev unless result # not raid with funny name
+
+        info = param.value
+        return info["vdevice"] unless info["vdevice"].empty?
+        return info["cdevice"] unless info["cdevice"].empty?
 
-      all_devices[dev] or raise "Unknown udev device #{dev}"
+        raise "unknown value for raid device '#{info.inspect}'"
+      end
     end
 
     # Converts udev or kernel device (disk or partition) to udev name 
according to mountby
     # option or kernel device if such udev device do not exists
-    # @param dev [String] device udev or kernel one like 
/dev/disks/by-id/blabla
+    # @param dev [String] device udev or kernel one like /dev/disk/by-id/blabla
     # @raise when device have udev format but do not exists
     def to_mountby_device(dev)
       kernel_dev = to_kernel_device(dev)
@@ -89,6 +100,14 @@
   private
 
     # reader of all devices that ensure that it contain valid data
+    #
+    # @return hash where keys are udev links for disks and partitions and 
value their kernel devices.
+    # @example of output
+    #   {
+    #     "/dev/disk/by-id/abcd" => "/dev/sda",
+    #     "/dev/disk/by-id/abcde" => "/dev/sda",
+    #     "/dev/disk/by-label/label1" => "/dev/sda1",
+    #     "/dev/disk/by-uuid/aaaa-bbbb-cccc-dddd" => "/dev/sda",
     def all_devices
       map_devices unless cache_valid?
       @all_devices
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-3.1.145/src/modules/BootGRUB2.rb 
new/yast2-bootloader-3.1.151/src/modules/BootGRUB2.rb
--- old/yast2-bootloader-3.1.145/src/modules/BootGRUB2.rb       2015-08-27 
15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/src/modules/BootGRUB2.rb       2015-09-16 
13:02:09.000000000 +0200
@@ -22,6 +22,7 @@
 require "bootloader/grub2base"
 require "bootloader/mbr_update"
 require "bootloader/device_map_dialog"
+require "bootloader/stage1"
 
 module Yast
   import "Arch"
@@ -141,49 +142,22 @@
       return if BootCommon.was_proposed && !Mode.autoinst && !Mode.autoupgrade
 
       case Arch.architecture
+      # intel need some specific handler. TODO: unify it to use same rutine
       when "i386", "x86_64"
         grub_LocationProposal
         # pass vga if available (bnc#896300)
         if !Kernel.GetVgaType.empty?
           BootCommon.globals["vgamode"] = Kernel.GetVgaType
         end
-      when /ppc/
-        BootStorage.detect_disks
-        partition = prep_partitions.first
-        if partition
-          BootCommon.globals["boot_custom"] = partition
-        else
-          # handle diskless setup, in such case do not write boot code 
anywhere (bnc#874466)
-          # we need to detect what is mount on /boot and if it is nfs, then 
just
-          # skip this proposal. In other case if it is not nfs, then it is 
error and raise exception
-          if BootCommon.getBootDisk == "/dev/nfs"
-            return
-          else
-            raise "there is no prep partition"
-          end
-        end
-      when /s390/
-        Builtins.y2milestone "no partition needed for grub2 on s390"
+      # less tricky architectures, so directly propose stage1 location
+      when /ppc/, /s390/
+        grub_DetectDisks
+        ::Bootloader::Stage1.new.propose
       else
         raise "unsuported architecture #{Arch.architecture}"
       end
     end
 
-    def prep_partitions
-      target_map = Storage.GetTargetMap
-
-      partitions = target_map.reduce([]) do |parts, pair|
-        parts.concat(pair[1]["partitions"] || [])
-      end
-
-      prep_partitions = partitions.select do |partition|
-        [0x41, 0x108].include? partition["fsid"]
-      end
-
-      y2milestone "detected prep partitions #{prep_partitions.inspect}"
-      prep_partitions.map { |p| p["device"] }
-    end
-
     # FATE#303643 Enable one-click changes in bootloader proposal
     #
     #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-3.1.145/src/modules/BootStorage.rb 
new/yast2-bootloader-3.1.151/src/modules/BootStorage.rb
--- old/yast2-bootloader-3.1.145/src/modules/BootStorage.rb     2015-08-27 
15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/src/modules/BootStorage.rb     2015-09-16 
13:02:09.000000000 +0200
@@ -415,6 +415,10 @@
     # Sets properly boot, root and mbr disk.
     # @return true if proposal need to be reconfigured
     def detect_disks
+      # The AutoYaST config mode does access to the system.
+      # bnc#942360
+      return if Mode.config
+
       mp = Storage.GetMountPoints
 
       mountdata_boot = mp["/boot"] || mp["/"]
@@ -437,6 +441,10 @@
         BootCommon.mbrDisk = BootCommon.FindMBRDisk
       end
 
+      # device map may be implicitly proposed in FindMBRDisk above
+      # - but not always...
+      device_map.propose if device_map.empty?
+
       # if no bootloader devices have been set up, or any of the set up
       # bootloader devices have become unavailable, then re-propose the
       # bootloader location.
@@ -450,6 +458,21 @@
       end
     end
 
+    def prep_partitions
+      target_map = Storage.GetTargetMap
+
+      partitions = target_map.reduce([]) do |parts, pair|
+        parts.concat(pair[1]["partitions"] || [])
+      end
+
+      prep_partitions = partitions.select do |partition|
+        [0x41, 0x108].include? partition["fsid"]
+      end
+
+      y2milestone "detected prep partitions #{prep_partitions.inspect}"
+      prep_partitions.map { |p| p["device"] }
+    end
+
     # Get map of swap partitions
     # @return a map where key is partition name and value its size in KB
     def available_swap_partitions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-3.1.145/src/modules/Bootloader.rb 
new/yast2-bootloader-3.1.151/src/modules/Bootloader.rb
--- old/yast2-bootloader-3.1.145/src/modules/Bootloader.rb      2015-08-27 
15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/src/modules/Bootloader.rb      2015-09-16 
13:02:09.000000000 +0200
@@ -542,6 +542,8 @@
         log.info "Not reading settings in Mode::config ()"
         BootCommon.was_read = true
         BootCommon.was_proposed = true
+        log.info "But initialize libstorage in readonly mode" # bnc#942360
+        Storage.InitLibstorage(true)
       elsif Stage.initial && !Mode.update
         Propose()
       else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-3.1.145/test/boot_common_test.rb 
new/yast2-bootloader-3.1.151/test/boot_common_test.rb
--- old/yast2-bootloader-3.1.145/test/boot_common_test.rb       2015-08-27 
15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/test/boot_common_test.rb       2015-09-16 
13:02:09.000000000 +0200
@@ -83,11 +83,11 @@
                  new: "verbose")
     end
 
-    it "return empty string when value is \"false\" and line is nil" do
+    it "return quoted empty string when value is \"false\" and line is nil" do
       expect_set(key: "verbose",
                  val: "false",
                  old: nil,
-                 new: "")
+                 new: '""')
     end
   end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-3.1.145/test/boot_storage_test.rb 
new/yast2-bootloader-3.1.151/test/boot_storage_test.rb
--- old/yast2-bootloader-3.1.145/test/boot_storage_test.rb      2015-08-27 
15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/test/boot_storage_test.rb      2015-09-16 
13:02:09.000000000 +0200
@@ -28,6 +28,7 @@
       allow(Yast::Arch).to receive(:s390).and_return(false) # be arch agnostic
       subject.device_map.propose
       allow(Yast::Storage).to receive(:GetDefaultMountBy).and_return(:device)
+      allow(Yast::Storage).to receive(:GetContVolInfo).and_return(false)
     end
 
     it "returns list of kernel devices that can be used as stage1 for 
bootloader" do
@@ -132,6 +133,7 @@
         "/"     => ["/dev/vda1"],
         "/boot" => ["/dev/vda2"]
       )
+      allow(Yast::Storage).to receive(:GetContVolInfo).and_return(false)
     end
 
     it "fills RootPartitionDevice variable" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.145/test/bootloader_proposal_client_test.rb 
new/yast2-bootloader-3.1.151/test/bootloader_proposal_client_test.rb
--- old/yast2-bootloader-3.1.145/test/bootloader_proposal_client_test.rb        
2015-08-27 15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/test/bootloader_proposal_client_test.rb        
2015-09-16 13:02:09.000000000 +0200
@@ -174,7 +174,6 @@
 
       expect(Yast::Bootloader).to_not receive(:Propose)
       expect(Yast::Bootloader).to receive(:blRead)
-      expect(Yast::Product).to receive(:short_name).and_return("SLES")
 
       subject.make_proposal({})
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-3.1.145/test/grub2pwd_test.rb 
new/yast2-bootloader-3.1.151/test/grub2pwd_test.rb
--- old/yast2-bootloader-3.1.145/test/grub2pwd_test.rb  2015-08-27 
15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/test/grub2pwd_test.rb  2015-09-16 
13:02:09.000000000 +0200
@@ -200,7 +200,7 @@
         config = described_class.new
         config.used = true
 
-        expect { config.write }.to raise_error
+        expect { config.write }.to raise_error(RuntimeError)
       end
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-3.1.145/test/stage1_test.rb 
new/yast2-bootloader-3.1.151/test/stage1_test.rb
--- old/yast2-bootloader-3.1.145/test/stage1_test.rb    2015-08-27 
15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/test/stage1_test.rb    2015-09-16 
13:02:09.000000000 +0200
@@ -4,6 +4,7 @@
 
 require "bootloader/stage1"
 
+Yast.import "Arch"
 Yast.import "BootStorage"
 Yast.import "Storage"
 
@@ -13,6 +14,7 @@
     allow(Yast::BootStorage).to 
receive(:can_boot_from_partition).and_return(true)
     allow(subject).to receive(:gpt_boot_disk?).and_return(true)
     mock_disk_partition
+    object_double("Yast::Arch", :architecture => "x86_64").as_stubbed_const
   end
 
   describe "#propose" do
@@ -24,5 +26,22 @@
         .and_return("/dev/md1")
       expect(subject.propose).to be_a(Symbol)
     end
+
+    it "returns :none on s390" do
+      object_double("Yast::Arch", :architecture => "s390_64").as_stubbed_const
+
+      expect(subject.propose).to eq(:none)
+    end
+
+    it "returns :custom on ppc" do
+      object_double("Yast::Arch", :architecture => "ppc64").as_stubbed_const
+      object_double(
+        "Yast::BootStorage",
+        prep_partitions: ["/dev/sda1"],
+        detect_disks:    nil
+      ).as_stubbed_const
+
+      expect(subject.propose).to eq(:custom)
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-3.1.145/test/udev_mapping_test.rb 
new/yast2-bootloader-3.1.151/test/udev_mapping_test.rb
--- old/yast2-bootloader-3.1.145/test/udev_mapping_test.rb      2015-08-27 
15:42:09.000000000 +0200
+++ new/yast2-bootloader-3.1.151/test/udev_mapping_test.rb      2015-09-16 
13:02:09.000000000 +0200
@@ -10,6 +10,7 @@
     # always invalidate cache to use new mocks
     allow(subject.instance).to receive(:cache_valid?).and_return false
     allow(Yast::Arch).to receive(:ppc).and_return(false)
+    allow(Yast::Storage).to receive(:GetContVolInfo).and_return(false)
   end
 
   describe ".to_kernel_device" do
@@ -17,7 +18,29 @@
       target_map_stub("storage_ppc.yaml")
     end
 
-    it "return argument for non-udev mapped device names" do
+    it "returns mapped raid name for partitioned devices" do
+      expect(Yast::Storage).to receive(:GetContVolInfo) do |dev, info|
+        expect(dev).to eq "/dev/md/crazy_name"
+        info.value["vdevice"] = "/dev/md126p1"
+        info.value["cdevice"] = ""
+        true
+      end
+
+      expect(subject.to_kernel_device("/dev/md/crazy_name")).to eq 
"/dev/md126p1"
+    end
+
+    it "returns mapped raid name for non-partitioned devices" do
+      expect(Yast::Storage).to receive(:GetContVolInfo) do |dev, info|
+        expect(dev).to eq "/dev/md/crazy_name"
+        info.value["vdevice"] = ""
+        info.value["cdevice"] = "/dev/md126"
+        true
+      end
+
+      expect(subject.to_kernel_device("/dev/md/crazy_name")).to eq "/dev/md126"
+    end
+
+    it "return argument for non-udev non-raid mapped device names" do
       expect(subject.to_kernel_device("/dev/sda")).to eq "/dev/sda"
     end
 
@@ -26,7 +49,7 @@
     end
 
     it "raise exception if udev link is not known" do
-      expect { subject.to_kernel_device("/dev/disk/by-id/non-existing-device") 
}.to raise_error
+      expect { subject.to_kernel_device("/dev/disk/by-id/non-existing-device") 
}.to raise_error(RuntimeError)
     end
   end
 
@@ -90,7 +113,7 @@
       target_map_stub("storage_lvm.yaml")
       allow(Yast::Storage).to receive(:GetDefaultMountBy).and_return(:uuid)
 
-      expect { subject.to_mountby_device("/dev/vda50") }.to raise_error
+      expect { subject.to_mountby_device("/dev/vda50") }.to 
raise_error(RuntimeError)
     end
   end
 end


Reply via email to