Introduce skip-usb-check
authorLukas Prokop <admin@lukas-prokop.at>
Tue, 24 Feb 2015 22:52:08 +0000 (23:52 +0100)
committerMichael Prokop <mika@grml.org>
Wed, 25 Feb 2015 08:56:21 +0000 (09:56 +0100)
grml2usb

index 5ac0f5c..d09e510 100755 (executable)
--- 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")
                   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",
 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",
@@ -1665,6 +1667,9 @@ def handle_vfat(device):
             logging.critical("Execution failed: %s", error)
             sys.exit(1)
 
             logging.critical("Execution failed: %s", error)
             sys.exit(1)
 
+    if options.skipusbcheck:
+        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 ")
     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 ")