Skip to content

Commit

Permalink
update path handling
Browse files Browse the repository at this point in the history
Signed-off-by: Trecia Agoylo <[email protected]>
  • Loading branch information
tagoylo committed Jun 5, 2024
1 parent 9f713ea commit b2bcf5c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion nebula/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ def update_boot_partition_existing_files(self, subfolder=None):

# extract needed boot files from the kuiper descriptor file
h = helper()
descriptor_path = "nebula/resources/kuiper.json"
path = pathlib.Path(__file__).parent.absolute()
descriptor_path = os.path.join(path, "resources", "kuiper.json")
try:
self._dl_file("/tmp/sdcard/kuiper.json")
os.replace("kuiper.json", descriptor_path)
Expand Down
13 changes: 10 additions & 3 deletions nebula/usbmux.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import glob
import logging
import os
import pathlib
import random
import re
import string
Expand Down Expand Up @@ -287,6 +288,7 @@ def update_rootfs_files_from_external(self, target, destination):

def update_boot_files_from_sdcard_itself(
self,
descriptor_path=None,
bootbin_loc=None,
kernel_loc=None,
devicetree_loc=None,
Expand All @@ -297,6 +299,7 @@ def update_boot_files_from_sdcard_itself(
"""Update the boot files from the SD card itself.
Args:
descriptor_path (str): The path to the kuiper.json.
bootbin_loc (str): The path to the boot.bin file on the SD card.
kernel_loc (str): The path to the kernel file on the SD card.
devicetree_loc (str): The path to the devicetree file on the SD card.
Expand All @@ -306,16 +309,20 @@ def update_boot_files_from_sdcard_itself(
"""
args = locals()
# check if if all loc are still None
if "self" in args:
del args["self"]
del args["self"]
del args["descriptor_path"]
args_status = all(loc is None for loc in args.values())

folder, boot_p = self._mount_sd_card()
preloader_p = f"{self._target_sdcard}3"

if args_status:
h = helper()
descriptor_path = "nebula/resources/kuiper.json"
if descriptor_path:
descriptor_path=descriptor_path
else:
path = pathlib.Path(__file__).parent.absolute()
descriptor_path = os.path.join(path, "resources", "kuiper.json")
try:
kuiperjson_loc = os.path.join("/tmp/", folder, "kuiper.json")
os.path.isfile(kuiperjson_loc)
Expand Down

0 comments on commit b2bcf5c

Please sign in to comment.