Hello community,
here is the log from the commit of package yast2-bootloader for
openSUSE:Factory checked in at 2020-03-27 21:56:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-bootloader (Old)
and /work/SRC/openSUSE:Factory/.yast2-bootloader.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-bootloader"
Fri Mar 27 21:56:32 2020 rev:286 rq:788915 version:4.2.20
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-bootloader/yast2-bootloader.changes
2020-03-01 21:27:33.076500077 +0100
+++
/work/SRC/openSUSE:Factory/.yast2-bootloader.new.3160/yast2-bootloader.changes
2020-03-27 21:57:13.350790138 +0100
@@ -1,0 +2,23 @@
+Fri Mar 27 08:19:54 UTC 2020 - Ancor Gonzalez Sosa <[email protected]>
+
+- Reverted the changes to delegate to yast2-storage-ng the
+ calculation of udev links. See previous entries for versions
+ 4.2.16 and 4.2.19.
+- This fixes bsc#1167779 and is related to bsc#1166096 and
+ bsc#1151075.
+- 4.2.20
+
+-------------------------------------------------------------------
+Wed Mar 25 07:57:13 UTC 2020 - Ancor Gonzalez Sosa <[email protected]>
+
+- Fixed the calculation of the udev name used to reference devices
+ that are not formatted, like PReP partitions (bsc#1166096).
+- 4.2.19
+
+-------------------------------------------------------------------
+Tue Mar 24 08:10:33 UTC 2020 - Steffen Winterfeldt <[email protected]>
+
+- support s390 secure boot (jsc#SLE-9425, jsc#SLE-9471, bsc#1166736)
+- 4.2.18
+
+-------------------------------------------------------------------
Old:
----
yast2-bootloader-4.2.17.tar.bz2
New:
----
yast2-bootloader-4.2.20.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-bootloader.spec ++++++
--- /var/tmp/diff_new_pack.Ano5Qp/_old 2020-03-27 21:57:13.906790461 +0100
+++ /var/tmp/diff_new_pack.Ano5Qp/_new 2020-03-27 21:57:13.910790463 +0100
@@ -17,7 +17,7 @@
Name: yast2-bootloader
-Version: 4.2.17
+Version: 4.2.20
Release: 0
Summary: YaST2 - Bootloader Configuration
License: GPL-2.0-or-later
@@ -29,8 +29,8 @@
BuildRequires: yast2 >= 3.1.176
BuildRequires: yast2-devtools >= 4.2.2
BuildRequires: yast2-ruby-bindings >= 1.0.0
-# Y2Storage::Mountable#preferred_mount_by
-BuildRequires: yast2-storage-ng >= 4.2.90
+# Y2Storage::Mountable#mount_path
+BuildRequires: yast2-storage-ng >= 4.0.90
# lenses needed also for tests
BuildRequires: augeas-lenses
BuildRequires: update-desktop-files
@@ -46,8 +46,8 @@
Requires: yast2-core >= 2.18.7
Requires: yast2-packager >= 2.17.24
Requires: yast2-pkg-bindings >= 2.17.25
-# Y2Storage::Mountable#preferred_mount_by
-Requires: yast2-storage-ng >= 4.2.90
+# Y2Storage::Mountable#mount_path
+Requires: yast2-storage-ng >= 4.0.90
# Support for multiple values in GRUB_TERMINAL
Requires: rubygem(%rb_default_ruby_abi:cfa_grub2) >= 1.0.1
# lenses are needed as cfa_grub2 depends only on augeas bindings, but also
++++++ yast2-bootloader-4.2.17.tar.bz2 -> yast2-bootloader-4.2.20.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-bootloader-4.2.17/package/yast2-bootloader.changes
new/yast2-bootloader-4.2.20/package/yast2-bootloader.changes
--- old/yast2-bootloader-4.2.17/package/yast2-bootloader.changes
2020-02-28 15:32:22.000000000 +0100
+++ new/yast2-bootloader-4.2.20/package/yast2-bootloader.changes
2020-03-27 09:42:09.000000000 +0100
@@ -1,4 +1,27 @@
-------------------------------------------------------------------
+Fri Mar 27 08:19:54 UTC 2020 - Ancor Gonzalez Sosa <[email protected]>
+
+- Reverted the changes to delegate to yast2-storage-ng the
+ calculation of udev links. See previous entries for versions
+ 4.2.16 and 4.2.19.
+- This fixes bsc#1167779 and is related to bsc#1166096 and
+ bsc#1151075.
+- 4.2.20
+
+-------------------------------------------------------------------
+Wed Mar 25 07:57:13 UTC 2020 - Ancor Gonzalez Sosa <[email protected]>
+
+- Fixed the calculation of the udev name used to reference devices
+ that are not formatted, like PReP partitions (bsc#1166096).
+- 4.2.19
+
+-------------------------------------------------------------------
+Tue Mar 24 08:10:33 UTC 2020 - Steffen Winterfeldt <[email protected]>
+
+- support s390 secure boot (jsc#SLE-9425, jsc#SLE-9471, bsc#1166736)
+- 4.2.18
+
+-------------------------------------------------------------------
Fri Feb 28 14:23:30 UTC 2020 - Steffen Winterfeldt <[email protected]>
- add support for S390 secure boot (jsc#SLE-9471, jsc#SLE-9425)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-bootloader-4.2.17/package/yast2-bootloader.spec
new/yast2-bootloader-4.2.20/package/yast2-bootloader.spec
--- old/yast2-bootloader-4.2.17/package/yast2-bootloader.spec 2020-02-28
15:32:22.000000000 +0100
+++ new/yast2-bootloader-4.2.20/package/yast2-bootloader.spec 2020-03-27
09:42:09.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-bootloader
-Version: 4.2.17
+Version: 4.2.20
Release: 0
Summary: YaST2 - Bootloader Configuration
License: GPL-2.0-or-later
@@ -29,8 +29,8 @@
BuildRequires: yast2 >= 3.1.176
BuildRequires: yast2-devtools >= 4.2.2
BuildRequires: yast2-ruby-bindings >= 1.0.0
-# Y2Storage::Mountable#preferred_mount_by
-BuildRequires: yast2-storage-ng >= 4.2.90
+# Y2Storage::Mountable#mount_path
+BuildRequires: yast2-storage-ng >= 4.0.90
# lenses needed also for tests
BuildRequires: augeas-lenses
BuildRequires: rubygem(%rb_default_ruby_abi:cfa_grub2) >= 1.0.1
@@ -46,8 +46,8 @@
Requires: yast2-core >= 2.18.7
Requires: yast2-packager >= 2.17.24
Requires: yast2-pkg-bindings >= 2.17.25
-# Y2Storage::Mountable#preferred_mount_by
-Requires: yast2-storage-ng >= 4.2.90
+# Y2Storage::Mountable#mount_path
+Requires: yast2-storage-ng >= 4.0.90
# Support for multiple values in GRUB_TERMINAL
Requires: rubygem(%rb_default_ruby_abi:cfa_grub2) >= 1.0.1
# lenses are needed as cfa_grub2 depends only on augeas bindings, but also
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-bootloader-4.2.17/src/lib/bootloader/grub2_widgets.rb
new/yast2-bootloader-4.2.20/src/lib/bootloader/grub2_widgets.rb
--- old/yast2-bootloader-4.2.17/src/lib/bootloader/grub2_widgets.rb
2020-02-28 15:32:22.000000000 +0100
+++ new/yast2-bootloader-4.2.20/src/lib/bootloader/grub2_widgets.rb
2020-03-27 09:42:09.000000000 +0100
@@ -328,7 +328,22 @@
end
def help
- _("<p><b>Enable Secure Boot Support</b> if checked enables Secure Boot
support.</p>")
+ if Yast::Arch.s390
+ _(
+ "<p><b>Enable Secure Boot Support</b> if checked enables Secure Boot
support.<br>" \
+ "This does not turn on secure booting. " \
+ "It only switches to the new secure-boot enabled boot data format. "
\
+ "Note that this new format works only on z15 or later. " \
+ "You cannot boot on z14 machines or older.</p>"
+ )
+ else
+ _(
+ "<p><b>Enable Secure Boot Support</b> if checked enables Secure Boot
support.<br>" \
+ "This does not turn on secure booting. " \
+ "It only sets up the boot loader in a way that supports secure
booting. " \
+ "You still have to enable Secure Boot in the UEFI Firmware.</p> "
+ )
+ end
end
def init
@@ -342,12 +357,13 @@
def validate
return true if Yast::Mode.config ||
!Yast::Arch.s390 ||
+ !value ||
value == Systeminfo.secure_boot_active?
Yast::Popup.ContinueCancel(
_(
- "Make sure the Secure Boot setting matches the configuration of the
HMC.\n\n" \
- "Otherwise this system will not boot."
+ "The new secure-boot enabled boot data format works only on z15 and
later.\n\n" \
+ "Older machines will not boot."
)
)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-bootloader-4.2.17/src/lib/bootloader/proposal_client.rb
new/yast2-bootloader-4.2.20/src/lib/bootloader/proposal_client.rb
--- old/yast2-bootloader-4.2.17/src/lib/bootloader/proposal_client.rb
2020-02-28 15:32:22.000000000 +0100
+++ new/yast2-bootloader-4.2.20/src/lib/bootloader/proposal_client.rb
2020-03-27 09:42:09.000000000 +0100
@@ -361,8 +361,8 @@
if value && Yast::Arch.s390
Yast2::Popup.show(
_(
- "Make sure to also enable Secure Boot in the HMC.\n\n" \
- "Otherwise this system will not boot."
+ "The new secure-boot enabled boot data format works only on z15
and later.\n\n" \
+ "Older machines will not boot."
),
headline: :warning, buttons: :ok
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-bootloader-4.2.17/src/lib/bootloader/systeminfo.rb
new/yast2-bootloader-4.2.20/src/lib/bootloader/systeminfo.rb
--- old/yast2-bootloader-4.2.17/src/lib/bootloader/systeminfo.rb
2020-02-28 15:32:22.000000000 +0100
+++ new/yast2-bootloader-4.2.20/src/lib/bootloader/systeminfo.rb
2020-03-27 09:42:09.000000000 +0100
@@ -16,7 +16,7 @@
#
# @return [Boolean] true if secure boot is currently active
def secure_boot_active?
- (efi_supported? && Sysconfig.from_system.secure_boot) ||
s390_secure_boot_active?
+ (efi_supported? || s390_secure_boot_supported?) &&
Sysconfig.from_system.secure_boot
end
# Check if secure boot is in principle supported.
@@ -91,8 +91,10 @@
#
# @return [Boolean] true if this is an s390 machine and it has secure
boot support
def s390_secure_boot_supported?
- # FIXME: this is just a stub - replace with real code later
- Yast::Arch.s390
+ # see jsc#SLE-9425
+ File.read("/sys/firmware/ipl/has_secure", 1) == "1"
+ rescue StandardError
+ false
end
# Check if secure boot is currently active on an s390 machine.
@@ -101,7 +103,9 @@
#
# @return [Boolean] true if 390x machine has secure boot enabled
def s390_secure_boot_active?
- # FIXME: this is just a stub - replace with real code later
+ # see jsc#SLE-9425
+ File.read("/sys/firmware/ipl/secure", 1) == "1"
+ rescue StandardError
false
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/yast2-bootloader-4.2.17/src/lib/bootloader/udev_mapping.rb
new/yast2-bootloader-4.2.20/src/lib/bootloader/udev_mapping.rb
--- old/yast2-bootloader-4.2.17/src/lib/bootloader/udev_mapping.rb
2020-02-28 15:32:22.000000000 +0100
+++ new/yast2-bootloader-4.2.20/src/lib/bootloader/udev_mapping.rb
2020-03-27 09:42:09.000000000 +0100
@@ -38,10 +38,26 @@
# Converts udev or kernel device (disk or partition) to udev name that
fits best.
#
- # The strategy to discover the best mount by option when the device is not
mounted is delegated
- # to storage-ng, see Y2Storage::Mountable#preferred_mount_by.
+ # Here is description of strategy for finding the best possible udev
persistent name.
+ # There are three scenarios we consider:
+ # S1. disk with boot configuration is moved to different PC
+ # S2. disk dies and its content is loaded to new disk from backup
+ # S3. path to disk dies and disk is moved to different one
+ #
+ # Strategy is:
+ #
+ # 1. if device have filesystem and it have its mount_by, then respect it
+ # 2. if there is by-label use it, as it allows to handle S1, S2 and S3
just with using same
+ # label
+ # 3. if there is by-uuid then use it as it can also handle S1, S2 and S3
as uuid can be
+ # changed, but it is harder to do
+ # 4. if there is by-id use it, as it can handle S3 in some scenarios, but
not always.
+ # 5. if there is by-path use it as it is last supported udev symlink that
at least prevent
+ # change of kernel device during boot
+ # 6. as fallback use kernel name
#
# @param dev [String] device udev or kernel one like /dev/disk/by-id/blabla
+ # @raise when device have udev format but do not exists
# @return [String] udev name
def to_mountby_device(dev)
kernel_dev = to_kernel_device(dev)
@@ -76,14 +92,6 @@
device.name
end
- # Udev name for the device
- #
- # The selected udev name depends on the mount by option. In case of an
unmounted device,
- # storage-ng has logic to discover the preferred mount by option.
- #
- # @see #to_mountby_device
- #
- # @return [String]
def kernel_to_udev(dev)
device = Y2Storage::BlkDevice.find_by_name(staging, dev)
if device.nil?
@@ -91,22 +99,54 @@
return dev
end
- udev = mount_by_udev(device) || device.name
- log.info "udev device for #{dev.inspect} is #{udev.inspect}"
+ result = udev_name_for(device)
+ log.info "udev device for #{dev.inspect} is #{result.inspect}"
+
+ result
+ end
- udev
+ # picks udev name according to strategy
+ # @see #to_mountby_device
+ def udev_name_for(device)
+ mount_by_udev(device) ||
+ udev_by_label(device) ||
+ udev_by_uuid(device) ||
+ udev_by_id(device) ||
+ udev_by_path(device) ||
+ device.name
end
- # @return [String, nil] nil if the udev name cannot be found
def mount_by_udev(device)
filesystem = device.filesystem
return nil unless filesystem
+ # mount_by is nil, so not mounted and we need to use our own strategy
+ return nil if filesystem.mount_by.nil?
- # If the device is not mounted, a preferred mount by option is
calculated.
- mount_by = filesystem.mount_by || filesystem.preferred_mount_by
- return nil unless mount_by
+ case filesystem.mount_by.to_sym
+ when :device then device.name
+ when :uuid then udev_by_uuid(device)
+ when :label then udev_by_label(device)
+ when :id then udev_by_id(device)
+ when :path then udev_by_path(device)
+ else
+ raise "Unknown mount by option #{filesystem.mount_by.inspect} for
#{filesystem.inspect}"
+ end
+ end
+
+ def udev_by_uuid(device)
+ device.udev_full_uuid
+ end
+
+ def udev_by_label(device)
+ device.udev_full_label
+ end
+
+ def udev_by_id(device)
+ device.udev_full_ids.first
+ end
- device.path_for_mount_by(mount_by)
+ def udev_by_path(device)
+ device.udev_full_paths.first
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-bootloader-4.2.17/test/systeminfo_test.rb
new/yast2-bootloader-4.2.20/test/systeminfo_test.rb
--- old/yast2-bootloader-4.2.17/test/systeminfo_test.rb 2020-02-28
15:32:22.000000000 +0100
+++ new/yast2-bootloader-4.2.20/test/systeminfo_test.rb 2020-03-27
09:42:09.000000000 +0100
@@ -68,9 +68,10 @@
end
end
- context "and arch is s390x" do
+ context "and has_secure is 1 on arch s390x " do
let(:arch) { "s390_64" }
it "returns true" do
+ allow(File).to receive(:read).with("/sys/firmware/ipl/has_secure",
1).and_return("1")
expect(described_class.secure_boot_available?("grub2")).to be true
end
end
@@ -287,8 +288,18 @@
context "if arch is s390x" do
let(:arch) { "s390_64" }
- it "returns true" do
- expect(described_class.s390_secure_boot_supported?).to be true
+ context "and has_secure is 1" do
+ it "returns true" do
+ allow(File).to receive(:read).with("/sys/firmware/ipl/has_secure",
1).and_return("1")
+ expect(described_class.s390_secure_boot_supported?).to be true
+ end
+ end
+
+ context "and has_secure is 0" do
+ it "returns false" do
+ allow(File).to receive(:read).with("/sys/firmware/ipl/has_secure",
1).and_return("0")
+ expect(described_class.s390_secure_boot_supported?).to be false
+ end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/yast2-bootloader-4.2.17/test/udev_mapping_test.rb
new/yast2-bootloader-4.2.20/test/udev_mapping_test.rb
--- old/yast2-bootloader-4.2.17/test/udev_mapping_test.rb 2020-02-28
15:32:22.000000000 +0100
+++ new/yast2-bootloader-4.2.20/test/udev_mapping_test.rb 2020-03-27
09:42:09.000000000 +0100
@@ -42,66 +42,56 @@
end
describe ".to_mountby_device" do
+ let(:device) { find_device("/dev/sda3") }
+
before do
# find by name creates always new instance, so to make mocking easier,
mock it to return always same instance
allow(Y2Storage::BlkDevice).to receive(:find_by_name).and_return(device)
-
- allow(device).to
receive(:path_for_mount_by).with(mount_by).and_return(udev_name)
end
- let(:device) { find_device("/dev/sda3") }
-
- let(:mount_by) { Y2Storage::Filesystems::MountByType.new(mount_by_option) }
-
- context "when the device is mounted" do
- before do
- device.filesystem.mount_point.mount_by = mount_by
- end
+ it "returns udev link in same format as used to its mounting" do
+ device.filesystem.mount_point.mount_by =
Y2Storage::Filesystems::MountByType.new(:uuid)
- let(:mount_by_option) { :label }
+ expect(subject.to_mountby_device(device.name)).to eq
"/dev/disk/by-uuid/3de29985-8cc6-4c9d-8562-2ede26b0c5b6"
+ end
- context "and the udev name is available for the mount by option in the
mount point" do
- let(:udev_name) { "/dev/disk/by-label/test" }
+ it "returns udev link by label if defined" do
+ device.filesystem.remove_mount_point
- it "returns the udev name according to the mount by option in the
mount point" do
- expect(subject.to_mountby_device(device.name)).to eq(udev_name)
- end
- end
+ expect(subject.to_mountby_device(device.name)).to eq
"/dev/disk/by-label/DATA"
+ end
- context "and the udev name is not available for the mount by option in
the mount point" do
- let(:udev_name) { nil }
+ it "returns udev link by uuid if defined" do
+ device.filesystem.remove_mount_point
+ allow(device).to receive(:udev_full_label).and_return(nil)
- it "returns the kernel name as fallback" do
- expect(subject.to_mountby_device(device.name)).to eq("/dev/sda3")
- end
- end
+ expect(subject.to_mountby_device(device.name)).to eq
"/dev/disk/by-uuid/3de29985-8cc6-4c9d-8562-2ede26b0c5b6"
end
- context "when the device is not mounted" do
- before do
- device.filesystem&.remove_mount_point
-
- allow_any_instance_of(Y2Storage::MountPoint).to
receive(:preferred_mount_by)
- .and_return(mount_by)
- end
+ it "returns first udev link by id if defined" do
+ device.filesystem.remove_mount_point
+ allow(device).to receive(:udev_full_label).and_return(nil)
+ allow(device).to receive(:udev_full_uuid).and_return(nil)
+ allow(device).to receive(:udev_ids).and_return(["abc", "cde"])
- let(:mount_by_option) { :label }
+ expect(subject.to_mountby_device(device.name)).to eq
"/dev/disk/by-id/abc"
+ end
- context "and the udev name is available for the preferred mount by
option" do
- let(:udev_name) { "/dev/disk/by-label/test" }
+ it "returns first udev link by path if defined" do
+ device.filesystem.remove_mount_point
+ allow(device).to receive(:udev_full_label).and_return(nil)
+ allow(device).to receive(:udev_full_uuid).and_return(nil)
+ allow(device).to receive(:udev_paths).and_return(["abc", "cde"])
- it "returns the udev name according to the preferred mount by option"
do
- expect(subject.to_mountby_device(device.name)).to eq(udev_name)
- end
- end
+ expect(subject.to_mountby_device(device.name)).to eq
"/dev/disk/by-path/abc"
+ end
- context "and the udev name is not available for the preferred mount by
option" do
- let(:udev_name) { nil }
+ it "returns kernel name as last fallback" do
+ device.filesystem.remove_mount_point
+ allow(device).to receive(:udev_full_label).and_return(nil)
+ allow(device).to receive(:udev_full_uuid).and_return(nil)
- it "returns the kernel name as fallback" do
- expect(subject.to_mountby_device(device.name)).to eq("/dev/sda3")
- end
- end
+ expect(subject.to_mountby_device(device.name)).to eq device.name
end
end
end