Example #1
0
    def get_boot_names(self) -> boot_names_type:
        """
        Provides kernel and initrd names for the boot image

        :return:
            Contains boot_names_type tuple

            .. code:: python

                boot_names_type(
                    kernel_name='INSTALLED_KERNEL',
                    initrd_name='DRACUT_OUTPUT_NAME'
                )

        :rtype: boot_names_type
        """
        kernel = Kernel(self.boot_root_directory)
        kernel_info = kernel.get_kernel()
        if not kernel_info:
            if self.xml_state.get_initrd_system() == 'none':
                return boot_names_type(kernel_name='none', initrd_name='none')
            raise KiwiDiskBootImageError(
                'No kernel in boot image tree %s found' %
                self.boot_root_directory)
        dracut_output_format = self._get_boot_image_output_file_format(
            kernel_info.version)
        return boot_names_type(kernel_name=kernel_info.name,
                               initrd_name=dracut_output_format.format(
                                   kernel_version=kernel_info.version))
Example #2
0
 def _get_boot_names(self):
     boot_names_type = namedtuple(
         'boot_names_type', ['kernel_name', 'initrd_name']
     )
     kernel = Kernel(
         self.boot_image.boot_root_directory
     )
     kernel_info = kernel.get_kernel()
     if not kernel_info:
         raise KiwiDiskBootImageError(
             'No kernel in boot image tree %s found' %
             self.boot_image.boot_root_directory
         )
     if self.initrd_system and self.initrd_system == 'dracut':
         dracut_output_format = self._get_dracut_output_file_format()
         return boot_names_type(
             kernel_name=kernel_info.name,
             initrd_name=dracut_output_format.format(
                 kernel_version=kernel_info.version
             )
         )
     else:
         return boot_names_type(
             kernel_name='linux.vmx',
             initrd_name='initrd.vmx'
         )
Example #3
0
File: dracut.py Project: agraf/kiwi
 def get_boot_names(self):
     boot_names_type = namedtuple(
         'boot_names_type', ['kernel_name', 'initrd_name']
     )
     kernel = Kernel(
         self.boot_root_directory
     )
     kernel_info = kernel.get_kernel()
     if not kernel_info:
         raise KiwiDiskBootImageError(
             'No kernel in boot image tree %s found' %
             self.boot_root_directory
         )
     dracut_output_format = self._get_dracut_output_file_format()
     return boot_names_type(
         kernel_name=kernel_info.name,
         initrd_name=dracut_output_format.format(
             kernel_version=kernel_info.version
         )
     )