Skip to content

Commit dd3a665

Browse files
committed
Add a boot.py to auto-create /sd at boot time
1 parent 8741b57 commit dd3a665

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

examples/camera/boot.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SPDX-FileCopyrightText: 2023 Jeff Epler for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
"""Automatically create the /sd mount point at boot time"""
6+
7+
import os
8+
import storage
9+
10+
storage.remount("/", readonly=False)
11+
12+
try:
13+
os.mkdir("/sd")
14+
except OSError:
15+
pass # It's probably 'file exists', OK to ignore
16+
17+
storage.remount("/", readonly=True)

0 commit comments

Comments
 (0)