Exit with better error message if running with toram=... and invoking with /live...
authorMichael Prokop <mika@grml.org>
Tue, 11 Sep 2012 14:09:20 +0000 (16:09 +0200)
committerMichael Prokop <mika@grml.org>
Tue, 11 Sep 2012 15:01:16 +0000 (17:01 +0200)
If running in RAM mode without all the files in /live/image
(happens if using boot option "toram=....squashfs", but NOT when
using just "toram"!) then there are several files missing. We
could use kernel + initrd from /boot, but files like logo.16
aren't available at all. Inform the user about this situation and
possible workarounds.

grml2usb

index 63c26b3..68565db 100755 (executable)
--- a/grml2usb
+++ b/grml2usb
@@ -1108,9 +1108,16 @@ def identify_grml_flavour(mountpath):
     version_files = search_file('grml-version', mountpath, lst_return=True)
 
     if not version_files:
     version_files = search_file('grml-version', mountpath, lst_return=True)
 
     if not version_files:
-        logging.critical("Error: could not find grml-version file.")
-        cleanup()
-        sys.exit(1)
+        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)
 
     flavours = []
     logging.debug("version_files = %s", version_files)