def BuildAndArchiveFactoryImages(): """Build and archive the factory zip file. The factory zip file consists of the factory toolkit and the factory install image. Both are built here. """ # Build factory install image and create a symlink to it. factory_install_symlink = None if 'factory_install' in config['images']: logging.info('Running commands.BuildFactoryInstallImage') alias = commands.BuildFactoryInstallImage( buildroot, board, extra_env) factory_install_symlink = self.GetImageDirSymlink(alias) if config['factory_install_netboot']: logging.info('Running commands.MakeNetboot') commands.MakeNetboot(buildroot, board, factory_install_symlink) # Build and upload factory zip if needed. if factory_install_symlink or config['factory_toolkit']: logging.info('Running commands.BuildFactoryZip') filename = commands.BuildFactoryZip( buildroot, board, archive_path, factory_install_symlink, self._run.attrs.release_tag) self._release_upload_queue.put([filename])
def CreateFactoryZip(self): """Create/publish the firmware build artifact for the current board.""" logging.info('Create factory_image.zip') # TODO: Move this image creation logic back into WorkspaceBuildImages. factory_install_symlink = None if 'factory_install' in self._run.config['images']: alias = commands.BuildFactoryInstallImage( self._build_root, self._current_board, extra_env=self._portage_extra_env) factory_install_symlink = self.GetImageDirSymlink( alias, self._build_root) if self._run.config['factory_install_netboot']: commands.MakeNetboot(self._build_root, self._current_board, factory_install_symlink) # Build and upload factory zip if needed. assert self._run.config['factory_toolkit'] with osutils.TempDir(prefix='factory_zip') as zip_dir: filename = commands.BuildFactoryZip(self._build_root, self._current_board, zip_dir, factory_install_symlink, self.dummy_version) self.UploadDummyArtifact(os.path.join(zip_dir, filename))
def BuildAndArchiveFactoryImages(): """Build and archive the factory zip file. The factory zip file consists of the factory toolkit and the factory install image. Both are built here. """ # Build factory install image and create a symlink to it. factory_install_symlink = None if 'factory_install' in config['images']: alias = commands.BuildFactoryInstallImage( buildroot, board, extra_env) factory_install_symlink = self.GetImageDirSymlink(alias) if config['factory_install_netboot']: commands.MakeNetboot(buildroot, board, factory_install_symlink) # Build the factory toolkit. chroot_dir = os.path.join(buildroot, constants.DEFAULT_CHROOT_DIR) chroot_tmp_dir = os.path.join(chroot_dir, 'tmp') with osutils.TempDir(base_dir=chroot_tmp_dir, sudo_rm=True) as tempdir: # Build the factory toolkit. if config['factory_toolkit']: toolkit_dir = os.path.join(tempdir, 'factory_toolkit') os.makedirs(toolkit_dir) commands.MakeFactoryToolkit(buildroot, board, toolkit_dir, self._run.attrs.release_tag) # Build and upload factory zip if needed. if factory_install_symlink or config['factory_toolkit']: filename = commands.BuildFactoryZip( buildroot, board, archive_path, factory_install_symlink, toolkit_dir, self._run.attrs.release_tag) self._release_upload_queue.put([filename])