Hello - I understand how to change the USB drive name using the storage and remount in boot.py.
However, I'd like to change it in the CP source and recompile? If possible, in which CP source file would I need to change?
Thank you -
Change name of CIRCUITPY Drive
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- neradoc
- Posts: 542
- Joined: Wed Apr 27, 2016 2:38 pm
Re: Change name of CIRCUITPY Drive
You can define CIRCUITPY_DRIVE_LABEL in a board's mpconfigboard.h, see for example:
https://github.com/adafruit/circuitpyth ... oard.h#L16
It will only change when the drive if formatted from Circuitpython (on first install from a unformatted flash or using storage.erase_filesystem()).
Note that you can also change the name from the host computer side.
https://github.com/adafruit/circuitpyth ... oard.h#L16
It will only change when the drive if formatted from Circuitpython (on first install from a unformatted flash or using storage.erase_filesystem()).
Note that you can also change the name from the host computer side.
- puttley
- Posts: 14
- Joined: Wed Sep 21, 2022 10:42 am
Re: Change name of CIRCUITPY Drive
Perfect -- thanks so much.
- tannewt
- Posts: 3304
- Joined: Thu Oct 06, 2016 8:48 pm
Re: Change name of CIRCUITPY Drive
The name is the file system label and you can set it at runtime. CircuitPython only sets it when creating the filesystem. I've done it from boot.py with:
Code: Select all
import storage
storage.remount("/", readonly=False)
storage.getmount("/").label = "FEATHER"
storage.remount("/", readonly=True)
Please be positive and constructive with your questions and comments.