diff options
author | Damien George <damien.p.george@gmail.com> | 2014-01-12 04:53:14 -0800 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-01-12 04:53:14 -0800 |
commit | 022630213a7ea494546e8fb24c9ff35d9363b798 (patch) | |
tree | a1ce9830fbde3b0d639bcab41fca36e8fa8c69d4 /teensy/add-memzip.sh | |
parent | e5863d9301286418bfefd1fc07db5664759502f0 (diff) | |
parent | d80ee8bbfd52fd44f623aabbef4544f9572aca9e (diff) | |
download | micropython-022630213a7ea494546e8fb24c9ff35d9363b798.tar.gz micropython-022630213a7ea494546e8fb24c9ff35d9363b798.zip |
Merge pull request #147 from dhylands/staticfs
Added memzip filesystem support for teensy
Diffstat (limited to 'teensy/add-memzip.sh')
-rwxr-xr-x | teensy/add-memzip.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/teensy/add-memzip.sh b/teensy/add-memzip.sh new file mode 100755 index 0000000000..a00489effd --- /dev/null +++ b/teensy/add-memzip.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +if [ "$#" != 3 ]; then + echo "Usage: add-memzip.sh input.hex output.hex file-directory" + exit 1 +fi + +#set -x + +input_hex=$1 +output_hex=$2 +memzip_src_dir=$3 + +input_bin=${input_hex}.bin +output_bin=${output_hex}.bin +zip_file=${output_hex}.zip +zip_base=$(basename ${zip_file}) +zip_dir=$(dirname ${zip_file}) +abs_zip_dir=$(realpath ${zip_dir}) + +rm -f ${zip_file} +(cd ${memzip_src_dir}; zip -0 -r -D ${abs_zip_dir}/${zip_base} .) +objcopy -I ihex -O binary ${input_hex} ${input_bin} +cat ${input_bin} ${zip_file} > ${output_bin} +objcopy -I binary -O ihex ${output_bin} ${output_hex} +echo "Added ${memzip_src_dir} to ${input_hex} creating ${output_hex}" + |