Support usage of grml2usb on EFI systems
[grml2usb.git] / grml2usb
index e324954..072f1b3 100755 (executable)
--- a/grml2usb
+++ b/grml2usb
@@ -493,7 +493,8 @@ def install_grub(device):
             for opt in ["", "--force"]:
                 logging.debug("grub-install --recheck %s --no-floppy --root-directory=%s %s",
                               opt, device_mountpoint, grub_device)
-                proc = subprocess.Popen([GRUB_INSTALL, "--recheck", opt, "--no-floppy",
+                proc = subprocess.Popen([GRUB_INSTALL, "--recheck", opt,
+                                         "--no-floppy", "--target=i386-pc",
                                          "--root-directory=%s" % device_mountpoint, grub_device],
                                         stdout=file(os.devnull, "r+"))
                 proc.wait()
@@ -1736,6 +1737,9 @@ def check_options(opts):
     if opts.grubmbr and not opts.grub:
         raise CriticalException("--grub-mbr requires --grub option.")
 
+    if opts.copyonly and opts.grub:
+        raise CriticalException("Cannot use --copy-only and --grub at the same time.")
+
 
 def check_programs():
     """check if all needed programs are installed"""