diff options
| -rw-r--r-- | recipes-bsp/change-file-endianess/change-file-endianess.bb | 19 | ||||
| -rwxr-xr-x | recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl | 40 |
2 files changed, 0 insertions, 59 deletions
diff --git a/recipes-bsp/change-file-endianess/change-file-endianess.bb b/recipes-bsp/change-file-endianess/change-file-endianess.bb deleted file mode 100644 index 570ee3f69..000000000 --- a/recipes-bsp/change-file-endianess/change-file-endianess.bb +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | DESCRIPTION = "provides the tcl script for endian swap" | ||
| 2 | LICENSE = "MIT" | ||
| 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
| 4 | |||
| 5 | SRC_URI = "file://byte_swap.tcl" | ||
| 6 | |||
| 7 | S = "${WORKDIR}" | ||
| 8 | |||
| 9 | do_configure[noexec] = "1" | ||
| 10 | do_compile[noexec] = "1" | ||
| 11 | |||
| 12 | do_install () { | ||
| 13 | install -d ${D}/${bindir} | ||
| 14 | install -m 755 ${WORKDIR}/byte_swap.tcl ${D}/${bindir} | ||
| 15 | } | ||
| 16 | |||
| 17 | RDEPENDS_${PN} += "tcl" | ||
| 18 | |||
| 19 | 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 deleted file mode 100755 index c62220228..000000000 --- a/recipes-bsp/change-file-endianess/change-file-endianess/byte_swap.tcl +++ /dev/null | |||
| @@ -1,40 +0,0 @@ | |||
| 1 | puts $argv | ||
| 2 | set i_file [lindex $argv 0] | ||
| 3 | set o_file [lindex $argv 1] | ||
| 4 | set num_b [lindex $argv 2] | ||
| 5 | puts "" | ||
| 6 | |||
| 7 | set fileid_i [open $i_file "r"] | ||
| 8 | set fileid_o [open $o_file "w+"] | ||
| 9 | fconfigure $fileid_i -translation {binary binary} | ||
| 10 | fconfigure $fileid_o -translation {binary binary} | ||
| 11 | |||
| 12 | set old_bin [read $fileid_i] | ||
| 13 | set new_bin {} | ||
| 14 | set old_length [string length $old_bin] | ||
| 15 | set old_rem [expr $old_length % $num_b] | ||
| 16 | if {$old_rem != 0} { | ||
| 17 | for {set i 0} {$i< [expr $num_b - $old_rem]} {incr i 1} { | ||
| 18 | append old_bin y | ||
| 19 | } | ||
| 20 | } | ||
| 21 | for {set i 0} {$i<[expr $old_length-8]} {incr i $num_b} { | ||
| 22 | for {set j $num_b} {$j>0} {incr j -1} { | ||
| 23 | append new_bin [string index $old_bin [expr $i+($j-1)]] | ||
| 24 | } | ||
| 25 | } | ||
| 26 | |||
| 27 | for {set j 0} {$j<8} {incr j 1} { | ||
| 28 | append new_bin [string index $old_bin [expr $i+$j]] | ||
| 29 | } | ||
| 30 | |||
| 31 | for {set i 0} {$i<[string length $old_bin]} {incr i $num_b} { | ||
| 32 | set binValue [string range $old_bin [expr $i+0] [expr $i+($num_b-1)]] | ||
| 33 | binary scan $binValue H[expr $num_b*2] hexValue | ||
| 34 | |||
| 35 | set binValue [string range $new_bin [expr $i+0] [expr $i+($num_b-1)]] | ||
| 36 | binary scan $binValue H[expr $num_b*2] hexValue | ||
| 37 | } | ||
| 38 | |||
| 39 | puts -nonewline $fileid_o $new_bin | ||
| 40 | close $fileid_o | ||
