Class: Bootloader::Grub2Widget::SecureBootWidget

Inherits:
CWM::CheckBox
  • Object
show all
Includes:
Grub2Helper
Defined in:
src/lib/bootloader/grub2_widgets.rb

Overview

Represents switcher for secure boot on EFI

Instance Method Summary collapse

Methods included from Grub2Helper

#grub2, #grub_default, #password, #sections, #stage1

Constructor Details

#initializeSecureBootWidget

Returns a new instance of SecureBootWidget.



347
348
349
350
351
# File 'src/lib/bootloader/grub2_widgets.rb', line 347

def initialize
  textdomain "bootloader"

  super
end

Instance Method Details

#helpObject



357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'src/lib/bootloader/grub2_widgets.rb', line 357

def help
  if Yast::Arch.s390
    _(
      "<p><b>Secure Boot Support</b> if checked enables Secure Boot support.<br>" \
      "This does not turn on secure booting. " \
      "It only switches to the new secure-boot enabled boot data format. " \
      "Note that this new format works only on z15 or later and only for zFCP disks. " \
      "The system does not boot if these requirements are not met.</p>"
    )
  else
    _(
      "<p><b>Secure Boot Support</b> if checked enables Secure Boot support.<br>" \
      "This does not turn on secure booting. " \
      "It only sets up the boot loader in a way that supports secure booting. " \
      "You still have to enable Secure Boot in the UEFI Firmware.</p> "
    )
  end
end

#initObject



376
377
378
# File 'src/lib/bootloader/grub2_widgets.rb', line 376

def init
  self.value = grub2.secure_boot
end

#labelObject



353
354
355
# File 'src/lib/bootloader/grub2_widgets.rb', line 353

def label
  _("&Secure Boot Support")
end

#storeObject



380
381
382
# File 'src/lib/bootloader/grub2_widgets.rb', line 380

def store
  grub2.secure_boot = value
end

#validateObject



384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'src/lib/bootloader/grub2_widgets.rb', line 384

def validate
  return true if Yast::Mode.config ||
    !Yast::Arch.s390 ||
    !value ||
    value == Systeminfo.secure_boot_active?

  Yast::Popup.ContinueCancel(
    _(
      "The new secure-boot enabled boot data format works only on z15 " \
      "and later and only for zFCP disks.\n\n" \
      "The system does not boot if these requirements are not met."
    )
  )
end