From: Michael Prokop Date: Sat, 6 Jun 2020 10:26:15 +0000 (+0200) Subject: Skip boot flag check when installing to directory X-Git-Tag: v0.18.2~1 X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=commitdiff_plain;h=657b880f0229f3e11d7eff07f0b285bf708606ff Skip boot flag check when installing to directory In commit 8b59cb0b5c0cfa the check_boot_flag was moved from install_grml() to main(), though inside install_grml() we had the special casing whether the target is a directory or not. To avoid having to add this check before any possible check_boot_flag() invocation (and possibly forget about it), add this check to the implementation of check_boot_flag(). Fixes: | % sudo grml2usb --tmpdir=/tmp/grml2iso.tmp grml64-small_2020.06-rc1.iso grml32-small_2020.06-rc1.iso /tmp/grml2iso.tmp/cddir | Executing grml2usb version 0.18.1 | Checking for boot flag | Fatal: /tmp/grml2iso.tmp/cddir: unrecognised disk label --- diff --git a/grml2usb b/grml2usb index 6a8ada2..749fcd1 100755 --- a/grml2usb +++ b/grml2usb @@ -503,6 +503,12 @@ def get_partition_for_path(path): def check_boot_flag(device): + if os.path.isdir(device): + logging.debug( + "Device %s is a directory, skipping check for boot flag." % device + ) + return + boot_dev, x = get_device_from_partition(device) logging.info("Checking for boot flag")