]> code.ossystems Code Review - meta-freescale.git/commitdiff
change-file-endianess: update byte_swap script to support ls1046
authorZhenhua Luo <zhenhua.luo@nxp.com>
Tue, 20 Dec 2016 12:19:03 +0000 (20:19 +0800)
committerOtavio Salvador <otavio@ossystems.com.br>
Wed, 11 Jan 2017 12:53:43 +0000 (10:53 -0200)
Signed-off-by: Ting Liu <ting.liu@nxp.com>
Signed-off-by: Zhenhua Luo <zhenhua.luo@nxp.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
recipes-bsp/change-file-endianess/change-file-endianess.bb
recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl

index 2ad8c588285c00d1c52989bbe6134dc10d997362..ff1828bc289c2ae572ea5e197e0db200f63c19d7 100644 (file)
@@ -3,12 +3,11 @@ LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
                     file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
 
-
 SRC_URI = "file://byte_swap.tcl"
 
 RDEPENDS += "tcl-native"
 
-inherit native
+inherit native deploy
 
 S = "${WORKDIR}"
 
@@ -20,4 +19,14 @@ do_install () {
     install -m 755 ${WORKDIR}/byte_swap.tcl ${D}/${bindir}
 }
 
+do_deploy () {
+    :
+}
+
+do_deploy_class-native () {
+    install -d ${DEPLOYDIR}
+    cp -f ${STAGING_BINDIR_NATIVE}/byte_swap.tcl ${DEPLOYDIR}/
+}
+addtask deploy before do_build after do_populate_sysroot
+
 BBCLASSEXTEND = "native nativesdk"
index a4e8008f13e5c5cc9fb303ccf0be1d75eedcd9ed..c6222022897e54aa5e277aadf81dbdd507f58a52 100755 (executable)
@@ -18,12 +18,16 @@ if {$old_rem != 0} {
                append old_bin y
        }
 }
-for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} {
+for {set i 0} {$i<[expr $old_length-8]} {incr i $num_b} {
         for {set j $num_b} {$j>0} {incr j -1} {
                 append new_bin [string index $old_bin [expr $i+($j-1)]]
         }
 }
 
+for {set j 0} {$j<8} {incr j 1} {
+              append new_bin [string index $old_bin [expr $i+$j]]
+}
+
 for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} {
         set binValue [string range $old_bin [expr $i+0] [expr $i+($num_b-1)]]
         binary scan $binValue H[expr $num_b*2] hexValue