本文整理汇总了Python中kiwi.defaults.Defaults.get_preparer方法的典型用法代码示例。如果您正苦于以下问题:Python Defaults.get_preparer方法的具体用法?Python Defaults.get_preparer怎么用?Python Defaults.get_preparer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.defaults.Defaults
的用法示例。
在下文中一共展示了Defaults.get_preparer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_preparer
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_preparer [as 别名]
def test_get_preparer(self):
assert Defaults.get_preparer() == 'KIWI - http://suse.github.com/kiwi'
示例2: create
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_preparer [as 别名]
def create(self):
"""
Build a bootable hybrid live ISO image
Image types which triggers this builder are:
* image="iso"
:raises KiwiLiveBootImageError: if no kernel or hipervisor is found
in boot image tree
:return: result
:rtype: instance of :class:`Result`
"""
# media dir to store CD contents
self.media_dir = mkdtemp(
prefix='live-media.', dir=self.target_dir
)
# unpack cdroot user files to media dir
self.system_setup.import_cdroot_files(self.media_dir)
rootsize = SystemSize(self.media_dir)
# custom iso metadata
log.info('Using following live ISO metadata:')
log.info('--> Application id: {0}'.format(self.mbrid.get_id()))
log.info('--> Publisher: {0}'.format(Defaults.get_publisher()))
log.info('--> Volume id: {0}'.format(self.volume_id))
custom_iso_args = {
'meta_data': {
'publisher': self.publisher,
'preparer': Defaults.get_preparer(),
'volume_id': self.volume_id,
'mbr_id': self.mbrid.get_id(),
'efi_mode': self.firmware.efi_mode()
}
}
# pack system into live boot structure as expected by dracut
log.info(
'Packing system into dracut live ISO type: {0}'.format(
self.live_type
)
)
root_filesystem = Defaults.get_default_live_iso_root_filesystem()
filesystem_custom_parameters = {
'mount_options': self.xml_state.get_fs_mount_option_list()
}
filesystem_setup = FileSystemSetup(
self.xml_state, self.root_dir
)
root_image = NamedTemporaryFile()
loop_provider = LoopDevice(
root_image.name,
filesystem_setup.get_size_mbytes(root_filesystem),
self.xml_state.build_type.get_target_blocksize()
)
loop_provider.create()
live_filesystem = FileSystem(
name=root_filesystem,
device_provider=loop_provider,
root_dir=self.root_dir + os.sep,
custom_args=filesystem_custom_parameters
)
live_filesystem.create_on_device()
log.info(
'--> Syncing data to {0} root image'.format(root_filesystem)
)
live_filesystem.sync_data(
Defaults.get_exclude_list_for_root_data_sync()
)
log.info('--> Creating squashfs container for root image')
self.live_container_dir = mkdtemp(
prefix='live-container.', dir=self.target_dir
)
Path.create(self.live_container_dir + '/LiveOS')
shutil.copy(
root_image.name, self.live_container_dir + '/LiveOS/rootfs.img'
)
live_container_image = FileSystem(
name='squashfs',
device_provider=None,
root_dir=self.live_container_dir
)
container_image = NamedTemporaryFile()
live_container_image.create_on_file(
container_image.name
)
Path.create(self.media_dir + '/LiveOS')
shutil.copy(
container_image.name, self.media_dir + '/LiveOS/squashfs.img'
)
# setup bootloader config to boot the ISO via isolinux
log.info('Setting up isolinux bootloader configuration')
bootloader_config_isolinux = BootLoaderConfig(
'isolinux', self.xml_state, self.media_dir
)
bootloader_config_isolinux.setup_live_boot_images(
#.........这里部分代码省略.........