diff options
Diffstat (limited to 'scripts/mk_slp_header.sh')
-rwxr-xr-x | scripts/mk_slp_header.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/mk_slp_header.sh b/scripts/mk_slp_header.sh new file mode 100755 index 00000000..5b3e8efe --- /dev/null +++ b/scripts/mk_slp_header.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +UIMAGE_PATH="arch/arm/boot/uImage" + +if [ -e ${UIMAGE_PATH} ]; then + cp ${UIMAGE_PATH} . + + SIG_MAGIC="KeRn" + SIG_DATE=`date +%Y%m%d%H` + SIG_PROD="SLP_Fraser" + SIG_BOARD="u1" + KERN_ORG_SIZE=`stat -c %s uImage` + KERN_PAD_SIZE=`expr 512 - $KERN_ORG_SIZE % 512` + + if [ "$KERN_PAD_SIZE" != "512" ]; then + head -c $KERN_PAD_SIZE /dev/zero >> uImage + fi + + echo -n $SIG_MAGIC > slp-header + head -c $((12 - ${#SIG_MAGIC})) /dev/zero >> slp-header + + echo -n $SIG_DATE >> slp-header + head -c $((12 - ${#SIG_DATE})) /dev/zero >> slp-header + + echo -n $SIG_PROD >> slp-header + head -c $((24 - ${#SIG_PROD})) /dev/zero >> slp-header + + echo -n $SIG_BOARD >> slp-header + head -c $((464 - ${#SIG_BOARD})) /dev/zero >> slp-header + + cat slp-header >> uImage + + mv uImage arch/arm/boot/uImage + rm slp-header +fi |