]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic/bootimg-pcbios.py: checking the existance of syslinux
authorHongxu Jia <hongxu.jia@windriver.com>
Mon, 13 Oct 2014 10:46:34 +0000 (18:46 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 18 Oct 2014 14:12:55 +0000 (16:12 +0200)
While syslinux not existed in $bootimg_dir, there was a error:

$ wic create directdisk -e core-image-minimal
...
|Creating image(s)...
|Error: exec_cmd: install -m 444 /home/jiahongxu/yocto/
build-20141010-yocto/tmp/deploy/images/qemux86-64/syslinux/
ldlinux.sys /var/tmp/wic/build/hdd/boot/ldlinux.sys
returned '1' instead of 0
...

Add checking for the existance of syslinux to fix this issue.
If syslinux didn't exist in anywhere, prompt user to build it.

[YOCTO #6826]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/wic/plugins/source/bootimg-pcbios.py

index aceed204289725d40680a23c693fc203522d042f..6057bab42d304d7d56936f953ce40161fba08ca3 100644 (file)
@@ -127,10 +127,19 @@ class BootimgPcbiosPlugin(SourcePlugin):
         'prepares' the partition to be incorporated into the image.
         In this case, prepare content for legacy bios boot partition.
         """
-        if not bootimg_dir:
+        def _has_syslinux(dir):
+            if dir:
+                syslinux = "%s/syslinux" % dir
+                if os.path.exists(syslinux):
+                    return True
+            return False
+
+        if not _has_syslinux(bootimg_dir):
             bootimg_dir = get_bitbake_var("STAGING_DATADIR")
             if not bootimg_dir:
                 msger.error("Couldn't find STAGING_DATADIR, exiting\n")
+            if not _has_syslinux(bootimg_dir):
+                msger.error("Please build syslinux first\n")
             # just so the result notes display it
             cr.set_bootimg_dir(bootimg_dir)