esp32/modules/inisetup.py: Format partition as FAT if its label is ffat.

Signed-off-by: Wind-stormger <storm-wind@foxmail.com>
This commit is contained in:
Wind-stormger 2023-06-20 09:28:28 +00:00 committed by Damien George
parent 2ede7c6c21
commit 23fe170da4

View File

@ -37,8 +37,12 @@ by firmware programming).
def setup():
check_bootsec()
print("Performing initial setup")
os.VfsLfs2.mkfs(bdev)
vfs = os.VfsLfs2(bdev)
if bdev.info()[4] == "vfs":
os.VfsLfs2.mkfs(bdev)
vfs = os.VfsLfs2(bdev)
elif bdev.info()[4] == "ffat":
os.VfsFat.mkfs(bdev)
vfs = os.VfsFat(bdev)
os.mount(vfs, "/")
with open("boot.py", "w") as f:
f.write(