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, #stage1
Constructor Details
Returns a new instance of TrustedBootWidget.
213
214
215
216
217
|
# File 'src/lib/bootloader/grub2_widgets.rb', line 213
def initialize
textdomain "bootloader"
super
end
|
Instance Method Details
#help ⇒ Object
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
# File 'src/lib/bootloader/grub2_widgets.rb', line 223
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
238
239
240
|
# File 'src/lib/bootloader/grub2_widgets.rb', line 238
def init
self.value = grub2.trusted_boot
end
|
#label ⇒ Object
219
220
221
|
# File 'src/lib/bootloader/grub2_widgets.rb', line 219
def label
_("&Trusted Boot Support")
end
|
#store ⇒ Object
242
243
244
|
# File 'src/lib/bootloader/grub2_widgets.rb', line 242
def store
grub2.trusted_boot = value
end
|
#validate ⇒ Object
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
# File 'src/lib/bootloader/grub2_widgets.rb', line 246
def validate
return true if Yast::Mode.config || !value || ["grub2-efi",
"grub2-bls"].include?(grub2.name)
tpm_files = Dir.glob("/sys/**/pcrs")
if !tpm_files.empty? && !File.read(tpm_files[0], 1).nil?
return true
end
Yast::.ContinueCancel(_("Trusted Platform Module not found.\n" \
"Make sure it is enabled in BIOS.\n" \
"The system will not boot otherwise."))
end
|