-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
70 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# frozen_string_literal: true | ||
|
||
require "fileutils" | ||
require "yast" | ||
require "bootloader/sysconfig" | ||
require "bootloader/cpu_mitigations" | ||
require "cfa/grub2/default" | ||
|
||
Yast.import "Report" | ||
|
||
module Bootloader | ||
# Represents bls compatile system calls which can be used | ||
# e.g. by grub2-bls and systemd-boot | ||
class Bls | ||
include Yast::Logger | ||
include Yast::I18n | ||
|
||
SDBOOTUTIL = "/usr/bin/sdbootutil" | ||
|
||
def self.create_menu_entries | ||
Yast::Execute.on_target!(SDBOOTUTIL, "--verbose", "add-all-kernels") | ||
rescue Cheetah::ExecutionFailed => e | ||
Yast::Report.Error( | ||
format(_( | ||
"Cannot create boot menu entry:\n" \ | ||
"Command `%{command}`.\n" \ | ||
"Error output: %{stderr}" | ||
), command: e.commands.inspect, stderr: e.stderr) | ||
) | ||
end | ||
|
||
def self.install_bootloader | ||
Yast::Execute.on_target!(SDBOOTUTIL, "--verbose", | ||
"install") | ||
rescue Cheetah::ExecutionFailed => e | ||
Yast::Report.Error( | ||
format(_( | ||
"Cannot install bootloader:\n" \ | ||
"Command `%{command}`.\n" \ | ||
"Error output: %{stderr}" | ||
), command: e.commands.inspect, stderr: e.stderr) | ||
) | ||
end | ||
|
||
def self.write_menu_timeout(timeout) | ||
Yast::Execute.on_target(SDBOOTUTIL, "set-timeout", timeout) | ||
rescue Cheetah::ExecutionFailed => e | ||
Yast::Report.Error( | ||
format(_( | ||
"Cannot write boot menu timeout:\n" \ | ||
"Command `%{command}`.\n" \ | ||
"Error output: %{stderr}" | ||
), command: e.commands.inspect, stderr: e.stderr) | ||
) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters