From 8b59cb0b5c0cfaab6ea5f1ed29190d74726eb9b5 Mon Sep 17 00:00:00 2001 From: Darshaka Pathirana Date: Wed, 3 Jun 2020 14:44:11 +0200 Subject: [PATCH] Check for boot flag before possibly creating FAT16 on the partition Checks should be performed before actually modifying the USB device, if the user specified `--fat16` then the boot flag should be checked *before* the FAT filesystem gets created. check_for_fat(device) is called in handle_vfat(device) (if device is present and not a directory and if option 'syslinux' (default) is set) so it should be safe to remove check_for_fat(device) call in install_grml(). The same applies to check_boot_flag() which should happen before actually creating the FAT filesystem (in handle_vfat()). Closes: grml/grml2usb#30 --- grml2usb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/grml2usb b/grml2usb index fdc0cac..70d5142 100755 --- a/grml2usb +++ b/grml2usb @@ -1875,10 +1875,6 @@ def install_grml(mountpoint, device): register_tmpfile(device_mountpoint) remove_device_mountpoint = True try: - check_for_fat(device) - if not options.skipbootflag: - check_boot_flag(device) - set_rw(device) mount(device, device_mountpoint, ["-o", "utf8,iocharset=iso8859-1"]) except CriticalException: @@ -2163,6 +2159,9 @@ def main(): # provide upgrade path handle_compat_warning(device) + if not options.skipbootflag: + check_boot_flag(device) + # check for vfat partition handle_vfat(device) -- 2.1.4