Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions boot.py
Original file line number Diff line number Diff line change
@@ -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")
Loading