From 008fd3791124a100f43012e8f791f67c952cbc71 Mon Sep 17 00:00:00 2001 From: Nate Gay Date: Tue, 15 Apr 2025 15:22:32 -0500 Subject: [PATCH] Create mount points in boot.py --- boot.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/boot.py b/boot.py index e69de29..8657e1a 100644 --- a/boot.py +++ b/boot.py @@ -0,0 +1,38 @@ +import os +import time + +import storage + +mount_points = [ + "/sd", +] + +wait_time = 0.02 + +storage.disable_usb_drive() +print("Disabling USB drive") +time.sleep(wait_time) + +storage.remount("/", False) +print("Remounting root filesystem") +time.sleep(wait_time) + +attempts = 0 +while attempts < 5: + attempts += 1 + try: + for path in mount_points: + try: + os.mkdir(path) + print(f"Mount point {path} created.") + except OSError: + print(f"Mount point {path} already exists.") + except Exception as e: + print(f"Error creating mount point {path}: {e}") + time.sleep(wait_time) + continue + + break + +storage.enable_usb_drive() +print("Enabling USB drive")