Class: Bootloader::GrubInstall

Inherits:
Object
  • Object
show all
Defined in:
src/lib/bootloader/grub_install.rb

Overview

Wraps grub install script for easier usage.

Constant Summary

Instance Method Summary (collapse)

Constructor Details

- (GrubInstall) initialize(efi: false)

Returns a new instance of GrubInstall



9
10
11
# File 'src/lib/bootloader/grub_install.rb', line 9

def initialize(efi: false)
  @efi = efi
end

Instance Method Details

- (Object) execute(devices: [], secure_boot: false, trusted_boot: false)



13
14
15
16
17
18
19
20
21
22
23
24
# File 'src/lib/bootloader/grub_install.rb', line 13

def execute(devices: [], secure_boot: false, trusted_boot: false)
  raise "cannot have secure boot without efi" if secure_boot && !efi
  raise "cannot have trusted boot with efi" if trusted_boot && efi

  cmd = basic_cmd(secure_boot, trusted_boot)

  if no_device_install?
    Yast::Execute.on_target(cmd)
  else
    devices.each { |d| Yast::Execute.on_target(cmd + [d]) }
  end
end