当前位置: 首页>>代码示例>>Python>>正文


Python Defaults.get_live_iso_persistent_boot_options方法代码示例

本文整理汇总了Python中kiwi.defaults.Defaults.get_live_iso_persistent_boot_options方法的典型用法代码示例。如果您正苦于以下问题:Python Defaults.get_live_iso_persistent_boot_options方法的具体用法?Python Defaults.get_live_iso_persistent_boot_options怎么用?Python Defaults.get_live_iso_persistent_boot_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kiwi.defaults.Defaults的用法示例。


在下文中一共展示了Defaults.get_live_iso_persistent_boot_options方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: post_init

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_live_iso_persistent_boot_options [as 别名]
    def post_init(self, custom_args):
        """
        grub2 post initialization method

        :param dict custom_args:
            Contains grub config arguments

            .. code:: python

                {'grub_directory_name': 'grub|grub2'}
        """
        self.custom_args = custom_args
        arch = platform.machine()
        if arch == 'x86_64':
            # grub2 support for bios and efi systems
            self.arch = arch
        elif arch.startswith('ppc64'):
            # grub2 support for ofw and opal systems
            self.arch = arch
        elif arch == 'i686' or arch == 'i586':
            # grub2 support for bios systems
            self.arch = 'ix86'
        elif arch == 'aarch64' or arch.startswith('arm'):
            # grub2 support for efi systems
            self.arch = arch
        else:
            raise KiwiBootLoaderGrubPlatformError(
                'host architecture %s not supported for grub2 setup' % arch
            )

        if self.custom_args and 'grub_directory_name' in self.custom_args:
            self.boot_directory_name = self.custom_args['grub_directory_name']
        else:
            self.boot_directory_name = 'grub'

        self.terminal = self.xml_state.build_type.get_bootloader_console() \
            or 'gfxterm'
        self.gfxmode = self.get_gfxmode('grub2')
        self.bootpath = self.get_boot_path()
        self.theme = self.get_boot_theme()
        self.timeout = self.get_boot_timeout_seconds()
        self.failsafe_boot = self.failsafe_boot_entry_requested()
        self.mediacheck_boot = self.xml_state.build_type.get_mediacheck()
        self.xen_guest = self.xml_state.is_xen_guest()
        self.firmware = FirmWare(
            self.xml_state
        )

        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.volume_id = self.xml_state.build_type.get_volid() or \
            Defaults.get_volume_id()

        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()
                )

        if self.xml_state.is_xen_server():
            self.hybrid_boot = False
            self.multiboot = True
        elif self.xen_guest:
            self.hybrid_boot = False
            self.multiboot = False
        else:
            self.hybrid_boot = True
            self.multiboot = False

        self.grub2 = BootLoaderTemplateGrub2()
        self.config = None
        self.efi_boot_path = None
        self.cmdline_failsafe = None
        self.cmdline = None
        self.iso_boot = False
        self.shim_fallback_setup = False
开发者ID:adrianschroeter,项目名称:kiwi,代码行数:93,代码来源:grub2.py

示例2: post_init

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_live_iso_persistent_boot_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
开发者ID:AdamMajer,项目名称:kiwi-ng,代码行数:64,代码来源:isolinux.py


注:本文中的kiwi.defaults.Defaults.get_live_iso_persistent_boot_options方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。