[meta-freescale] [meta-freescale-layer master][PATCH 16/19] change-file-endianess: update byte_swap script to support ls1046
Zhenhua Luo
zhenhua.luo at nxp.com
Tue Dec 20 00:05:07 PST 2016
Signed-off-by: Ting Liu <ting.liu at nxp.com>
Signed-off-by: Zhenhua Luo <zhenhua.luo at nxp.com>
---
recipes-bsp/change-file-endianess/change-file-endianess.bb | 13 +++++++++++--
.../change-file-endianess/byte_swap.tcl | 6 +++++-
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/recipes-bsp/change-file-endianess/change-file-endianess.bb b/recipes-bsp/change-file-endianess/change-file-endianess.bb
index 2ad8c58..ff1828b 100644
--- a/recipes-bsp/change-file-endianess/change-file-endianess.bb
+++ b/recipes-bsp/change-file-endianess/change-file-endianess.bb
@@ -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"
diff --git a/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl b/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl
index a4e8008..c622202 100755
--- a/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl
+++ b/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl
@@ -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
--
2.7.4
More information about the meta-freescale
mailing list