Hello community,

here is the log from the commit of package yast2-bootloader for 
openSUSE:Factory checked in at 2014-08-30 16:03:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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-08-20 17:54:15.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-bootloader.new/yast2-bootloader.changes   
2014-08-30 16:04:10.000000000 +0200
@@ -1,0 +2,15 @@
+Wed Aug 27 07:53:45 UTC 2014 - [email protected]
+
+- do not reset secure boot to false at the end of installation in
+  case of incapable device (bnc#892032)
+- 3.1.91
+
+-------------------------------------------------------------------
+Tue Aug 26 11:37:17 UTC 2014 - [email protected]
+
+- fix partition activation on LVM (bnc#893449)
+- fix activation device when md raid devices do not have
+  recognizable bios id
+- 3.1.90
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.ninOvQ/_old  2014-08-30 16:04:11.000000000 +0200
+++ /var/tmp/diff_new_pack.ninOvQ/_new  2014-08-30 16:04:11.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        3.1.89
+Version:        3.1.91
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-bootloader-3.1.89.tar.bz2 -> yast2-bootloader-3.1.91.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.89/package/yast2-bootloader.changes 
new/yast2-bootloader-3.1.91/package/yast2-bootloader.changes
--- old/yast2-bootloader-3.1.89/package/yast2-bootloader.changes        
2014-08-15 14:28:10.000000000 +0200
+++ new/yast2-bootloader-3.1.91/package/yast2-bootloader.changes        
2014-08-27 10:13:18.000000000 +0200
@@ -1,4 +1,19 @@
 -------------------------------------------------------------------
+Wed Aug 27 07:53:45 UTC 2014 - [email protected]
+
+- do not reset secure boot to false at the end of installation in
+  case of incapable device (bnc#892032)
+- 3.1.91
+
+-------------------------------------------------------------------
+Tue Aug 26 11:37:17 UTC 2014 - [email protected]
+
+- fix partition activation on LVM (bnc#893449)
+- fix activation device when md raid devices do not have
+  recognizable bios id
+- 3.1.90
+
+-------------------------------------------------------------------
 Fri Aug 15 12:27:58 CEST 2014 - [email protected]
 
 - remove nonsense check (bnc #768538)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.89/package/yast2-bootloader.spec 
new/yast2-bootloader-3.1.91/package/yast2-bootloader.spec
--- old/yast2-bootloader-3.1.89/package/yast2-bootloader.spec   2014-08-15 
14:28:10.000000000 +0200
+++ new/yast2-bootloader-3.1.91/package/yast2-bootloader.spec   2014-08-27 
10:13:18.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        3.1.89
+Version:        3.1.91
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.89/src/include/bootloader/grub2/misc.rb 
new/yast2-bootloader-3.1.91/src/include/bootloader/grub2/misc.rb
--- old/yast2-bootloader-3.1.89/src/include/bootloader/grub2/misc.rb    
2014-08-15 14:28:10.000000000 +0200
+++ new/yast2-bootloader-3.1.91/src/include/bootloader/grub2/misc.rb    
2014-08-27 10:13:18.000000000 +0200
@@ -90,7 +90,9 @@
       # value, and code on the caller side that evaluates this.
       if Builtins.substring(loader_device, 0, 7) == "/dev/md"
         md = BootCommon.Md2Partitions(loader_device)
-        min = 256 # max. is 255; 256 means "no bios_id found"
+        # max. is 255; 256 means "no bios_id found", so to have at least one
+        # underlaying device use higher
+        min = 257
         device = ""
         Builtins.foreach(md) do |d, id|
           if Ops.less_than(id, min)
@@ -105,21 +107,24 @@
         end
       end
 
+      tm = Storage.GetTargetMap
+      partitions = Ops.get_list(tm, [mbr_dev, "partitions"], [])
+      partitions.select! { |p| p["used_fs"] != :swap }
       # (bnc # 337742) - Unable to boot the openSUSE (32 and 64 bits) after 
installation
-      # if loader_device is disk device activate 
BootStorage::BootPartitionDevice
+      # if loader_device is disk Choose any partition which is not swap to
+      # satisfy such bios (bnc#893449)
       if num == 0
-        Builtins.y2milestone("loader_device is disk device")
-        p_dev = Storage.GetDiskPartition(BootStorage.BootPartitionDevice)
-        num = BootCommon.myToInteger(Ops.get(p_dev, "nr"))
-        # handle situation when we have md raid and boot from md0 and sda and 
md0 is boot device (bnc#882592)
-        # This also prevents mess when we can potentially have mix of 
different number and device
-        return {} if p_dev["disk"] != mbr_dev
+        # strange, no partitions on our mbr device, we probably won't boot
+        if partitions.empty?
+          Builtins.y2warning("no non-swap partitions for mbr device 
#{mbr_dev}")
+          return {}
+        end
+        num = partitions.first["nr"]
+        Builtins.y2milestone("loader_device is disk device, so use its #{num} 
partition")
       end
 
       if Ops.greater_than(num, 4)
         Builtins.y2milestone("Bootloader partition type can be logical")
-        tm = Storage.GetTargetMap
-        partitions = Ops.get_list(tm, [mbr_dev, "partitions"], [])
         Builtins.foreach(partitions) do |p|
           if Ops.get(p, "type") == :extended
             num = Ops.get_integer(p, "nr", num)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-3.1.89/src/modules/BootCommon.rb 
new/yast2-bootloader-3.1.91/src/modules/BootCommon.rb
--- old/yast2-bootloader-3.1.89/src/modules/BootCommon.rb       2014-08-15 
14:28:10.000000000 +0200
+++ new/yast2-bootloader-3.1.91/src/modules/BootCommon.rb       2014-08-27 
10:13:18.000000000 +0200
@@ -893,22 +893,6 @@
       nil
     end
 
-    def checkSecureBoot
-      ret = false
-      sbvar = 
"/sys/firmware/efi/vars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c/data"
-      sbvar_avail = 0 ==
-        Convert.to_integer(
-          SCR.Execute(path(".target.bash"), Ops.add("test -e ", sbvar))
-        )
-
-      if sbvar_avail
-        cmd = Builtins.sformat("test `od -An -N1 -t u1 %1` -eq 1", sbvar)
-        ret = 0 == Convert.to_integer(SCR.Execute(path(".target.bash"), cmd))
-      end
-
-      ret
-    end
-
     def getSystemSecureBootStatus(recheck)
       return @secure_boot if !recheck && @secure_boot != nil
 
@@ -923,7 +907,8 @@
         end
       end
 
-      @secure_boot = checkSecureBoot
+      # propose secure boot always to true (bnc#872054), otherwise respect 
user choice
+      @secure_boot = true if @secure_boot.nil?
       @secure_boot
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-3.1.89/test/partitions_to_activate_test.rb 
new/yast2-bootloader-3.1.91/test/partitions_to_activate_test.rb
--- old/yast2-bootloader-3.1.89/test/partitions_to_activate_test.rb     
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-bootloader-3.1.91/test/partitions_to_activate_test.rb     
2014-08-27 10:13:18.000000000 +0200
@@ -0,0 +1,76 @@
+require_relative "test_helper"
+
+Yast.import "BootGRUB2"
+
+# it should be probably part of BootStorage module, but we are too late in
+# release phase, so place it here and adapt when location of this method 
changed
+describe Yast::BootloaderGrub2MiscInclude do
+  before do
+    # simple mock getting disks from partition as it need initialized 
libstorage
+    allow(Yast::Storage).to receive(:GetDiskPartition) do |partition|
+      if partition == "/dev/system/root"
+        disk = "/dev/system"
+        number = "system"
+      else
+        number = partition[/(\d+)$/,1]
+        disk = number ? partition[0..-(number.size+1)] : partition
+      end
+      { "disk" => disk, "nr" => number }
+    end
+    allow(Yast::Storage).to receive(:GetDeviceName) do |disk, partition|
+      disk+partition.to_s
+    end
+  end
+
+
+  def target_map_stub(name)
+    path = File.join(File.dirname(__FILE__), "data", name)
+    tm = eval(File.read(path))
+    allow(Yast::Storage).to receive(:GetTargetMap).and_return(tm)
+  end
+
+  describe "#grub_getPartitionToActivate" do
+    it "returns map with device, its disk and partition number" do
+      target_map_stub("storage_mdraid.rb")
+      result = Yast::BootGRUB2.grub_getPartitionToActivate("/dev/vda1")
+      expected_result = {
+        "mbr" => "/dev/vda",
+        "num" => 1,
+        "dev" => "/dev/vda1"
+      }
+      expect(result).to eq expected_result
+    end
+
+    it "returns underlaying devices for md raid" do
+      target_map_stub("storage_mdraid.rb")
+      result = Yast::BootGRUB2.grub_getPartitionToActivate("/dev/md1")
+      expected_result = {
+        "mbr" => "/dev/vda",
+        "num" => 1,
+        "dev" => "/dev/vda1"
+      }
+      expect(result).to eq expected_result
+
+    end
+
+    it "choose any partition on disk if disk is passed" do
+      target_map_stub("storage_lvm.rb")
+      result = Yast::BootGRUB2.grub_getPartitionToActivate("/dev/vda")
+      expected_result = {
+        "mbr" => "/dev/vda",
+        "num" => 3,
+        "dev" => "/dev/vda3"
+      }
+      expect(result).to eq expected_result
+    end
+
+    it "return empty map if device do not exists" do
+      target_map_stub("storage_lvm.rb")
+      result = Yast::BootGRUB2.grub_getPartitionToActivate("/dev/nonexist")
+      expected_result = {}
+      expect(result).to eq expected_result
+    end
+
+    # TODO prepare test for extended partition, need target map containing it
+  end
+end

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to