Class: Bootloader::KernelAppendWidget
- Inherits:
-
CWM::InputField
- Object
- CWM::InputField
- Bootloader::KernelAppendWidget
- Defined in:
- src/lib/bootloader/generic_widgets.rb
Overview
represents kernel command line
Instance Method Summary collapse
- #help ⇒ Object
- #init ⇒ Object
-
#initialize ⇒ KernelAppendWidget
constructor
A new instance of KernelAppendWidget.
- #label ⇒ Object
- #store ⇒ Object
Constructor Details
#initialize ⇒ KernelAppendWidget
Returns a new instance of KernelAppendWidget.
176 177 178 179 180 |
# File 'src/lib/bootloader/generic_widgets.rb', line 176 def initialize textdomain "bootloader" super end |
Instance Method Details
#help ⇒ Object
186 187 188 189 190 191 |
# File 'src/lib/bootloader/generic_widgets.rb', line 186 def help _( "<p><b>Optional Kernel Command Line Parameter</b> lets you define " \ "additional parameters to pass to the kernel.</p>" ) end |
#init ⇒ Object
193 194 195 196 197 198 199 200 201 202 203 |
# File 'src/lib/bootloader/generic_widgets.rb', line 193 def init current_bl = ::Bootloader::BootloaderFactory.current case current_bl when ::Bootloader::SystemdBoot self.value = current_bl.kernel_params.serialize.gsub(/mitigations=\S+/, "") when ::Bootloader::Grub2Base self.value = current_bl.grub_default.kernel_params.serialize.gsub(/mitigations=\S+/, "") else disable end end |
#label ⇒ Object
182 183 184 |
# File 'src/lib/bootloader/generic_widgets.rb', line 182 def label _("O&ptional Kernel Command Line Parameter") end |
#store ⇒ Object
205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'src/lib/bootloader/generic_widgets.rb', line 205 def store return unless enabled? current_bl = ::Bootloader::BootloaderFactory.current case current_bl when ::Bootloader::SystemdBoot current_bl.kernel_params.replace(value) when ::Bootloader::Grub2Base current_bl.grub_default.kernel_params.replace(value) else log.error("Bootloader type #{current_bl} not found.") end end |