Skip to content

Commit 07f9605

Browse files
committed
osinstall: Clean up invalid chars in FAT32 volume names
Signed-off-by: Hector Martin <[email protected]>
1 parent 0ab7cf5 commit 07f9605

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/osinstall.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,11 @@ def partition_disk(self, prev, total_size=None):
8585
self.efi_part = info
8686
self.part_info.append(info)
8787
if fmt == "fat":
88+
# Clean up invalid characters in FAT
89+
name_clean = name.translate(str.maketrans("", "", "*?/\\|,;:+=<>[]\""))
8890
p_plain(" Formatting as FAT...")
8991
args = ["newfs_msdos", "-F", "32",
90-
"-v", name[:11]]
92+
"-v", name_clean[:11]]
9193
if "volume_id" in part:
9294
args.extend(["-I", part["volume_id"]])
9395
args.append(f"/dev/r{info.name}")

0 commit comments

Comments
 (0)