Example #1
0
 def _debian_firmware(self, name):
     """integrate Debian non free firmware"""
     temp_initrd = os.path.join(self.temp, 'initrd')
     initrd = os.path.join(self.cfg['paths']['tftpboot'], 'seedbank', name,
         'initrd.gz')
     utils.make_dirs(temp_initrd)
     utils.initrd_extract(temp_initrd, initrd)
     dst = os.path.join(self.temp, 'initrd/lib/firmware')
     self._add_firmware(name, dst)
     utils.initrd_create(temp_initrd, initrd)
     utils.rmtree(temp_initrd)
Example #2
0
 def _debian_firmware(self, name):
     """integrate Debian non free firmware"""
     temp_initrd = os.path.join(self.temp, 'initrd')
     initrd = os.path.join(self.cfg['paths']['tftpboot'], 'seedbank', name,
                           'initrd.gz')
     utils.make_dirs(temp_initrd)
     utils.initrd_extract(temp_initrd, initrd)
     dst = os.path.join(self.temp, 'initrd/lib/firmware')
     self._add_firmware(name, dst)
     self._disable_usb(temp_initrd)
     utils.initrd_create(temp_initrd, initrd)
     utils.rmtree(temp_initrd)
Example #3
0
    def rebuild_initrd(self):
        """rebuild the initrd image"""
        path_amd = os.path.join(self.work_iso, 'install.amd')
        path_i386 = os.path.join(self.work_iso, 'install.386')
        path_ubuntu = os.path.join(self.work_iso, 'install')

        if os.path.isdir(path_amd):
            self.data['architecture'] = 'amd'
            path = path_amd
        elif os.path.isdir(path_i386):
            self.data['architecture'] = '386'
            path = path_i386
        elif os.path.isdir(path_ubuntu):
            path = path_ubuntu
        else:
            path = self.work_iso

        initrd = os.path.join(path, 'initrd.gz')
        utils.initrd_extract(self.work_initrd, initrd)
        utils.initrd_create(self.work_initrd, initrd)
Example #4
0
    def rebuild_initrd(self):
        """rebuild the initrd image"""
        path_amd = os.path.join(self.work_iso, 'install.amd')
        path_i386 = os.path.join(self.work_iso, 'install.386')
        path_ubuntu = os.path.join(self.work_iso, 'install')

        if os.path.isdir(path_amd):
            self.data['architecture'] = 'amd'
            path = path_amd
        elif os.path.isdir(path_i386):
            self.data['architecture'] = '386'
            path = path_i386
        elif os.path.isdir(path_ubuntu):
            path = path_ubuntu
        else:
            path = self.work_iso

        initrd = os.path.join(path, 'initrd.gz')
        utils.initrd_extract(self.work_initrd, initrd)
        utils.initrd_create(self.work_initrd, initrd)
Example #5
0
 def _debian_firmware(self, target):
     """download and integrate the debian non free firmware"""
     distribution, release, _ = target.split('-')
     path = 'firmware-' + distribution + '-' + release
     dst = os.path.join(self.cfg['paths']['archives'], path)
     temp_initrd = os.path.join(self.temp, 'initrd')
     temp_firmware = os.path.join(self.temp, 'firmware')
     firmware = os.path.join(dst, 'firmware.tar.gz')
     initrd = os.path.join(self.cfg['paths']['tftpboot'], 'seedbank', target,
         'initrd.gz')
     url = self.cfg['urls']['debian_firmware'].replace('${release}', release)
     self._download(url, dst)
     utils.untar(firmware, temp_firmware)
     self._extract_debs(temp_firmware)
     utils.make_dirs(temp_initrd)
     utils.initrd_extract(temp_initrd, initrd)
     src = os.path.join(temp_firmware, 'temp', 'lib/firmware')
     dst = os.path.join(self.temp, 'initrd/lib/firmware')
     utils.file_move(src, dst)
     self._disable_usb(temp_initrd)
     utils.initrd_create(temp_initrd, initrd)
Example #6
0
    def add_preseed(self, contents):
        """add the seed file to the intrd image"""
        dst = os.path.join(self.work_initrd, 'preseed.cfg')
        utils.file_write(dst, contents)
        path_amd = os.path.join(self.work_iso, 'install.amd')
        path_i386 = os.path.join(self.work_iso, 'install.386')
        path_ubuntu = os.path.join(self.work_iso, 'install')

        if os.path.isdir(path_amd):
            self.data['architecture'] = 'amd'
            path = path_amd
        elif os.path.isdir(path_i386):
            self.data['architecture'] = '386'
            path = path_i386
        elif os.path.isdir(path_ubuntu):
            path = path_ubuntu
        else:
            path = self.work_iso

        initrd = os.path.join(path, 'initrd.gz')
        utils.initrd_extract(self.work_initrd, initrd)
        utils.initrd_create(self.work_initrd, initrd)