From 9239136290ebc472ebfd9f9abd1291d0ae5ef2a6 Mon Sep 17 00:00:00 2001 From: Trecia Agoylo Date: Mon, 2 Oct 2023 12:50:26 +0800 Subject: [PATCH] downloader: unzip downloaded file Signed-off-by: Trecia Agoylo --- nebula/downloader.py | 41 ++++++------------------------- nebula/resources/board_table.yaml | 8 ++++++ 2 files changed, 16 insertions(+), 33 deletions(-) diff --git a/nebula/downloader.py b/nebula/downloader.py index 99e18f2a..869a2b3c 100644 --- a/nebula/downloader.py +++ b/nebula/downloader.py @@ -673,14 +673,7 @@ def _get_files_rpi( module_files = [tarinfo for tarinfo in tf.getmembers()] tf.extractall(path=dest, members=module_files) - def _get_files_noos( - self, - source, - source_root, - branch, - project, - platform - ): + def _get_files_noos(self, source, source_root, branch, project, platform): dest = "outs" if not os.path.isdir(dest): os.mkdir(dest) @@ -691,12 +684,12 @@ def _get_files_noos( url = url_template.format(source_root, branch, "", "", "") build_date = get_newest_folder(listFD(url)) url = url_template.format( - source_root, branch, build_date, platform, project+".zip" + source_root, branch, build_date, platform, project + ".zip" ) log.info(url) - file = os.path.join(dest, project+".zip") + file = os.path.join(dest, project + ".zip") self.download(url, file) - #unzip the files + # unzip the files shutil.unpack_archive(file, dest) def _get_files( @@ -748,6 +741,8 @@ def _get_files( elif "RPI" in details["carrier"]: kernel = kernel modules = modules + elif details["carrier"] in ["Maxim", "ADICUP"]: + pass else: raise Exception("Carrier not supported") @@ -769,11 +764,7 @@ def _get_files( if noos: self._get_files_noos( - source, - source_root, - branch, - noos_project, - platform + source, source_root, branch, noos_project, platform ) if microblaze: @@ -882,23 +873,7 @@ def download_boot_files( noos_project = self.no_os_project platform = self.platform - # if noos: - # res = os.path.join(path, "resources", "noOS_projects.yaml") - # with open(res) as f: - # noos_projects = yaml.load(f, Loader=yaml.FullLoader) - # val = [] - # for project in noos_projects: - # hdl_projects = noos_projects[project] - # if hdl_projects is not None: - # for hdl_project in hdl_projects: - # if hdl_project == hdl_folder: - # val.append(hdl_project) - # log.info("No-OS project:" + project) - - # if not val: - # raise Exception("Design has no support!") - # else: - #assert design_name in board_configs, "Invalid design name" + assert design_name in board_configs, "Invalid design name" if not firmware: matched = re.match("v[0-1].[0-9][0-9]", branch) diff --git a/nebula/resources/board_table.yaml b/nebula/resources/board_table.yaml index fc4d095f..f57593f1 100644 --- a/nebula/resources/board_table.yaml +++ b/nebula/resources/board_table.yaml @@ -475,3 +475,11 @@ dc1962c: carrier: RPI dc2873a: carrier: RPI + +# ADD no-OS boards +max32650_adxl355: + carrier: Maxim +max78000_adt7420: + carrier: Maxim +aducm3029_adxrs290: + carrier: ADICUP \ No newline at end of file