We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4693e43 commit 008fd37Copy full SHA for 008fd37
boot.py
@@ -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
19
20
+attempts = 0
21
+while attempts < 5:
22
+ attempts += 1
23
+ try:
24
+ for path in mount_points:
25
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