X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=312f6eb3a551c7b1d92788692ff7c13297353e6d;hp=42362d6a879039f5a14762d6d571627c46b80998;hb=a70b9388b65c6b231010156242f1758b8c3d5214;hpb=904acb531e17ea1900c9a8300591ba222d521c7e diff --git a/grml2usb b/grml2usb index 42362d6..312f6eb 100755 --- a/grml2usb +++ b/grml2usb @@ -705,6 +705,10 @@ def install_syslinux_mbr(device): @device: device where MBR of syslinux should be installed to""" + # make sure we have syslinux available + if not which("syslinux") and not options.copyonly: + raise Exception("syslinux not available (either install it or consider dropping the --syslinux option)") + # lilo's mbr is broken, use the one from syslinux instead: if not os.path.isfile("/usr/lib/syslinux/mbr.bin"): raise Exception("/usr/lib/syslinux/mbr.bin can not be read") @@ -1564,12 +1568,6 @@ def handle_mbr(device): logging.info("Would install MBR") return 0 - # make sure we have syslinux available - if not which("syslinux") and not options.copyonly: - logging.critical('Sorry, syslinux not available. Exiting.') - logging.critical('Please install syslinux or consider using the --grub option.') - sys.exit(1) - if device[-1:].isdigit(): mbr_device = re.match(r'(.*?)\d*$', device).group(1) partition_number = int(device[-1:]) - 1 @@ -1630,7 +1628,7 @@ def handle_vfat(device): logging.critical("Execution failed: %s", error) sys.exit(1) - if not check_for_usbdevice(device) and not os.path.isdir(device): + if not os.path.isdir(device) and not check_for_usbdevice(device): print "Warning: the specified device %s does not look like a removable usb device." % device f = raw_input("Do you really want to continue? y/N ") if f == "y" or f == "Y":