[meta-freescale] [meta-fsl-ppc][PATCH 07/12] fm-ucode: use soc_family to match deployed binaries

ting.liu at freescale.com ting.liu at freescale.com
Tue Jan 6 20:33:23 PST 2015


From: Ting Liu <ting.liu at freescale.com>

listing machine names in recipe is painful when adding support
for boards with same soc. use soc_family instead.

Signed-off-by: Ting Liu <ting.liu at freescale.com>
---
 recipes-dpaa/fm-ucode/fm-ucode_git.bb | 29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/recipes-dpaa/fm-ucode/fm-ucode_git.bb b/recipes-dpaa/fm-ucode/fm-ucode_git.bb
index ef9cae0..9f8ac46 100644
--- a/recipes-dpaa/fm-ucode/fm-ucode_git.bb
+++ b/recipes-dpaa/fm-ucode/fm-ucode_git.bb
@@ -12,33 +12,19 @@ SRCREV = "517267e5f9ca9ab13cb2e94e0a20f555f73885ee"
 
 S = "${WORKDIR}/git"
 
-ALLOW_EMPTY_${PN} = "1"
+REGLEX ?= "${MACHINE}"
+REGLEX_t1042 = "t1040"
+REGLEX_b4420 = "b4860"
+REGLEX_t4160 = "t4240"
+
 do_install () {
-    case ${MACHINE} in
-        t1040qds|t1040qds-64b|t1040rdb|t1040rdb-64b|t1042rdb|t1042rdb-64b) UCODE=t1040;;
-        t2080qds|t2080qds-64b|t2080rdb|t2080rdb-64b) UCODE=t2080;;
-        b4420qds|b4420qds-64b|b4860qds|b4860qds-64b) UCODE=b4860;;
-        t4240qds|t4240qds-64b|t4240rdb|t4240rdb-64b|t4160qds|t4160qds-64b) UCODE=t4240;;
-        p5020ds|p5020ds-64b) UCODE=p5020;;
-        p5040ds|p5040ds-64b) UCODE=p5040;;
-        *) UCODE=${MACHINE};;
-    esac
-    UCODE=`echo $UCODE | sed -e 's,[a-zA-Z]*$,,'`
+    UCODE=`echo ${REGLEX} | sed -e 's,-.*$,,' -e 's,[a-zA-Z]*$,,'`
     install -d ${D}/boot
     install -m 644 fsl_fman_ucode_${UCODE}*.bin ${D}/boot/
 }
 
 do_deploy () {
-    case ${MACHINE} in
-        t1040qds|t1040qds-64b|t1040rdb|t1040rdb-64b|t1042rdb|t1042rdb-64b) UCODE=t1040;;
-        t2080qds|t2080qds-64b|t2080rdb|t2080rdb-64b) UCODE=t2080;;
-        b4420qds|b4420qds-64b|b4860qds|b4860qds-64b) UCODE=b4860;;
-        t4240qds|t4240qds-64b|t4240rdb|t4240rdb-64b|t4160qds|t4160qds-64b) UCODE=t4240;;
-        p5020ds|p5020ds-64b) UCODE=p5020;;
-        p5040ds|p5040ds-64b) UCODE=p5040;;
-        *) UCODE=${MACHINE};;
-    esac
-    UCODE=`echo $UCODE | sed -e 's,[a-zA-Z]*$,,'`
+    UCODE=`echo ${REGLEX} | sed -e 's,-.*$,,' -e 's,[a-zA-Z]*$,,'`
     install -d ${DEPLOYDIR}/
     install -m 644 fsl_fman_ucode_${UCODE}*.bin ${DEPLOYDIR}/
 }
@@ -46,5 +32,6 @@ addtask deploy before do_build after do_install
 
 PACKAGES += "${PN}-image"
 FILES_${PN}-image += "/boot"
+ALLOW_EMPTY_${PN} = "1"
 COMPATIBLE_MACHINE = "(p1023rdb|e500mc|e5500|e5500-64b|e6500|e6500-64b)"
 
-- 
1.9.1



More information about the meta-freescale mailing list