From d5c2918cc21a41bcaf84179f420295f9174d0444 Mon Sep 17 00:00:00 2001 From: Junchun Guan Date: Thu, 23 Oct 2014 11:27:57 +0800 Subject: [PATCH] Fix syslinux installation path issue in Arch Linux isolinux.bin and mbr.bin is installed to /usr/lib/syslinux/bios in arch linux Change-Id: Iaa737b7fb277b5b7dee0ebb97a2523722f60e65d Signed-off-by: Junchun Guan --- mic/imager/liveusb.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mic/imager/liveusb.py b/mic/imager/liveusb.py index 8a5068f..64349ed 100644 --- a/mic/imager/liveusb.py +++ b/mic/imager/liveusb.py @@ -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) -- 2.7.4