From: Till Maas Date: Wed, 10 Jul 2013 09:34:56 +0000 (+0200) Subject: Support also /usr/share/syslinux/ to look for mbr.bin X-Git-Tag: v0.14.1~1 X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=commitdiff_plain;h=d26c252ab511ba9067c581e227f610095d2d45b1;ds=sidebyside Support also /usr/share/syslinux/ to look for mbr.bin Look for the syslinux MBR also in /usr/share/syslinux/mbr.bin, which is the correct path for it on Fedora. --- diff --git a/grml2usb b/grml2usb index ab0ad63..eafee4b 100755 --- a/grml2usb +++ b/grml2usb @@ -1567,7 +1567,20 @@ def handle_mbr(device): mbrcode = GRML2USB_BASE + '/mbr/mbrldr' if options.syslinuxmbr: - mbrcode = '/usr/lib/syslinux/mbr.bin' + mbrcode = "" + mbr_locations = ('/usr/lib/syslinux/mbr.bin', + '/usr/share/syslinux/mbr.bin') + for mbrpath in mbr_locations: + if os.path.isfile(mbrpath): + mbrcode = mbrpath + break + + if mbrcode is "": + str_locations = " or ".join(['"%s"' % l for l in mbr_locations]) + logging.error('Cannot find syslinux MBR, install it at %s)', + str_locations) + raise CriticalException("syslinux MBR can not be found at %s." + % str_locations) elif options.mbrmenu: mbrcode = GRML2USB_BASE + '/mbr/mbrldr'