def __single_target(self, target: str, config: Config): for defconfig in self.env["configs"]: config_obj = config.parse(defconfig) if target == config_obj["defconfig"].replace("_defconfig", ""): # Generate the legal information first, as to ensure the tarball is in the images # directory before post-image.sh is called. if config_obj["legal_info"]: if not Buildroot.legal_info(config_obj): return False if not Buildroot.build(config_obj): return False if self.clean_after_build: config.clean(force=True) return True Logger.print_error("Could not find target: {}".format(target)) return False
def run(self) -> bool: """Run all the steps.""" single_target = os.environ.get("SINGLE_TARGET", None) self._parse_env() config = Config(self.buildroot_path, self.apply_configs) if self.update: Buildroot.update(self.buildroot_path) for defconfig in self.env["configs"]: config_obj = config.parse(defconfig) if config_obj["skip"]: Logger.print_step("Skipping {}".format( config_obj["defconfig"])) continue if not config.clean(): return False if not config.apply(): return False if single_target: return self.__single_target(single_target, config) for defconfig in self.env["configs"]: config_obj = config.parse(defconfig) if not config_obj["build"] or config_obj["skip"] or self.no_build: Logger.print_step("{}: Skip build step".format( config_obj["defconfig"])) continue # Generate the legal information first, as to ensure the tarball is in the images # directory before post-image.sh is called. if config_obj["legal_info"]: if not Buildroot.legal_info(config_obj): return False if not Buildroot.build(config_obj): return False if self.clean_after_build: config.clean(force=True) return True