本文整理汇总了Python中kiwi.defaults.Defaults.get_failsafe_kernel_options方法的典型用法代码示例。如果您正苦于以下问题:Python Defaults.get_failsafe_kernel_options方法的具体用法?Python Defaults.get_failsafe_kernel_options怎么用?Python Defaults.get_failsafe_kernel_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.defaults.Defaults
的用法示例。
在下文中一共展示了Defaults.get_failsafe_kernel_options方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_live_image_config
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_failsafe_kernel_options [as 别名]
def setup_live_image_config(
self, mbrid, hypervisor='xen.gz', kernel='linux', initrd='initrd'
):
"""
Create grub2 config file to boot a live media ISO image
:param string mbrid: mbrid file name on boot device
:param string hypervisor: hypervisor name
:param string kernel: kernel name
:param string initrd: initrd name
"""
log.info('Creating grub2 live ISO config file from template')
self.iso_boot = True
self.cmdline = self.get_boot_cmdline()
self.cmdline_failsafe = ' '.join(
[self.cmdline, Defaults.get_failsafe_kernel_options()]
)
parameters = {
'search_params': '--file --set=root /boot/' + mbrid.get_id(),
'default_boot': '0',
'kernel_file': kernel,
'initrd_file': initrd,
'boot_options': ' '.join(
[self.cmdline] + self.live_boot_options
),
'failsafe_boot_options': ' '.join(
[self.cmdline_failsafe] + self.live_boot_options
),
'gfxmode': self.gfxmode,
'theme': self.theme,
'boot_timeout': self.timeout,
'title': self.get_menu_entry_title(plain=True),
'bootpath': '/boot/' + self.arch + '/loader',
'boot_directory_name': self.boot_directory_name
}
if self.multiboot:
log.info('--> Using multiboot template')
parameters['hypervisor'] = hypervisor
template = self.grub2.get_multiboot_iso_template(
self.failsafe_boot, self.terminal, self.mediacheck_boot
)
else:
log.info('--> Using standard boot template')
hybrid_boot = True
template = self.grub2.get_iso_template(
self.failsafe_boot, hybrid_boot,
self.terminal, self.mediacheck_boot
)
try:
self.config = template.substitute(parameters)
except Exception as e:
raise KiwiTemplateError(
'%s: %s' % (type(e).__name__, format(e))
)
示例2: setup_disk_image_config
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_failsafe_kernel_options [as 别名]
def setup_disk_image_config(
self, boot_uuid, root_uuid, hypervisor='xen.gz', kernel='linux.vmx',
initrd='initrd.vmx', boot_options=''
):
"""
Create the grub.cfg in memory from a template suitable to boot
from a disk image
:param string boot_uuid: boot device UUID
:param string root_uuid: root device UUID
:param string hypervisor: hypervisor name
:param string kernel: kernel name
:param string initrd: initrd name
:param string boot_options: kernel options as string
"""
log.info('Creating grub2 config file from template')
self.cmdline = ' '.join(
[self.get_boot_cmdline(root_uuid), boot_options]
)
self.cmdline_failsafe = ' '.join(
[self.cmdline, Defaults.get_failsafe_kernel_options(), boot_options]
)
parameters = {
'search_params': ' '.join(['--fs-uuid', '--set=root', boot_uuid]),
'default_boot': '0',
'kernel_file': kernel,
'initrd_file': initrd,
'boot_options': self.cmdline,
'failsafe_boot_options': self.cmdline_failsafe,
'gfxmode': self.gfxmode,
'theme': self.theme,
'boot_timeout': self.timeout,
'title': self.get_menu_entry_title(),
'bootpath': self.bootpath,
'boot_directory_name': self.boot_directory_name
}
if self.multiboot:
log.info('--> Using multiboot disk template')
parameters['hypervisor'] = hypervisor
template = self.grub2.get_multiboot_disk_template(
self.failsafe_boot, self.terminal
)
else:
log.info('--> Using hybrid boot disk template')
template = self.grub2.get_disk_template(
self.failsafe_boot, self.hybrid_boot, self.terminal
)
try:
self.config = template.substitute(parameters)
except Exception as e:
raise KiwiTemplateError(
'%s: %s' % (type(e).__name__, format(e))
)
示例3: post_init
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_failsafe_kernel_options [as 别名]
def post_init(self, custom_args):
"""
zipl post initialization method
:param dict custom_args:
Contains zipl config arguments
.. code:: python
{'targetbase': 'device_name'}
"""
self.custom_args = custom_args
arch = platform.machine()
if 's390' in arch:
self.arch = arch
else:
raise KiwiBootLoaderZiplPlatformError(
'host architecture %s not supported for zipl setup' % arch
)
if not custom_args or 'targetbase' not in custom_args:
raise KiwiBootLoaderZiplSetupError(
'targetbase device name is required for zipl setup'
)
self.bootpath = '.'
self.timeout = self.get_boot_timeout_seconds()
self.cmdline = self.get_boot_cmdline()
self.cmdline_failsafe = ' '.join(
[self.cmdline, Defaults.get_failsafe_kernel_options()]
)
self.target_blocksize = self.xml_state.build_type.get_target_blocksize()
if not self.target_blocksize:
self.target_blocksize = Defaults.get_s390_disk_block_size()
self.target_type = self.xml_state.build_type.get_zipl_targettype()
if not self.target_type:
self.target_type = Defaults.get_s390_disk_type()
self.failsafe_boot = self.failsafe_boot_entry_requested()
self.target_device = custom_args['targetbase']
self.firmware = FirmWare(self.xml_state)
self.target_table_type = self.firmware.get_partition_table_type()
self.zipl = BootLoaderTemplateZipl()
self.config = None
示例4: post_init
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_failsafe_kernel_options [as 别名]
def post_init(self, custom_args):
"""
isolinux post initialization method
Setup class attributes
"""
self.custom_args = custom_args
arch = platform.machine()
if arch == 'x86_64':
self.arch = arch
elif arch == 'i686' or arch == 'i586':
self.arch = 'ix86'
else:
raise KiwiBootLoaderIsoLinuxPlatformError(
'host architecture %s not supported for isolinux setup' % arch
)
self.volume_id = self.xml_state.build_type.get_volid() or \
Defaults.get_volume_id()
self.live_type = self.xml_state.build_type.get_flags()
if not self.live_type:
self.live_type = Defaults.get_default_live_iso_type()
self.live_boot_options = [
'root=live:CDLABEL={0}'.format(self.volume_id),
'rd.live.image'
]
self.install_boot_options = [
'loglevel=0'
]
if self.xml_state.get_initrd_system() == 'dracut':
self.install_boot_options.append(
'root=install:CDLABEL={0}'.format(
Defaults.get_install_volume_id()
)
)
if self.xml_state.build_type.get_hybridpersistent():
self.live_boot_options += \
Defaults.get_live_iso_persistent_boot_options(
self.xml_state.build_type.get_hybridpersistent_filesystem()
)
self.terminal = self.xml_state.build_type.get_bootloader_console()
self.gfxmode = self.get_gfxmode('isolinux')
# isolinux counts the timeout in units of 1/10 sec
self.timeout = self.get_boot_timeout_seconds() * 10
self.cmdline = self.get_boot_cmdline()
self.cmdline_failsafe = ' '.join(
[self.cmdline, Defaults.get_failsafe_kernel_options()]
)
self.failsafe_boot = self.failsafe_boot_entry_requested()
self.mediacheck_boot = self.xml_state.build_type.get_mediacheck()
self.multiboot = False
if self.xml_state.is_xen_server():
self.multiboot = True
self.isolinux = BootLoaderTemplateIsoLinux()
self.config = None
self.config_message = None