def _create_pxe_install_kernel_and_initrd(self): kernel = Kernel(self.boot_image_task.boot_root_directory) if kernel.get_kernel(): kernel.copy_kernel(self.pxe_dir, '/pxeboot.kernel') os.symlink( 'pxeboot.kernel', ''.join([ self.pxe_dir, '/', self.xml_state.xml_data.get_name(), '.kernel' ])) else: raise KiwiInstallBootImageError( 'No kernel in boot image tree %s found' % self.boot_image_task.boot_root_directory) if self.xml_state.is_xen_server(): if kernel.get_xen_hypervisor(): kernel.copy_xen_hypervisor(self.pxe_dir, '/pxeboot.xen.gz') else: raise KiwiInstallBootImageError( 'No hypervisor in boot image tree %s found' % self.boot_image_task.boot_root_directory) if self.initrd_system == 'dracut': self._create_dracut_install_config() self._add_system_image_boot_options_to_boot_image() self.boot_image_task.create_initrd(self.mbrid, 'initrd_kiwi_install') Command.run([ 'mv', self.boot_image_task.initrd_filename, self.pxe_dir + '/pxeboot.initrd.xz' ]) os.chmod(self.pxe_dir + '/pxeboot.initrd.xz', 420)
def _create_iso_install_kernel_and_initrd(self): boot_path = self.media_dir + '/boot/' + self.arch + '/loader' Path.create(boot_path) kernel = Kernel(self.boot_image_task.boot_root_directory) if kernel.get_kernel(): kernel.copy_kernel(boot_path, '/linux') else: raise KiwiInstallBootImageError( 'No kernel in boot image tree %s found' % self.boot_image_task.boot_root_directory ) if self.machine and self.machine.get_domain() == 'dom0': if kernel.get_xen_hypervisor(): kernel.copy_xen_hypervisor(boot_path, '/xen.gz') else: raise KiwiInstallBootImageError( 'No hypervisor in boot image tree %s found' % self.boot_image_task.boot_root_directory ) self.boot_image_task.create_initrd(self.mbrid) Command.run( [ 'mv', self.boot_image_task.initrd_filename, boot_path + '/initrd' ] )
def _create_iso_install_kernel_and_initrd(self): boot_path = self.media_dir + '/boot/' + self.arch + '/loader' Path.create(boot_path) kernel = Kernel(self.boot_image_task.boot_root_directory) if kernel.get_kernel(): kernel.copy_kernel(boot_path, '/linux') else: raise KiwiInstallBootImageError( 'No kernel in boot image tree %s found' % self.boot_image_task.boot_root_directory) if self.xml_state.is_xen_server(): if kernel.get_xen_hypervisor(): kernel.copy_xen_hypervisor(boot_path, '/xen.gz') else: raise KiwiInstallBootImageError( 'No hypervisor in boot image tree %s found' % self.boot_image_task.boot_root_directory) if self.initrd_system == 'dracut': self._create_dracut_install_config() self._add_system_image_boot_options_to_boot_image() self.boot_image_task.create_initrd(self.mbrid, 'initrd_kiwi_install', install_initrd=True) Command.run([ 'mv', self.boot_image_task.initrd_filename, boot_path + '/initrd' ])
def _create_iso_install_kernel_and_initrd(self) -> None: boot_path = self.media_dir.name + '/boot/' + self.arch + '/loader' Path.create(boot_path) kernel = Kernel(self.boot_image_task.boot_root_directory) if kernel.get_kernel(): kernel.copy_kernel(boot_path, '/linux') else: raise KiwiInstallBootImageError( 'No kernel in boot image tree %s found' % self.boot_image_task.boot_root_directory) if self.xml_state.is_xen_server(): if kernel.get_xen_hypervisor(): kernel.copy_xen_hypervisor(boot_path, '/xen.gz') else: raise KiwiInstallBootImageError( 'No hypervisor in boot image tree %s found' % self.boot_image_task.boot_root_directory) if self.initrd_system == 'dracut': self.boot_image_task.include_module('kiwi-dump') self.boot_image_task.include_module('kiwi-dump-reboot') if self.root_filesystem_is_multipath is False: self.boot_image_task.omit_module('multipath') for mod in self.xml_state.get_installmedia_initrd_modules('add'): self.boot_image_task.include_module(mod) for mod in self.xml_state.get_installmedia_initrd_modules('omit'): self.boot_image_task.omit_module(mod) self.boot_image_task.set_static_modules( self.xml_state.get_installmedia_initrd_modules('set')) self._add_system_image_boot_options_to_boot_image() self.boot_image_task.create_initrd(self.mbrid, 'initrd_kiwi_install', install_initrd=True) Command.run([ 'mv', self.boot_image_task.initrd_filename, boot_path + '/initrd' ])
def _create_pxe_install_kernel_and_initrd(self): kernelname = 'pxeboot.{0}.kernel'.format(self.pxename) initrdname = 'pxeboot.{0}.initrd.xz'.format(self.pxename) kernel = Kernel(self.boot_image_task.boot_root_directory) if kernel.get_kernel(): kernel.copy_kernel(self.pxe_dir, kernelname) os.symlink(kernelname, ''.join([self.pxe_dir, '/', self.pxename, '.kernel'])) else: raise KiwiInstallBootImageError( 'No kernel in boot image tree %s found' % self.boot_image_task.boot_root_directory) if self.xml_state.is_xen_server(): if kernel.get_xen_hypervisor(): kernel.copy_xen_hypervisor( self.pxe_dir, '/pxeboot.{0}.xen.gz'.format(self.pxename)) else: raise KiwiInstallBootImageError( 'No hypervisor in boot image tree %s found' % self.boot_image_task.boot_root_directory) if self.initrd_system == 'dracut': self.boot_image_task.include_module('kiwi-dump', install_media=True) if self.root_filesystem_is_multipath is False: self.boot_image_task.omit_module('multipath', install_media=True) self._add_system_image_boot_options_to_boot_image() self.boot_image_task.create_initrd(self.mbrid, 'initrd_kiwi_install', install_initrd=True) Command.run([ 'mv', self.boot_image_task.initrd_filename, self.pxe_dir + '/{0}'.format(initrdname) ]) os.chmod(self.pxe_dir + '/{0}'.format(initrdname), 420)
def _create_pxe_install_kernel_and_initrd(self): kernel = Kernel(self.boot_image_task.boot_root_directory) if kernel.get_kernel(): kernel.copy_kernel(self.pxe_dir, '/pxeboot.kernel') else: raise KiwiInstallBootImageError( 'No kernel in boot image tree %s found' % self.boot_image_task.boot_root_directory) if self.xml_state.is_xen_server(): if kernel.get_xen_hypervisor(): kernel.copy_xen_hypervisor(self.pxe_dir, '/pxeboot.xen.gz') else: raise KiwiInstallBootImageError( 'No hypervisor in boot image tree %s found' % self.boot_image_task.boot_root_directory) self.boot_image_task.create_initrd(self.mbrid) Command.run([ 'mv', self.boot_image_task.initrd_filename, self.pxe_dir + '/pxeboot.initrd.xz' ])