Fix syslinux installation path issue in Arch Linux
authorJunchun Guan <junchunx.guan@intel.com>
Thu, 23 Oct 2014 03:27:57 +0000 (11:27 +0800)
committeradmin <yuhuan.yang@samsung.com>
Thu, 4 Feb 2016 10:29:49 +0000 (18:29 +0800)
isolinux.bin and mbr.bin is installed to /usr/lib/syslinux/bios in arch linux

Change-Id: Iaa737b7fb277b5b7dee0ebb97a2523722f60e65d
Signed-off-by: Junchun Guan <junchunx.guan@intel.com>
mic/imager/liveusb.py

index 8a5068f..64349ed 100644 (file)
@@ -118,6 +118,8 @@ class LiveUSBImageCreator(LiveCDImageCreator):
                 syslinux_path = "/usr/share/syslinux"
             elif  os.path.isfile("/usr/lib/syslinux/isolinux.bin"):
                 syslinux_path = "/usr/lib/syslinux"
+            elif  os.path.isfile("/usr/lib/syslinux/bios/isolinux.bin"):
+                syslinux_path = "/usr/lib/syslinux/bios"
             else:
                 raise CreatorError("syslinux not installed : "
                                    "cannot find syslinux installation path")
@@ -252,11 +254,13 @@ class LiveUSBImageCreator(LiveCDImageCreator):
 
         # Need to do this after image is unmounted and device mapper is closed
         msger.info("set MBR")
-        mbrfile = "/usr/lib/syslinux/mbr.bin"
-        if not os.path.exists(mbrfile):
-            mbrfile = "/usr/share/syslinux/mbr.bin"
-            if not os.path.exists(mbrfile):
-                raise CreatorError("mbr.bin file didn't exist.")
+        found = False
+        for mbrfile in ["/usr/lib/syslinux/mbr.bin", "/usr/lib/syslinux/bios/mbr.bin", "/usr/share/syslinux/mbr.bin"]:
+            if os.path.exists(mbrfile):
+                found = True
+                break
+        if not found:
+            raise CreatorError("mbr.bin file didn't exist.")
         mbrsize = os.path.getsize(mbrfile)
         outimg = "%s/%s.usbimg" % (self._outdir, self.name)