Skip to content

Commit

Permalink
Merge d7b1f1d into 79a2bba
Browse files Browse the repository at this point in the history
  • Loading branch information
dgdavid committed Jun 10, 2020
2 parents 79a2bba + d7b1f1d commit c1776fd
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
17 changes: 17 additions & 0 deletions doc/xen-booting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Booting a XEN guest

According to the [guest boot
process](https://wiki.xen.org/wiki/Booting_Overview), a BIOS Boot Partition is
not needed to boot a XEN domU (the guest) unless using Grub2 for booting its own
kernel instead of the one provided by the XEN dom0 (the host).

Since the boot process for a XEN domU is defined in its configuration file, it's
not possible to know it during the installation. For that reason, although the
installer proposes the BIOS Boot partition for both XEN and non-XEN systems, the
Partitioner will not warn the user when that partition is missing in a XEN
guest.

For its part, AutoYaST will [keep trying to add a boot
device](https://github.com/yast/yast-storage-ng/blob/af944283d0fd2220973c8d51452365c040d684ba/doc/autoyast.md#phase-six-adding-boot-devices-if-needed).,
which is not a problem because such attempt is just complementary and the
installation will continue regardless of whether it succeeds or not.
4 changes: 2 additions & 2 deletions package/yast2-storage-ng.spec
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ BuildRequires: rubygem(%{rb_default_ruby_abi}:parallel_tests)
Requires: findutils
# RB_RESIZE_NOT_SUPPORTED_DUE_TO_SNAPSHOTS
Requires: libstorage-ng-ruby >= 4.3.21
# AutoYaST issue handling
Requires: yast2 >= 4.3.2
# Updated Xen detection
Requires: yast2 >= 4.3.6
# Y2Packager::Repository
Requires: yast2-packager >= 3.3.7
# for AbortException and handle direct abort
Expand Down
14 changes: 13 additions & 1 deletion src/lib/y2storage/boot_requirements_strategies/legacy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "yast"
require "y2storage/boot_requirements_strategies/base"
require "y2storage/partition_id"

Yast.import "Arch"

module Y2Storage
module BootRequirementsStrategies
# Strategy to calculate the boot requirements in a legacy system (x86 without EFI)
Expand Down Expand Up @@ -176,7 +179,7 @@ def grub_partition(target)
def errors_on_gpt
errors = []

if grub_part_needed_in_gpt? && missing_partition_for?(grub_volume)
if include_bios_boot_warning?
errors << bios_boot_missing_error
errors << grub_embedding_error
end
Expand Down Expand Up @@ -279,6 +282,15 @@ def bad_config_error
)
SetupError.new(message: message)
end

# Whether the warning about missing BIOS Boot partition should be included
#
# return [Boolean] true when a needed Grub partition is missing, unless running in a XEN domU
def include_bios_boot_warning?
return false if Yast::Arch.is_xenU

grub_part_needed_in_gpt? && missing_partition_for?(grub_volume)
end
end
end
end
10 changes: 10 additions & 0 deletions test/y2storage/boot_requirements_errors_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,16 @@ def format_zipl(name)
match(/partition of type BIOS Boot/)
)
end

context "but it is running in a XEN guest" do
before do
allow(Yast::Arch).to receive(:is_xenU).and_return(true)
end

it "does not contain warnings" do
expect(checker.warnings).to be_empty
end
end
end

context "and there is a grub partition in the system" do
Expand Down

0 comments on commit c1776fd

Please sign in to comment.