projects
/
grml2usb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cfed72f
)
allow grub-install to be called grub2-install (used in gentoo)
author
dansan
<daniel@admin-box.com>
Mon, 2 Jun 2014 09:19:13 +0000
(11:19 +0200)
committer
dansan
<daniel@admin-box.com>
Mon, 2 Jun 2014 09:19:13 +0000
(11:19 +0200)
grml2usb
patch
|
blob
|
history
diff --git
a/grml2usb
b/grml2usb
index
0fbf339
..
8c4277e
100755
(executable)
--- 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
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+)$')
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)
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()
"--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:
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)
logging.critical("Fatal: grub-install not available (please install the "
+ "grub package or drop the --grub option)")
sys.exit(1)