Skip to content

Commit

Permalink
downloader: unzip downloaded file
Browse files Browse the repository at this point in the history
Signed-off-by: Trecia Agoylo <[email protected]>
  • Loading branch information
tagoylo committed Oct 2, 2023
1 parent b55abdb commit 9239136
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 33 deletions.
41 changes: 8 additions & 33 deletions nebula/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down Expand Up @@ -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")

Expand All @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions nebula/resources/board_table.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9239136

Please sign in to comment.