本文整理汇总了Python中kiwi.defaults.Defaults.get_unsigned_grub_loader方法的典型用法代码示例。如果您正苦于以下问题:Python Defaults.get_unsigned_grub_loader方法的具体用法?Python Defaults.get_unsigned_grub_loader怎么用?Python Defaults.get_unsigned_grub_loader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.defaults.Defaults
的用法示例。
在下文中一共展示了Defaults.get_unsigned_grub_loader方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setup_efi_image
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_unsigned_grub_loader [as 别名]
def _setup_efi_image(self, uuid=None, mbrid=None, lookup_path=None):
"""
Provide the unsigned grub2 efi image in the required boot path
If a prebuilt efi image as provided by the distribution could
be found, this image will be used. If no such image could be
found we create a custom image with a pre defined set of
grub modules
"""
if not lookup_path:
lookup_path = self.root_dir
grub_image = Defaults.get_unsigned_grub_loader(lookup_path)
if grub_image:
log.info('--> Using prebuilt unsigned efi image')
Command.run(
['cp', grub_image, self._get_efi_image_name()]
)
self._create_efi_config_search(uuid, mbrid)
else:
log.info('--> Creating unsigned efi image')
self._create_efi_image(
uuid, mbrid, lookup_path
)
示例2: test_get_unsigned_grub_loader
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_unsigned_grub_loader [as 别名]
def test_get_unsigned_grub_loader(self, mock_glob):
mock_glob.return_value = ['/usr/lib/grub2/x86_64-efi/grub.efi']
assert Defaults.get_unsigned_grub_loader('root') == \
mock_glob.return_value.pop()
mock_glob.assert_called_once_with('root/usr/lib/grub*/*-efi/grub.efi')