Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support 32 bit UEFI firmware on x86_64/i386 architecture (bsc#1208003, jsc#PED-2569) #683

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions package/yast2-bootloader.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Aug 7 09:02:48 UTC 2023 - Steffen Winterfeldt <[email protected]>

- support 32 bit UEFI firmware on x86_64/i386 architecture (bsc#1208003,
jsc#PED-2569)
- 4.6.3

-------------------------------------------------------------------
Thu Jun 15 09:51:19 UTC 2023 - José Iván López González <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-bootloader.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-bootloader
Version: 4.6.2
Version: 4.6.3
Release: 0
Summary: YaST2 - Bootloader Configuration
License: GPL-2.0-or-later
Expand Down
2 changes: 1 addition & 1 deletion src/lib/bootloader/bootloader_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def boot_efi?
def proposed_name
return "grub2-efi" if Systeminfo.efi_mandatory?

return "grub2-efi" if Yast::Arch.x86_64 && boot_efi?
return "grub2-efi" if (Yast::Arch.x86_64 || Yast::Arch.i386) && boot_efi?

"grub2" # grub2 works(c) everywhere
end
Expand Down
2 changes: 1 addition & 1 deletion src/lib/bootloader/grub2efi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def name
def packages
res = super

case Yast::Arch.architecture
case Systeminfo.efi_arch
when "i386"
res << "grub2-i386-efi"
when "x86_64"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/bootloader/grub_install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def target
return @target if @target

arch = Yast::Arch.architecture
target = efi ? EFI_TARGETS[arch] : NON_EFI_TARGETS[arch]
target = efi ? EFI_TARGETS[Systeminfo.efi_arch] : NON_EFI_TARGETS[arch]

if !target
raise "unsupported combination of architecture #{arch} and " \
Expand Down
31 changes: 31 additions & 0 deletions src/lib/bootloader/systeminfo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def secure_boot_active?
#
# @return [Boolean] true if secure boot is (in principle) supported on this system
def secure_boot_supported?
# no shim for i386 (yet)
return false if efi_arch == "i386"

efi_supported? || s390_secure_boot_supported? || ppc_secure_boot_supported?
end

Expand All @@ -36,6 +39,9 @@ def secure_boot_supported?
# @param bootloader_name [String] bootloader name
# @return [Boolean] true if secure boot setting is available with this bootloader
def secure_boot_available?(bootloader_name)
# no shim for i386 (yet)
return false if efi_arch == "i386"

efi_used?(bootloader_name) || s390_secure_boot_available? || ppc_secure_boot_available?
end

Expand Down Expand Up @@ -108,6 +114,31 @@ def shim_needed?(bootloader_name, secure_boot)
secure_boot && efi_used?(bootloader_name)
end

# UEFI platform size (32 or 64 bits).
#
# On x86_64 systems both variants are possible.
#
# @return [Integer] platform size - or 0 if not applicable
def efi_platform_size
bits = File.read("/sys/firmware/efi/fw_platform_size").to_i
log.info "EFI platform size: #{bits}"
bits
rescue StandardError
0
end

# Effective UEFI architecture.
#
# Usually the same as the architecture except on x86_64 where it
# depends on the platform size.
#
# @return [String] architecture name
def efi_arch
arch = Yast::Arch.architecture
arch = "i386" if arch == "x86_64" && efi_platform_size == 32
arch
end

# Check if secure boot is (in principle) available on an s390 machine.
#
# @return [Boolean] true if this is an s390 machine and it has secure boot support
Expand Down
Loading