X-Git-Url: http://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=8c4277e8a3fb7964b0ead87a6a6b8c365711eb0a;hp=0fbf339a60086990e7082937e0ac15b0a736fa5a;hb=5b3b5f7d12a5781ff3dbcfa233b693d22fd074ea;hpb=cfed72fbf4abe304f4c789f024d95fac127b3f0f diff --git a/grml2usb b/grml2usb index 0fbf339..8c4277e 100755 --- a/grml2usb +++ b/grml2usb @@ -42,6 +42,7 @@ GRML_DEFAULT = None UUID = None SYSLINUX_LIBS = "/usr/lib/syslinux/" GPT_HEADER = "\x55\xaa\x45\x46\x49\x20\x50\x41\x52\x54" # original GPT header +GRUB_INSTALL = None RE_PARTITION = re.compile(r'([a-z/]*?)(\d+)$') RE_P_PARTITION = re.compile(r'(.*?\d+)p(\d+)$') @@ -470,7 +471,7 @@ 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", "--root-directory=%s" % device_mountpoint, grub_device], stdout=file(os.devnull, "r+")) proc.wait() @@ -1725,7 +1726,8 @@ def check_options(opts): def check_programs(): """check if all needed programs are installed""" if options.grub: - if not which("grub-install"): + GRUB_INSTALL = which("grub-install") or which("grub2-install") + if not GRUB_INSTALL: logging.critical("Fatal: grub-install not available (please install the " + "grub package or drop the --grub option)") sys.exit(1)