BTS

Issue1266

Title grml2usb: Add Fedora's syslinux MBR path
Priority feature Status resolved
Superseder Nosy List opensource
Assigned To Topics

Created on 2013-07-10.09:32:55 by opensource, last changed 2013-08-30.08:08:42 by mika.

Messages
msg4586 (view) Author: mika Date: 2013-07-10.09:36:46
* Till Maas wrote in grml's BTS on 20130710 / 11:33:

> - look for the syslinux MBR also in /usr/share/syslinux/mbr.bin, which
>   is the correct path for it on Fedora
[...]

Applied:

  http://goo.gl/MZrWF

Thanks!

regards,
-mika-
msg4585 (view) Author: opensource Date: 2013-07-10.09:32:55
- look for the syslinux MBR also in /usr/share/syslinux/mbr.bin, which
  is the correct path for it on Fedora
---
 grml2usb | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

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'
 
-- 
1.8.3.1
History
Date User Action Args
2013-08-30 08:08:42mikasetstatus: fixed-in-git -> resolved
2013-07-10 09:38:16mikasetstatus: chatting -> fixed-in-git
priority: feature
2013-07-10 09:36:46mikasetstatus: unread -> chatting
messages: + msg4586
2013-07-10 09:32:55opensourcecreate