Skip to content

Commit 056ca32

Browse files
committed
supervisor: Create sd/placeholder.txt
.. so that a freshly formatted CP device can mount an SD card at `/sd`.
1 parent 616b14f commit 056ca32

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

supervisor/shared/filesystem.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ bool filesystem_init(bool create_allowed, bool force_create) {
140140
// https://specifications.freedesktop.org/trash-spec/trashspec-latest.html
141141
#endif
142142

143+
#if CIRCUITPY_SDCARDIO || CIRCUITPY_SDIOIO
144+
res = f_mkdir(&vfs_fat->fatfs, "/sd");
145+
MAKE_FILE_WITH_OPTIONAL_CONTENTS(&vfs_fat->fatfs, "/sd/placeholder.txt",
146+
"This placeholder file allows mounting an SD card at /sd\n");
147+
#endif
148+
143149
#if CIRCUITPY_OS_GETENV
144150
make_empty_file(&vfs_fat->fatfs, "/settings.toml");
145151
#endif

0 commit comments

Comments
 (0)