Skip to content

Commit

Permalink
Skip boot flag check when installing to directory
Browse files Browse the repository at this point in the history
In commit 8b59cb0 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
  • Loading branch information
mika committed Jun 6, 2020
1 parent 57551ca commit 657b880
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions grml2usb
Expand Up @@ -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")
Expand Down

0 comments on commit 657b880

Please sign in to comment.