summaryrefslogtreecommitdiffhomepage
path: root/tooling
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-04-23 22:27:47 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-04-23 22:27:47 +0200
commitb55d3ac738b40677c579221b4f0dbf294dc3b017 (patch)
tree2ce2089d58f1d5d1bfca642442e20c2b4ad8255c /tooling
parent46d60a746e86270e0f2a66f724e809fca32679c0 (diff)
dev, kernel: necessary refactors regarding future changes.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'tooling')
-rwxr-xr-xtooling/mk_img.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tooling/mk_img.py b/tooling/mk_img.py
index b4fdfa1e..4a663bc0 100755
--- a/tooling/mk_img.py
+++ b/tooling/mk_img.py
@@ -17,11 +17,15 @@ def copy_to_fat(image_path, source_dir):
try:
files_to_copy = glob.glob(os.path.join(source_dir, "*"))
- # Now build the command
+
+ if not files_to_copy:
+ print(f"Warning: No files found in {source_dir}. Nothing to copy.")
+ return
+
command = ["mcopy", "-spm", "-i", image_path] + files_to_copy + ["::"]
subprocess.run(command, check=True)
- print(f"Successfully copied contents of '{source_dir}' into '{image_path}'")
+ print(f"Info: Successfully copied contents of '{source_dir}' into '{image_path}'")
except FileNotFoundError:
print("Error: mcopy is not installed. Please install mtools.")
sys.exit(1)
@@ -29,7 +33,7 @@ def copy_to_fat(image_path, source_dir):
print(f"Error: mcopy failed with error code {e.returncode}.")
sys.exit(1)
except Exception as e:
- print(f"mcopy failed: {e}")
+ print(f"Error: mcopy: {e}")
sys.exit(1)
if __name__ == "__main__":