X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=ce0bfd53f6c9955cef3b9d698f8a985cd1e75bb2;hp=9321b985b3ac065d549c944b101e146a345a3f0c;hb=fa02a2b683f0d7ade2d5fb82982f0cbb2200de26;hpb=2b2c97afc1aae8c4a38c31921b21638d27638240 diff --git a/grml2usb b/grml2usb index 9321b98..ce0bfd5 100755 --- a/grml2usb +++ b/grml2usb @@ -107,6 +107,8 @@ parser.add_option("--skip-addons", dest="skipaddons", action="store_true", help="do not install /boot/addons/ files") parser.add_option("--skip-bootflag", dest="skipbootflag", action="store_true", help="do not try to check whether the destination has the bootflag set") +parser.add_option("--skip-usb-check", dest="skipusbcheck", action="store_true", + help="skip check to verify whether given device is removable") parser.add_option("--skip-grub-config", dest="skipgrubconfig", action="store_true", help="skip generation of grub configuration files") parser.add_option("--skip-mbr", dest="skipmbr", action="store_true", @@ -352,6 +354,7 @@ def check_boot_flag(device): boot_dev, x = get_device_from_partition(device) try: + import parted part = get_partition_for_path(device) if part.getFlag(parted.PARTITION_BOOT): logging.debug("bootflag is enabled on %s" % device) @@ -1664,6 +1667,10 @@ def handle_vfat(device): logging.critical("Execution failed: %s", error) sys.exit(1) + if options.skipusbcheck: + logging.info("Not checking for removable USB device as requested via option --skip-usb-check.") + return + if not os.path.isdir(device) and not check_for_usbdevice(device) and not options.force: 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 ")