Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Nov 27, 2024
1 parent 2b7dce0 commit c148516
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
10 changes: 4 additions & 6 deletions src/lib/bootloader/grub2_widgets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def store
grub_default.timeout = value.to_s
end
end

end

# Represents decision if bootloader need activated partition
Expand Down Expand Up @@ -990,17 +989,16 @@ def contents
VStretch()
)
end

private

def console_widget
if Systeminfo.console_supported?(grub2.name)
ConsoleWidget.new
else
CWM::Empty.new("console")
end
end

end

# Represent tab with options related to stage1 location and bootloader type
Expand Down Expand Up @@ -1142,8 +1140,8 @@ def hidden_menu_widget
else
CWM::Empty.new("hidden_menu")
end
end
end

def os_prober_widget
# Checks !Arch.s390, not grub2-bls and if package is available
if OsProber.available?(grub2.name)
Expand Down
29 changes: 15 additions & 14 deletions src/lib/bootloader/systeminfo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,36 @@ def secure_boot_available?(bootloader_name)
#
# @param bootloader_name [String] bootloader name
# @return [Boolean] true if available with this bootloader
def generic_mbr_available?(_bootloader_name)
(Yast::Arch.x86_64 || Yast::Arch.i386) && !["grub2-efi", "grub2-bls"].include?(grub2.name)
def generic_mbr_available?(bootloader_name)
(Yast::Arch.x86_64 || Yast::Arch.i386) && !["grub2-efi",
"grub2-bls"].include?(bootloader_name)
end

# Check if loader location is configurable with a bootloader.
#
# @param bootloader_name [String] bootloader name
# @return [Boolean] true if available with this bootloader
def loader_location_available?(_bootloader_name)
(Yast::Arch.x86_64 || Yast::Arch.i386 || Yast::Arch.ppc) && grub2.name == "grub2"
def loader_location_available?(bootloader_name)
(Yast::Arch.x86_64 || Yast::Arch.i386 || Yast::Arch.ppc) && bootloader_name == "grub2"
end

# Check if pmbr is configurable with a bootloader.
#
# @param bootloader_name [String] bootloader name
# @return [Boolean] true if available with this bootloader
def pmbr_available?(_bootloader_name)
def pmbr_available?(bootloader_name)
(Yast::Arch.x86_64 || Yast::Arch.i386) &&
Yast::BootStorage.gpt_boot_disk? &&
grub2.name != "grub2-bls"
bootloader_name != "grub2-bls"
end

# Check if setting device map is available.
#
# @param bootloader_name [String] bootloader name
# @return [Boolean] true if available with this bootloader
def device_map?(_bootloader_name)
def device_map?(bootloader_name)
(Yast::Arch.x86_64 || Yast::Arch.i386) && !["grub2-efi",
"grub2-bls"].include?(grub2.name)
"grub2-bls"].include?(bootloader_name)
end

# Check current trusted boot state.
Expand Down Expand Up @@ -155,24 +156,24 @@ def efi_mandatory?
#
# param bootloader_name [String] bootloader name
# @return [Boolean] true if supported
def console_supported?(_bootloader_name)
!Yast::Arch.s390 && grub2.name != "grub2-bls"
def console_supported?(bootloader_name)
!Yast::Arch.s390 && bootloader_name != "grub2-bls"
end

# Check if hiding menu are supported
#
# param bootloader_name [String] bootloader name
# @return [Boolean] true if supported
def hiding_menu_supported?(_bootloader_name)
grub2.name != "grub2-bls"
def hiding_menu_supported?(bootloader_name)
bootloader_name != "grub2-bls"
end

# Check if setting password is supported
#
# param bootloader_name [String] bootloader name
# @return [Boolean] true if supported
def password_supported?(_bootloader_name)
grub2.name != "grub2-bls"
def password_supported?(bootloader_name)
bootloader_name != "grub2-bls"
end

# Check if shim-install should be used instead of grub2-install.
Expand Down

0 comments on commit c148516

Please sign in to comment.