Class: Bootloader::Grub2Widget::TrustedBootWidget
- Inherits:
-
CWM::CheckBox
- Object
- CWM::CheckBox
- Bootloader::Grub2Widget::TrustedBootWidget
show all
- Includes:
- Grub2Helper
- Defined in:
- src/lib/bootloader/grub2_widgets.rb
Overview
Represents switcher for Trusted Boot
Instance Method Summary
collapse
#grub2, #grub_default, #password, #sections, #stage1
Constructor Details
Returns a new instance of TrustedBootWidget.
321
322
323
324
325
|
# File 'src/lib/bootloader/grub2_widgets.rb', line 321
def initialize
textdomain "bootloader"
super
end
|
Instance Method Details
#help ⇒ Object
331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
# File 'src/lib/bootloader/grub2_widgets.rb', line 331
def help
res = _("<p><b>Trusted Boot</b> " \
"means measuring the integrity of the boot process,\n" \
"with the help from the hardware (a TPM, Trusted Platform Module,\n" \
"chip).\n")
if grub2.name == "grub2"
res += _("First you need to make sure Trusted Boot is enabled in the BIOS\n" \
"setup (the setting may be named \"Security Chip\", for example).\n")
end
res += "</p>"
res
end
|
#init ⇒ Object
346
347
348
|
# File 'src/lib/bootloader/grub2_widgets.rb', line 346
def init
self.value = grub2.trusted_boot
end
|
#label ⇒ Object
327
328
329
|
# File 'src/lib/bootloader/grub2_widgets.rb', line 327
def label
_("&Trusted Boot Support")
end
|
#store ⇒ Object
350
351
352
|
# File 'src/lib/bootloader/grub2_widgets.rb', line 350
def store
grub2.trusted_boot = value
end
|
#validate ⇒ Object
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
|
# File 'src/lib/bootloader/grub2_widgets.rb', line 354
def validate
return true if Yast::Mode.config || !value || grub2.name == "grub2-efi"
tpm_files = Dir.glob("/sys/**/pcrs")
if !tpm_files.empty? && !File.read(tpm_files[0], 1).nil?
return true
end
Yast::Popup.ContinueCancel(_("Trusted Platform Module not found.\n" \
"Make sure it is enabled in BIOS.\n" \
"The system will not boot otherwise."))
end
|