Hello community,

here is the log from the commit of package yast2-bootloader for 
openSUSE:Factory checked in at 2019-03-04 09:15:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-bootloader (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-bootloader.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-bootloader"

Mon Mar  4 09:15:18 2019 rev:274 rq:680370 version:4.1.20

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-bootloader/yast2-bootloader.changes        
2019-02-28 21:47:33.157418785 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-bootloader.new.28833/yast2-bootloader.changes 
    2019-03-04 09:15:22.328654999 +0100
@@ -1,0 +2,8 @@
+Fri Mar  1 06:16:50 UTC 2019 - [email protected]
+
+- remove resume if user wants noresume (bsc#1079537)
+- use for resume the biggest mounted swap (bsc#1071354)
+- make help text formatting consistent and improve some help texts
+- 4.1.20
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.qGUoQB/_old  2019-03-04 09:15:24.916654533 +0100
+++ /var/tmp/diff_new_pack.qGUoQB/_new  2019-03-04 09:15:24.920654532 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        4.1.19
+Version:        4.1.20
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-bootloader-4.1.19.tar.bz2 -> yast2-bootloader-4.1.20.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.19/package/yast2-bootloader.changes 
new/yast2-bootloader-4.1.20/package/yast2-bootloader.changes
--- old/yast2-bootloader-4.1.19/package/yast2-bootloader.changes        
2019-02-27 13:40:20.000000000 +0100
+++ new/yast2-bootloader-4.1.20/package/yast2-bootloader.changes        
2019-03-01 08:48:52.000000000 +0100
@@ -1,4 +1,12 @@
 -------------------------------------------------------------------
+Fri Mar  1 06:16:50 UTC 2019 - [email protected]
+
+- remove resume if user wants noresume (bsc#1079537)
+- use for resume the biggest mounted swap (bsc#1071354)
+- make help text formatting consistent and improve some help texts
+- 4.1.20
+
+-------------------------------------------------------------------
 Wed Feb 27 10:07:40 UTC 2019 - [email protected]
 
 - Use the correct path for /usr/bin/mkdir (bsc#1127138).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.19/package/yast2-bootloader.spec 
new/yast2-bootloader-4.1.20/package/yast2-bootloader.spec
--- old/yast2-bootloader-4.1.19/package/yast2-bootloader.spec   2019-02-27 
13:40:20.000000000 +0100
+++ new/yast2-bootloader-4.1.20/package/yast2-bootloader.spec   2019-03-01 
08:48:52.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        4.1.19
+Version:        4.1.20
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.19/src/lib/bootloader/generic_widgets.rb 
new/yast2-bootloader-4.1.20/src/lib/bootloader/generic_widgets.rb
--- old/yast2-bootloader-4.1.19/src/lib/bootloader/generic_widgets.rb   
2019-02-27 13:40:20.000000000 +0100
+++ new/yast2-bootloader-4.1.20/src/lib/bootloader/generic_widgets.rb   
2019-03-01 08:48:52.000000000 +0100
@@ -73,9 +73,10 @@
 
     def help
       _(
-        "<p><b>Boot Loader Type</b><br>\n" \
-          "To select whether to install a boot loader and which bootloader to 
install,\n" \
-          "use <b>Boot Loader</b>.</p>"
+        "<p><b>Boot Loader</b>\n" \
+          "specifies which boot loader to install. Can be also set to 
<tt>None</tt> " \
+          "which means that the boot loader configuration is not managed by 
YaST and also " \
+          "the kernel post install script does not update the boot loader 
configuration."
       )
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.19/src/lib/bootloader/grub2_widgets.rb 
new/yast2-bootloader-4.1.20/src/lib/bootloader/grub2_widgets.rb
--- old/yast2-bootloader-4.1.19/src/lib/bootloader/grub2_widgets.rb     
2019-02-27 13:40:20.000000000 +0100
+++ new/yast2-bootloader-4.1.20/src/lib/bootloader/grub2_widgets.rb     
2019-03-01 08:48:52.000000000 +0100
@@ -57,8 +57,8 @@
     end
 
     def help
-      _("<p><b>Timeout in Seconds</b><br>\n" \
-        "Specifies the time the bootloader will wait until the default kernel 
is loaded.</p>\n")
+      _("<p><b>Timeout in Seconds</b>\n" \
+        "specifies the time the boot loader will wait until the default kernel 
is loaded.</p>\n")
     end
 
     def init
@@ -94,8 +94,9 @@
 
     def help
       _(
-        "<p><b>Set active Flag in Partition Table for Boot 
Partition</b><br>\n" \
-          "To activate the partition which contains the boot loader." \
+        "<p><b>Set Active Flag in Partition Table for Boot Partition</b>\n" \
+          "specifies whether the partition containing " \
+          "the boot loader will have the \"active\" flag." \
           " The generic MBR code will then\n" \
           "boot the active partition. Older BIOSes require one partition to be 
active even\n" \
           "if the boot loader is installed in the MBR.</p>"
@@ -272,7 +273,7 @@
     end
 
     def help
-      _("Tick to enable UEFI Secure Boot\n")
+      _("<p><b>Enable Secure Boot Support</b> if checked enables UEFI Secure 
Boot support.</p>")
     end
 
     def init
@@ -299,15 +300,17 @@
     def help
       # TRANSLATORS: TrustedGRUB2 is a name, don't translate it
       res = _("<p><b>Trusted Boot</b> will install TrustedGRUB2\n" \
-          "instead of regular GRUB2.</p>\n" \
-          "<p>It means measuring the integrity of the boot process,\n" \
+          "instead of regular GRUB2.\n" \
+          "It means measuring the integrity of the boot process,\n" \
           "with the help from the hardware (a TPM, Trusted Platform Module,\n" 
\
-          "chip).</p>\n")
+          "chip).\n")
       if grub2.name == "grub2"
-        res += _("<p>First you need to make sure Trusted Boot is enabled in 
the BIOS\n" \
-          "setup (the setting may be named Security Chip, for example).</p>\n")
+        res += _("First you need to make sure Trusted Boot is enabled in the 
BIOS\n" \
+          "setup (the setting may be named \"Security Chip\", for example).\n")
       end
 
+      res += "</p>"
+
       res
     end
 
@@ -435,16 +438,16 @@
 
     def help
       _(
-        "<p><b>Protect Boot Loader with Password</b><br>\n" \
-          "At boot time, modifying or even booting any entry will require the" 
\
+        "<p><b>Protect Boot Loader with Password</b>\n" \
+          "at boot time, modifying or even booting any entry will require the" 
\
           " password. If <b>Protect Entry Modification Only</b> is checked 
then " \
           "booting any entry is not restricted but modifying entries requires 
" \
           "the password (which is the way GRUB 1 behaved). As side-effect of " 
\
           "this option, rd.shell=0 is added to kernel parameters, to prevent " 
\
-          "an unauthorized access to the initrd shell.<br>" \
+          "an unauthorized access to the initrd shell. " \
           "YaST will only accept the password if you repeat it in " \
           "<b>Retype Password</b>. The password applies to the GRUB2 user 
'root' " \
-          "which is distinct from the Linux 'root'. YaST currently does not 
support" \
+          "which is distinct from the Linux 'root'. YaST currently does not 
support " \
           "other GRUB2 users. If you need them, use a separate GRUB2 
script.</p>"
       )
     end
@@ -475,11 +478,11 @@
     def help
       # Translators: do not translate the quoted parts like "unit"
       _(
-        "<p>When a graphical console is used it allows to use various " \
+        "<p><b>Use graphical console</b> when checked it allows to use various 
" \
         "display resolutions. The <tt>auto</tt> option tries to find " \
         "the best one when booting starts.</p>\n" \
-        "<p>When a serial console is used the boot output " \
-        "will be printed to a serial device like <tt>ttyS0</tt>. " \
+        "<p><b>Use serial console</b> when checked it redirects the boot 
output " \
+        "to a serial device like <tt>ttyS0</tt>. " \
         "At least the <tt>--unit</tt> option has to be specified, " \
         "and the complete syntax is <tt>%s</tt>. " \
         "Other parts are optional and if not set, a default is used. " \
@@ -671,12 +674,9 @@
 
     def help
       _(
-        "<p> By pressing <b>Set as Default</b> you mark the selected section 
as\n" \
-        "the default. When booting, the boot loader will provide a boot menu 
and\n" \
-        "wait for the user to select a kernel or OS to boot. If no\n" \
-        "key is pressed before the timeout, the default kernel or OS will\n" \
-        "boot. The order of the sections in the boot loader menu can be 
changed\n" \
-        "using the <b>Up</b> and <b>Down</b> buttons.</p>\n"
+        "<p><b>Default Boot Section</b> selects the default section for 
booting.\n" \
+        " If sections are not generated yet ( e.g. during installation) \n" \
+        "then the box is empty and the default is picked by grub2 
itself.</p>\n"
       )
     end
 
@@ -819,8 +819,8 @@
       textdomain "bootloader"
 
       _(
-        "<p><big><b>Disks Order</b></big><br>\n" \
-          "To specify the order of the disks according to the order in BIOS, 
use\n" \
+        "<p><b>Edit Disk Boot Order</b>\n" \
+          "allows to specify the order of the disks according to the order in 
BIOS. Use\n" \
           "the <b>Up</b> and <b>Down</b> buttons to reorder the disks.\n" \
           "To add a disk, push <b>Add</b>.\n" \
           "To remove a disk, push <b>Remove</b>.</p>"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.1.19/src/lib/bootloader/grub2base.rb 
new/yast2-bootloader-4.1.20/src/lib/bootloader/grub2base.rb
--- old/yast2-bootloader-4.1.19/src/lib/bootloader/grub2base.rb 2019-02-27 
13:40:20.000000000 +0100
+++ new/yast2-bootloader-4.1.20/src/lib/bootloader/grub2base.rb 2019-03-01 
08:48:52.000000000 +0100
@@ -198,11 +198,17 @@
       log.info "before merge other #{other.inspect}"
 
       KERNEL_FLAVORS_METHODS.each do |method|
-        next if other.public_send(method).empty?
+        other_params = other.public_send(method)
+        default_params = default.public_send(method)
+        next if other_params.empty?
 
-        new_kernel_params = default.public_send(method).serialize +
-          " " + other.public_send(method).serialize
-        default.public_send(method).replace(new_kernel_params)
+        default_serialize = default_params.serialize
+        # handle specially noresume as it should lead to remove all other 
resume
+        default_serialize.gsub!(/resume=\S+/, "") if 
other_params.parameter("noresume")
+
+        new_kernel_params = default_serialize + " " + other_params.serialize
+
+        default_params.replace(new_kernel_params)
       end
 
       merge_attributes(default, other)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.1.19/src/modules/BootStorage.rb 
new/yast2-bootloader-4.1.20/src/modules/BootStorage.rb
--- old/yast2-bootloader-4.1.19/src/modules/BootStorage.rb      2019-02-27 
13:40:20.000000000 +0100
+++ new/yast2-bootloader-4.1.20/src/modules/BootStorage.rb      2019-03-01 
08:48:52.000000000 +0100
@@ -107,9 +107,19 @@
     def available_swap_partitions
       ret = {}
 
-      staging.filesystems.select { |f| f.type.is?(:swap) }.each do |swap|
-        blk_device = swap.blk_devices[0]
-        ret[blk_device.name] = blk_device.size.to_i / 1024
+      mounted = Y2Storage::MountPoint.find_by_path(staging, 
Y2Storage::MountPoint::SWAP_PATH.to_s)
+      if mounted.empty?
+        log.info "No mounted swap found, using fallback."
+        staging.filesystems.select { |f| f.type.is?(:swap) }.each do |swap|
+          blk_device = swap.blk_devices[0]
+          ret[blk_device.name] = blk_device.size.to_i / 1024
+        end
+      else
+        log.info "Mounted swap found: #{mounted.inspect}"
+        mounted.each do |mp|
+          blk_device = mp.filesystem.blk_devices[0]
+          ret[blk_device.name] = blk_device.size.to_i / 1024
+        end
       end
 
       log.info "Available swap partitions: #{ret}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.1.19/test/boot_storage_test.rb 
new/yast2-bootloader-4.1.20/test/boot_storage_test.rb
--- old/yast2-bootloader-4.1.19/test/boot_storage_test.rb       2019-02-27 
13:40:20.000000000 +0100
+++ new/yast2-bootloader-4.1.20/test/boot_storage_test.rb       2019-03-01 
08:48:52.000000000 +0100
@@ -28,6 +28,13 @@
         "/dev/mapper/cr_swap" => 2_095_104
       )
     end
+
+    it "returns only mounted swaps if any is available" do
+      devicegraph_stub("multi_swap.yaml")
+      expect(subject.available_swap_partitions).to eq(
+        "/dev/sdb2" => 1_026_048
+      )
+    end
   end
 
   describe ".encrypted_boot?" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.1.19/test/data/multi_swap.yaml 
new/yast2-bootloader-4.1.20/test/data/multi_swap.yaml
--- old/yast2-bootloader-4.1.19/test/data/multi_swap.yaml       1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-bootloader-4.1.20/test/data/multi_swap.yaml       2019-03-01 
08:48:52.000000000 +0100
@@ -0,0 +1,45 @@
+---
+- disk:
+    name: /dev/sda
+    size: 800 GiB
+    partition_table:  gpt
+    partitions:
+
+    - partition:
+        size:         5 GiB
+        name:         /dev/sda1
+        id:           swap
+        file_system:  swap
+
+    - partition:
+        size:         unlimited
+        name:         /dev/sda2
+        file_system:  btrfs
+        mount_point:  /home
+
+- disk:
+    name: /dev/sdb
+    size: 8 GiB
+    partition_table:  gpt
+    partitions:
+
+    - partition:
+        size:         1 MiB
+        name:         /dev/sdb1
+        id:           bios_boot
+        file_system:  vfat
+        uuid:         3de29985-8cc6-4c9d-8562-2ede26b0c5b6
+
+    - partition:
+        size:         1002 MiB
+        name:         /dev/sdb2
+        id:           swap
+        file_system:  swap
+        mount_point:  swap
+        uuid:         ec8e9948-ca5f-4b18-a863-ac999365e4a9
+
+    - partition:
+        size:         unlimited
+        name:         /dev/sdb3
+        file_system:  btrfs
+        mount_point:  /
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-bootloader-4.1.19/test/grub2base_test.rb 
new/yast2-bootloader-4.1.20/test/grub2base_test.rb
--- old/yast2-bootloader-4.1.19/test/grub2base_test.rb  2019-02-27 
13:40:20.000000000 +0100
+++ new/yast2-bootloader-4.1.20/test/grub2base_test.rb  2019-03-01 
08:48:52.000000000 +0100
@@ -447,12 +447,12 @@
     end
 
     it "for kernel line place subject params and then merged ones" do
-      subject.grub_default.kernel_params.replace("verbose debug=true")
-      other.grub_default.kernel_params.replace("silent debug=false 3")
+      subject.grub_default.kernel_params.replace("verbose debug=true 
resume=/dev/sda1")
+      other.grub_default.kernel_params.replace("silent noresume debug=false 3")
 
       subject.merge(other)
 
-      expect(subject.grub_default.kernel_params.serialize).to eq "verbose 
debug=true silent debug=false 3"
+      expect(subject.grub_default.kernel_params.serialize).to eq "verbose 
debug=true silent noresume debug=false 3"
     end
 
     it "use grub2 password configuration specified in merged object" do


Reply via email to