diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2006-08-03 08:08:40 +0000 |
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2006-08-03 08:08:40 +0000 |
| commit | ca4bd6f599b8dfebc4d0a037cbba0bf0402b832c (patch) | |
| tree | 5b364cc93775731ba66e20627e01d946a878e2de | |
| parent | bb5330cb881c3a400f29871c839fe15515b57565 (diff) | |
| download | rockbox-ca4bd6f599b8dfebc4d0a037cbba0bf0402b832c.zip rockbox-ca4bd6f599b8dfebc4d0a037cbba0bf0402b832c.tar.gz rockbox-ca4bd6f599b8dfebc4d0a037cbba0bf0402b832c.tar.bz2 rockbox-ca4bd6f599b8dfebc4d0a037cbba0bf0402b832c.tar.xz | |
The sansa build now uses this new mi4 creation script, working as a frontend
to the mi4code tool to do all steps from raw binary to complete mi4 file
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10429 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | tools/FILES | 1 | ||||
| -rwxr-xr-x | tools/configure | 5 | ||||
| -rwxr-xr-x | tools/mkmi4.sh | 97 |
3 files changed, 100 insertions, 3 deletions
diff --git a/tools/FILES b/tools/FILES index 25cfb0e..57a9314 100644 --- a/tools/FILES +++ b/tools/FILES @@ -20,3 +20,4 @@ ucl/src/Makefile ucl/include/ucl/*.h profile_reader/*.pl rockboxdev.sh +mkmi4.sh diff --git a/tools/configure b/tools/configure index aa9c421..8a97ad8 100755 --- a/tools/configure +++ b/tools/configure @@ -921,11 +921,10 @@ toolsdir='\$(ROOTDIR)/tools' target="-DSANSA_E200" memory=32 # supposedly arm7tdmicc - #tool="$rootdir/tools/ -add=iax5" - tool="$rootdir/tools/mi4code build" + tool="$rootdir/tools/mkmi4.sh e200" bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" bmp2rb_native="$rootdir/tools/bmp2rb -f 5" - output="rockbox.sansa" + output="PP5022.mi4" appextra="recorder:gui" archosrom="" flash="" diff --git a/tools/mkmi4.sh b/tools/mkmi4.sh new file mode 100755 index 0000000..8dc90d8 --- /dev/null +++ b/tools/mkmi4.sh @@ -0,0 +1,97 @@ +#!/bin/sh +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ +# $Id$ +# +# Purpose of this script: +# +# Inputs: music player model name and a file name +# +# Action: Build a valid mi4 file (prepending and appending magic) +# Encrypt the file with TEA encryption so that the model's own +# bootloader accepts this file. +# Sign the file with a DSA signature the bootloader accepts +# +# Output: A built, encrypted and signed mi4 file image. +# +# Requirement: +# +# This script assumes that you have the mi4code tool in your path, that +# you have the environment variable MI4CODE pointing to the tool or that you +# have it in the same dir that you invoke this script with. +# +# mi4 info and tool are here: http://daniel.haxx.se/sansa/mi4.html +# + +mkmi4=$0 +target=$1 +input=$2 +output=$3 + +# scan the $PATH for the given command +findtool(){ + file="$1" + + IFS=":" + for path in $PATH + do + # echo "checks for $file in $path" >&2 + if test -f "$path/$file"; then + echo "$path/$file" + return + fi + done +} + +help () { + echo "Usage: mi4fix.sh <e200/h10> <input> <output>" + exit +} + +if test -z "$output"; then + help +fi + +case $target in + e200) + tea=sansa + ;; + h10) + tea=20gc_eng + ;; + *) + echo "unsupported target" + help + ;; +esac + +if test -z "$MI4CODE"; then + tool=`findtool mi4code` + if test -z "$tool"; then + # not in path + tool=`dirname $mkmi4`/mi4code + if ! test -f $tool; then + echo "Couldn't find mi4code" + exit + fi + fi +else + tool=$MI4CODE +fi + + + + +# build a 010301 version +echo "$tool build $input $output.raw" +$tool build $input $output.raw +# encrypt +echo "$tool encrypt $output.raw $output.encrypt $tea" +$tool encrypt $output.raw $output.encrypt $tea +# sign +echo "$tool sign $output.encrypt $output" +$tool sign $output.encrypt $output |