summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunchun Guan <junchunx.guan@intel.com>2014-10-23 11:27:57 +0800
committeradmin <yuhuan.yang@samsung.com>2016-02-04 18:29:49 +0800
commitd5c2918cc21a41bcaf84179f420295f9174d0444 (patch)
treed1331ad0b2cf527b3f13ef3aba7636b780829777
parent0a1086ae1aa1104d5ec1ade23fd2ce74c4b83712 (diff)
downloadmic-d5c2918cc21a41bcaf84179f420295f9174d0444.tar.gz
mic-d5c2918cc21a41bcaf84179f420295f9174d0444.tar.bz2
mic-d5c2918cc21a41bcaf84179f420295f9174d0444.zip
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 <junchunx.guan@intel.com>
-rw-r--r--mic/imager/liveusb.py14
1 files 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)