X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=68565db77718e9162725c120100a68ff32db3907;hp=075029e5bb2a631e3f49ab7463414f9e2f1bbc48;hb=cf525c6031463d42ed8c7f9b84d83e3b2c36f600;hpb=f3a85acbbab6bd1f0140bdf8e7496d983a8a7c15 diff --git a/grml2usb b/grml2usb index 075029e..68565db 100755 --- a/grml2usb +++ b/grml2usb @@ -108,6 +108,8 @@ parser.add_option("--syslinux", dest="syslinux", action="callback", default=True help="install syslinux bootloader (deprecated as it's the default)") parser.add_option("--syslinux-mbr", dest="syslinuxmbr", action="store_true", help="install syslinux master boot record (MBR) instead of default") +parser.add_option("--tmpdir", dest="tmpdir", default="/tmp", + help="directory to be used for temporary files") parser.add_option("--verbose", dest="verbose", action="store_true", help="enable verbose mode") parser.add_option("-v", "--version", dest="version", action="store_true", @@ -1106,8 +1108,16 @@ def identify_grml_flavour(mountpath): version_files = search_file('grml-version', mountpath, lst_return=True) if not version_files: - logging.critical("Error: could not find grml-version file.") - raise + if mountpath.startswith("/live/image"): + logging.critical("Error: could not find grml-version file.") + logging.critical("Looks like your system is running from RAM but required files are not available.") + logging.critical("Please either boot without toram=... or use boot option toram instead of toram=...") + cleanup() + sys.exit(1) + else: + logging.critical("Error: could not find grml-version file.") + cleanup() + sys.exit(1) flavours = [] logging.debug("version_files = %s", version_files) @@ -1429,7 +1439,7 @@ def install(image, device): logging.info("Using %s as install base", image) else: logging.info("Using ISO %s", image) - iso_mountpoint = tempfile.mkdtemp(prefix="grml2usb") + iso_mountpoint = tempfile.mkdtemp(prefix="grml2usb", dir=options.tmpdir) register_tmpfile(iso_mountpoint) remove_image_mountpoint = True try: @@ -1457,7 +1467,7 @@ def install_grml(mountpoint, device): device_mountpoint = device if os.path.isdir(device): - logging.info("Specified device is not a directory, therefore not mounting.") + logging.info("Specified device is a directory, therefore not mounting.") remove_device_mountpoint = False else: device_mountpoint = tempfile.mkdtemp(prefix="grml2usb")