diff --git a/src/include/bootloader/grub/options.rb b/src/include/bootloader/grub/options.rb index eb6255926..de982a2f0 100644 --- a/src/include/bootloader/grub/options.rb +++ b/src/include/bootloader/grub/options.rb @@ -735,6 +735,14 @@ def HelpBootLoaderLocationWidget # @return [Yast::Term] with widgets def grubBootLoaderLocationWidget + if BootStorage.can_boot_from_partition + partition_boot = BootStorage.BootPartitionDevice == BootStorage.RootPartitionDevice ? + Left(CheckBox(Id("boot_root"), _("Boot from &Root Partition"))) : + Left(CheckBox(Id("boot_boot"), _("Boo&t from Boot Partition"))) + else + partition_boot = Empty() + end + contents = VBox( VSpacing(1), Frame( @@ -746,9 +754,7 @@ def grubBootLoaderLocationWidget Left( CheckBox(Id("boot_mbr"), _("Boot from &Master Boot Record")) ), - BootStorage.BootPartitionDevice == BootStorage.RootPartitionDevice ? - Left(CheckBox(Id("boot_root"), _("Boot from &Root Partition"))) : - Left(CheckBox(Id("boot_boot"), _("Boo&t from Boot Partition"))), + partition_boot, BootStorage.ExtendedPartitionDevice ? Left( CheckBox( diff --git a/src/include/bootloader/grub2/misc.rb b/src/include/bootloader/grub2/misc.rb index 3d3a17bbd..5863ff652 100644 --- a/src/include/bootloader/grub2/misc.rb +++ b/src/include/bootloader/grub2/misc.rb @@ -26,6 +26,7 @@ def initialize_bootloader_grub2_misc(include_target) Yast.import "StorageDevices" Yast.import "Mode" Yast.import "BootCommon" + Yast.import "BootStorage" Yast.import "PackageSystem" Yast.import "Map" Yast.import "Arch" @@ -695,6 +696,11 @@ def grub_ConfigureLocation selected_location = :mbr end + if !BootStorage.can_boot_from_partition + Builtins.y2milestone("/boot cannot be used to install stage1") + selected_location = :mbr + end + SetBootloaderDevice(selected_location) if !Builtins.contains( BootStorage.getPartitionList(:boot, "grub"), diff --git a/src/modules/BootGRUB2.rb b/src/modules/BootGRUB2.rb index 3e135da76..a233f8ca1 100644 --- a/src/modules/BootGRUB2.rb +++ b/src/modules/BootGRUB2.rb @@ -183,7 +183,6 @@ def prep_partitions def urlLocationSummary Builtins.y2milestone("Prepare url summary for GRUB2") # FIXME identical code in BootGRUB module - locations = [] line = "" - locations << line - return _("Change Location: %s") % locations.join(" ") + line << "" + + # TRANSLATORS: title for list of location proposals + return _("Change Location: %s") % line end diff --git a/src/modules/BootStorage.rb b/src/modules/BootStorage.rb index 71b149639..0b88fbd3b 100644 --- a/src/modules/BootStorage.rb +++ b/src/modules/BootStorage.rb @@ -1412,6 +1412,23 @@ def checkMDDevices(tm, device) ret end + def can_boot_from_partition + tm = Storage.GetTargetMap + partition = @BootPartitionDevice || @RootPartitionDevice + + part = Storage.GetPartition(tm, partition) + + if !part + Builtins.y2error("cannot find partition #{partition}") + return false + end + + fs = part["used_fs"] + Builtins.y2milestone("FS for boot partition #{fs}") + + # cannot install stage one to xfs as it doesn't have reserved space (bnc#884255) + return fs != :xfs + end # FATE#305008: Failover boot configurations for md arrays with redundancy # Function check partitions and set redundancy available if