From: Michael Prokop Date: Thu, 3 Jul 2014 10:08:26 +0000 (+0200) Subject: Merge branch 'master' of https://github.com/jimmy42/grml2usb X-Git-Tag: v0.14.5~2 X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=commitdiff_plain;h=bb3505dbe24c23d20811e68b48807791195e88bd;hp=317649494449d547db2f415c8efa2538b8bd2df8 Merge branch 'master' of https://github.com/jimmy42/grml2usb --- 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)