Hello community,

here is the log from the commit of package yast2-bootloader for 
openSUSE:Factory checked in at 2019-10-03 14:06:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-bootloader (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-bootloader.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-bootloader"

Thu Oct  3 14:06:25 2019 rev:282 rq:734119 version:4.2.11

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-bootloader/yast2-bootloader.changes        
2019-08-30 14:39:11.829442494 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-bootloader.new.2352/yast2-bootloader.changes  
    2019-10-03 14:06:27.664563082 +0200
@@ -1,0 +2,7 @@
+Mon Sep 30 13:26:46 UTC 2019 - Josef Reidinger <[email protected]>
+
+- Add to autoyast ability to set secure boot flag for UEFI
+  (jsc#SLE-8787)
+- 4.2.11
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.2lXrkM/_old  2019-10-03 14:06:28.208561682 +0200
+++ /var/tmp/diff_new_pack.2lXrkM/_new  2019-10-03 14:06:28.208561682 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        4.2.10
+Version:        4.2.11
 Release:        0
 Summary:        YaST2 - Bootloader Configuration
 License:        GPL-2.0-or-later

++++++ yast2-bootloader-4.2.10.tar.bz2 -> yast2-bootloader-4.2.11.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.2.10/package/yast2-bootloader.changes 
new/yast2-bootloader-4.2.11/package/yast2-bootloader.changes
--- old/yast2-bootloader-4.2.10/package/yast2-bootloader.changes        
2019-08-27 19:42:07.000000000 +0200
+++ new/yast2-bootloader-4.2.11/package/yast2-bootloader.changes        
2019-09-30 17:51:21.000000000 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Mon Sep 30 13:26:46 UTC 2019 - Josef Reidinger <[email protected]>
+
+- Add to autoyast ability to set secure boot flag for UEFI
+  (jsc#SLE-8787)
+- 4.2.11
+
+-------------------------------------------------------------------
 Tue Aug 27 18:54:59 CEST 2019 - [email protected]
 
 - Set X-SuSE-YaST-AutoInstResource in desktop file (bsc#144894).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.2.10/package/yast2-bootloader.spec 
new/yast2-bootloader-4.2.11/package/yast2-bootloader.spec
--- old/yast2-bootloader-4.2.10/package/yast2-bootloader.spec   2019-08-27 
19:42:07.000000000 +0200
+++ new/yast2-bootloader-4.2.11/package/yast2-bootloader.spec   2019-09-30 
17:51:21.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-bootloader
-Version:        4.2.10
+Version:        4.2.11
 Release:        0
 Summary:        YaST2 - Bootloader Configuration
 License:        GPL-2.0-or-later
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.2.10/src/autoyast-rnc/bootloader.rnc 
new/yast2-bootloader-4.2.11/src/autoyast-rnc/bootloader.rnc
--- old/yast2-bootloader-4.2.10/src/autoyast-rnc/bootloader.rnc 2019-08-27 
19:42:07.000000000 +0200
+++ new/yast2-bootloader-4.2.11/src/autoyast-rnc/bootloader.rnc 2019-09-30 
17:51:21.000000000 +0200
@@ -53,6 +53,7 @@
     element hiddenmenu      { "true" | "false" }? &
     element os_prober       { "true" | "false" }? &
     element suse_btrfs      { "true" | "false" }? &
+    element secure_boot      { "true" | "false" }? &
     element xen_append        { text }? &
     element xen_kernel_append { text }? &
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.2.10/src/lib/bootloader/autoyast_converter.rb 
new/yast2-bootloader-4.2.11/src/lib/bootloader/autoyast_converter.rb
--- old/yast2-bootloader-4.2.10/src/lib/bootloader/autoyast_converter.rb        
2019-08-27 19:42:07.000000000 +0200
+++ new/yast2-bootloader-4.2.11/src/lib/bootloader/autoyast_converter.rb        
2019-09-30 17:51:21.000000000 +0200
@@ -35,6 +35,7 @@
         data["global"] ||= {}
 
         import_grub2(data, bootloader)
+        import_grub2efi(data, bootloader)
         import_stage1(data, bootloader)
         import_default(data, bootloader.grub_default)
         import_device_map(data, bootloader)
@@ -61,6 +62,7 @@
         res["global"] = {}
         global = res["global"]
         export_grub2(global, config) if config.name == "grub2"
+        export_grub2efi(global, config) if config.name == "grub2-efi"
         export_default(global, config.grub_default)
         res["global"]["cpu_mitigations"] = config.cpu_mitigations.value.to_s
         # Do not export device map as device name are very unpredictable and 
is used only as
@@ -83,6 +85,17 @@
         end
       end
 
+      def import_grub2efi(data, bootloader)
+        return unless bootloader.name == "grub2-efi"
+
+        GRUB2EFI_BOOLEAN_MAPPING.each do |key, method|
+          val = data["global"][key]
+          next unless val
+
+          bootloader.public_send(:"#{method}=", val == "true")
+        end
+      end
+
       def import_default(data, default)
         # import first kernel params as cpu_mitigations can later modify it
         DEFAULT_KERNEL_PARAMS_MAPPING.each do |key, method|
@@ -208,9 +221,22 @@
       end
 
       # only for grub2, not for others
+      GRUB2EFI_BOOLEAN_MAPPING = {
+        "secure_boot" => :secure_boot
+      }.freeze
+      private_constant :GRUB2EFI_BOOLEAN_MAPPING
+      def export_grub2efi(res, bootloader)
+        GRUB2EFI_BOOLEAN_MAPPING.each do |key, method|
+          val = bootloader.public_send(method)
+          res[key] = val ? "true" : "false" unless val.nil?
+        end
+      end
+
+      # only for grub2, not for others
       GRUB2_BOOLEAN_MAPPING = {
         "trusted_grub" => :trusted_boot
       }.freeze
+      private_constant :GRUB2_BOOLEAN_MAPPING
       def export_grub2(res, bootloader)
         GRUB2_BOOLEAN_MAPPING.each do |key, method|
           val = bootloader.public_send(method)
@@ -221,11 +247,13 @@
       DEFAULT_BOOLEAN_MAPPING = {
         "os_prober" => :os_prober
       }.freeze
+      private_constant :DEFAULT_BOOLEAN_MAPPING
 
       DEFAULT_STRING_MAPPING = {
         "gfxmode" => :gfxmode,
         "serial"  => :serial_console
       }.freeze
+      private_constant :DEFAULT_STRING_MAPPING
 
       DEFAULT_ARRAY_MAPPING = {
         "terminal" => :terminal
@@ -236,6 +264,7 @@
         "xen_append"        => :xen_kernel_params,
         "xen_kernel_append" => :xen_hypervisor_params
       }.freeze
+      private_constant :DEFAULT_KERNEL_PARAMS_MAPPING
 
       def export_default(res, default)
         DEFAULT_BOOLEAN_MAPPING.each do |key, method|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-bootloader-4.2.10/test/autoyast_converter_test.rb 
new/yast2-bootloader-4.2.11/test/autoyast_converter_test.rb
--- old/yast2-bootloader-4.2.10/test/autoyast_converter_test.rb 2019-08-27 
19:42:07.000000000 +0200
+++ new/yast2-bootloader-4.2.11/test/autoyast_converter_test.rb 2019-09-30 
17:51:21.000000000 +0200
@@ -129,5 +129,14 @@
 
       expect(subject.export(bootloader)["global"]).to eq expected_export
     end
+
+    context "for grub2-efi bootloader" do
+      let(:bootloader) { Bootloader::Grub2EFI.new }
+
+      it "exports secure boot key" do
+        bootloader.secure_boot = true
+        expect(subject.export(bootloader)["global"]["secure_boot"]).to eq 
"true"
+      end
+    end
   end
 end


Reply via email to