Skip to content

Commit 008fd37

Browse files
committed
Create mount points in boot.py
1 parent 4693e43 commit 008fd37

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

boot.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import os
2+
import time
3+
4+
import storage
5+
6+
mount_points = [
7+
"/sd",
8+
]
9+
10+
wait_time = 0.02
11+
12+
storage.disable_usb_drive()
13+
print("Disabling USB drive")
14+
time.sleep(wait_time)
15+
16+
storage.remount("/", False)
17+
print("Remounting root filesystem")
18+
time.sleep(wait_time)
19+
20+
attempts = 0
21+
while attempts < 5:
22+
attempts += 1
23+
try:
24+
for path in mount_points:
25+
try:
26+
os.mkdir(path)
27+
print(f"Mount point {path} created.")
28+
except OSError:
29+
print(f"Mount point {path} already exists.")
30+
except Exception as e:
31+
print(f"Error creating mount point {path}: {e}")
32+
time.sleep(wait_time)
33+
continue
34+
35+
break
36+
37+
storage.enable_usb_drive()
38+
print("Enabling USB drive")

0 commit comments

Comments
 (0)