Skip to content

Commit

Permalink
Use grub2-efi on aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-schwab committed Jan 20, 2015
1 parent 42af10b commit f24da5c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
6 changes: 6 additions & 0 deletions package/yast2-bootloader.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jan 20 10:54:52 UTC 2015 - schwab@suse.de

- Use grub2-efi on aarch64
- 3.1.115

-------------------------------------------------------------------
Tue Jan 13 08:48:38 UTC 2015 - jreidinger@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-bootloader.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-bootloader
Version: 3.1.114
Version: 3.1.115
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
10 changes: 6 additions & 4 deletions src/include/bootloader/grub2/dialogs.rb
Expand Up @@ -59,7 +59,7 @@ def boot_code_tab
"contents" => VBox(
VSquash(HBox(
Top(VBox(VSpacing(1), "loader_type")),
Arch.s390 ? Empty() : "loader_location")),
Arch.s390 || Arch.aarch64 ? Empty() : "loader_location")),
MarginBox(1, 0.5, "distributor"),
MarginBox(1, 0.5, Left("activate")),
MarginBox(1, 0.5, Left("generic_mbr")),
Expand Down Expand Up @@ -285,11 +285,13 @@ def grub2Widgets
end

def grub2efiWidgets
if Arch.x86_64
if @_grub2_efi_widgets.nil?
if @_grub2_efi_widgets.nil?
if Arch.x86_64
@_grub2_efi_widgets = { "loader_location" => grub2SecureBootWidget }
@_grub2_efi_widgets.merge! Grub2Options()
else
@_grub2_efi_widgets = {}
end
@_grub2_efi_widgets.merge! Grub2Options()
end

deep_copy(@_grub2_efi_widgets)
Expand Down
8 changes: 4 additions & 4 deletions src/modules/BootCommon.rb
Expand Up @@ -407,8 +407,8 @@ def getLoaderType(recheck)
@loader_type = "grub2" if ["s390", "ppc", "grub"].include? @loader_type

Builtins.y2milestone("Bootloader detection returned %1", @loader_type)
if (Arch.i386 || Arch.x86_64) && boot_efi?
# use grub2-efi as default bootloader for x86_64/i386 EFI
if (Arch.i386 || Arch.x86_64 || Arch.aarch64) && boot_efi?
# use grub2-efi as default bootloader for x86_64/i386/aarch64 EFI
@loader_type = "grub2-efi"
end

Expand Down Expand Up @@ -492,8 +492,8 @@ def getBootloaders
return SUPPORTED_BOOTLOADERS + ["default"]
end
ret = [getLoaderType(false)]
ret << "grub2" # grub2 everywhere
ret << "grub2-efi" if Arch.x86_64
ret << "grub2" unless Arch.aarch64 # grub2 everywhere except aarch64
ret << "grub2-efi" if Arch.x86_64 || Arch.aarch64
ret << "none"
# avoid double entry for selected one
ret.uniq
Expand Down
2 changes: 2 additions & 0 deletions src/modules/BootGRUB2EFI.rb
Expand Up @@ -133,6 +133,8 @@ def BootGRUB2EFI
packages = ["grub2-i386-efi"]
elsif Arch.x86_64
packages = ["grub2-x86_64-efi", "shim", "mokutil"]
elsif Arch.aarch64
packages = ["grub2-arm64-efi"]
else
# do not raise exception as we call constructor everywhere even if it doesn't make sense
packages = []
Expand Down
5 changes: 4 additions & 1 deletion src/modules/BootSupportCheck.rb
Expand Up @@ -77,7 +77,7 @@ def CorrectLoaderType
return true if lt == "none"

# grub2 is sooo cool...
return true if lt == "grub2"
return true if lt == "grub2" && !Arch.aarch64

if Arch.i386 || Arch.x86_64
if efi?
Expand All @@ -86,6 +86,9 @@ def CorrectLoaderType
return true if lt == "grub2"
end
end

return true if lt == "grub2-efi" && Arch.aarch64

Builtins.y2error(
"Unsupported combination of hardware platform %1 and bootloader %2",
Arch.architecture,
Expand Down

0 comments on commit f24da5c

Please sign in to comment.