- iso_mountpoint = '/mnt/test' # FIXME
- # iso_mount = tempfile.mkdtemp()
- mount(iso, iso_mountpoint, "-o loop -t iso9660", dry_run=options.dryrun)
- # device_mountpoint = '/mnt/usb-sdb1'
- # device_mountpoint = tempfile.mkdtemp()
- device_mountpoint = '/dev/shm/grml2usb' # FIXME
- mount(device, device_mountpoint, "", dry_run=options.dryrun)
+ iso_mountpoint = tempfile.mkdtemp()
+ remove_iso_mountpoint = True
+ mount(iso, iso_mountpoint, ["-o", "loop", "-t", "iso9660"])
+
+ if os.path.isdir(device):
+ logging.debug("Specified target is a directory, not mounting therefore.")
+ device_mountpoint = device
+ remove_device_mountpoint = False
+ skip_mbr = True
+
+ else:
+ device_mountpoint = tempfile.mkdtemp()
+ remove_device_mountpoint = True
+ mount(device, device_mountpoint, "")