8000 Merge pull request #811 from dhalbert/3.0_filesystem_writability_on_boot · godlygeek/circuitpython@c4cfd11 · GitHub
[go: up one dir, main page]

Skip to content

Commit c4cfd11

Browse files
authored
Merge pull request adafruit#811 from dhalbert/3.0_filesystem_writability_on_boot
3.0: boot.py change of filesystem writability would get overridden.
2 parents d32349c + 224e245 commit c4cfd11

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ int __attribute__((used)) main(void) {
311311
filesystem_writable_by_python(true);
312312
f_open(fs, boot_output_file, CIRCUITPY_BOOT_OUTPUT_FILE, FA_WRITE | FA_CREATE_ALWAYS);
313313

314+
// Switch the filesystem back to non-writable by Python now instead of later,
315+
// since boot.py might change it back to writable.
316+
filesystem_writable_by_python(false);
317+
314318
// Write version info to boot_out.txt.
315319
mp_hal_stdout_tx_str(MICROPY_FULL_VERSION_INFO);
316320
mp_hal_stdout_tx_str("\r\n");
@@ -327,7 +331,6 @@ int __attribute__((used)) main(void) {
327331
filesystem_flush();
328332
boot_output_file = NULL;
329333
}
330-
filesystem_writable_by_python(false);
331334
#endif
332335

333336
// Reset to remove any state that boot.py setup. It should only be used to

0 commit comments

Comments
 (0)
0