]> code.ossystems Code Review - meta-freescale.git/commitdiff
utilities.inc: fix return None type error
authorJacopo Dall'Aglio <jacopo.dallaglio@kynetics.com>
Fri, 17 May 2019 07:58:54 +0000 (07:58 +0000)
committerOtavio Salvador <otavio@ossystems.com.br>
Fri, 17 May 2019 10:56:07 +0000 (07:56 -0300)
Function make_dtb_boot_files now always returns and raises an error if a
KERNEL_DEVICETREE entry filename extension is not .dtb or .dtbo.

Signed-off-by: Jacopo Dall'Aglio <jacopo.dallaglio@kynetics.com>
conf/machine/include/utilities.inc

index a56fd963681a83cb515f1fd925a00e0afab15d27..164d77f428ecf5bbd796844c5b481d11c293d6b9 100644 (file)
@@ -7,10 +7,11 @@ def make_dtb_boot_files(d):
     alldtbs = d.getVar('KERNEL_DEVICETREE')
 
     def transform(dtb):
-        if dtb.endswith('dtb') or dtb.endswith('dtbo'):
+        if not (dtb.endswith('dtb') or dtb.endswith('dtbo')):
             # eg: whatever/bcm2708-rpi-b.dtb has:
             #     DEPLOYDIR file: bcm2708-rpi-b.dtb
             #     destination: bcm2708-rpi-b.dtb
-            return os.path.basename(dtb)
+            bb.error("KERNEL_DEVICETREE entry %s is not a .dtb or .dtbo file." % (dtb) )
+        return os.path.basename(dtb)
 
     return ' '.join([transform(dtb) for dtb in alldtbs.split() if dtb])