summaryrefslogtreecommitdiff
path: root/release/tools
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 12:04:58 +0100
committerAndreas Baumann <mail@andreasbaumann.cc>2015-01-03 12:04:58 +0100
commit008d0be72b2f160382c6e880765e96b64a050c65 (patch)
tree36f48a98a3815a408e2ce1693dd182af90f80305 /release/tools
parent611becfb8726c60cb060368541ad98191d4532f5 (diff)
downloadtomato-008d0be72b2f160382c6e880765e96b64a050c65.tar.gz
tomato-008d0be72b2f160382c6e880765e96b64a050c65.tar.bz2
imported original firmware WRT54GL_v4.30.11_11_US
Diffstat (limited to 'release/tools')
-rwxr-xr-xrelease/tools/addlangbin0 -> 6772 bytes
-rwxr-xr-xrelease/tools/addpatternbin0 -> 6804 bytes
-rwxr-xr-xrelease/tools/appendfilebin0 -> 6900 bytes
-rwxr-xr-xrelease/tools/optimize_lib.sh48
-rw-r--r--release/tools/src/code_header.c86
-rwxr-xr-xrelease/tools/trxbin0 -> 16397 bytes
6 files changed, 134 insertions, 0 deletions
diff --git a/release/tools/addlang b/release/tools/addlang
new file mode 100755
index 00000000..3ad6b2be
--- /dev/null
+++ b/release/tools/addlang
Binary files differ
diff --git a/release/tools/addpattern b/release/tools/addpattern
new file mode 100755
index 00000000..a79bd3e3
--- /dev/null
+++ b/release/tools/addpattern
Binary files differ
diff --git a/release/tools/appendfile b/release/tools/appendfile
new file mode 100755
index 00000000..a983aa76
--- /dev/null
+++ b/release/tools/appendfile
Binary files differ
diff --git a/release/tools/optimize_lib.sh b/release/tools/optimize_lib.sh
new file mode 100755
index 00000000..c3e6dd6d
--- /dev/null
+++ b/release/tools/optimize_lib.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+#set -x
+
+NM=mipsel-uclibc-nm
+LD=mipsel-uclibc-ld
+STRIP=mipsel-uclibc-strip
+
+DIR=$1
+LIB_SO=$2
+LIB_A=$3
+LIB_SO_M=$4
+SEARCHDIR=$5
+INSTALLLIB=$6
+
+MAP=${DIR}/.map
+SYM=${DIR}/.sybmols
+UNR=${DIR}/.unresolved
+BINARIES=`find $SEARCHDIR -path $SEARCHDIR/lib -prune -o -type f -print | file -f - | grep ELF | cut -d':' -f1`
+
+if [ ! -f ${DIR}/${LIB_SO} ] ; then
+ echo "Cann't find ${DIR}/${LIB_SO}";
+ exit 0;
+fi
+
+if [ ! -f ${DIR}/${LIB_A} ] ; then
+ echo "Cann't find ${DIR}/${LIB_A}";
+ exit 0;
+fi
+
+rm -f $MAP
+rm -f $SYM
+rm -f $UNR
+
+$NM -o --defined-only --no-sort ${DIR}/${LIB_SO} | cut -d' ' -f3 > $MAP
+$NM --dynamic -u --no-sort $BINARIES | sort -u > $UNR
+for symbol in `cat $UNR` ; do
+ if grep -q "^$symbol" $MAP ; then echo "-u $symbol" >> $SYM ;
+fi ; done
+
+if ls $SYM ; then
+ xargs -t $LD -shared -o ${DIR}/${LIB_SO_M} ${DIR}/${LIB_A} < $SYM ;
+fi
+
+if [ "a$INSTALLLIB" != "a" -a -f ${DIR}/${LIB_SO_M} ] ; then
+ install ${DIR}/${LIB_SO_M} $INSTALLLIB
+ $STRIP $INSTALLLIB
+fi
diff --git a/release/tools/src/code_header.c b/release/tools/src/code_header.c
new file mode 100644
index 00000000..2ca48326
--- /dev/null
+++ b/release/tools/src/code_header.c
@@ -0,0 +1,86 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <stdarg.h>
+#include <getopt.h>
+#include <time.h>
+#include <sys/time.h>
+
+#include <cyutils.h>
+#include <code_pattern.h>
+
+#define MAX_BUF 1024
+
+struct code_header *
+init_code_header(void)
+{
+ int i;
+
+ struct code_header *pattern;
+
+ struct timeval tv;
+ struct timezone tz;
+ struct tm tm;
+ unsigned char version_buf[64];
+ unsigned char buf2[64];
+ int cnt;
+
+ pattern = malloc(sizeof(struct code_header));
+ memset(pattern, 0, sizeof(struct code_header));
+
+ memcpy(pattern->magic, CODE_PATTERN, sizeof(pattern->magic));
+ memcpy(pattern->id, CODE_ID, sizeof(pattern->id));
+
+ //fprintf(stderr, "%s is %ld bytes\n", input_file, input_size);
+
+ //Make date string
+ gettimeofday(&tv,&tz);
+ memcpy(&tm, localtime(&tv.tv_sec), sizeof(struct tm));
+ pattern->fwdate[0]=tm.tm_year+1900-2000;
+ pattern->fwdate[1]=tm.tm_mon+1;
+ pattern->fwdate[2]=tm.tm_mday;
+ printf("\nMake date==>Year:%d,Month:%d,Day:%d,Hour:%d,Min:%d,Sec:%d\n",tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);
+
+ //Make version
+ memset(version_buf,0,64);
+ memset(buf2,0,64);
+ memcpy(version_buf,CYBERTAN_VERSION ,strlen(CYBERTAN_VERSION));
+ printf("\nFirmware version =>%s\n",version_buf);
+ cnt=0;
+ i=0;
+ while(i<strlen(version_buf))
+ {
+ if(version_buf[i] == 0x2e)
+ cnt++;
+ i++;
+ }
+ strcpy(buf2,strtok(version_buf,"."));
+ pattern->fwvern[0]=(char)atoi(&buf2[1]);
+ //printf("\n1:%s,%d\n",buf2,pattern->fwvern[0]);
+ memset(buf2,0,64);
+ strcpy(buf2,strtok(NULL,"."));
+ pattern->fwvern[1]=(char)atoi(buf2);
+ //printf("\n2:%s,%d\n",buf2,pattern->fwvern[1]);
+ if(cnt==2)
+ {
+ memset(buf2,0,64);
+ strcpy(buf2,strtok(NULL,"."));
+ pattern->fwvern[2]=(char)atoi(buf2);
+ //printf("\n3:%s,%d\n",buf2,pattern->fwvern[2]);
+ }
+ else
+ {
+ pattern->fwvern[2]=0;
+ }
+
+ pattern->flags |= SUPPORT_4712_CHIP;
+ pattern->flags |= SUPPORT_INTEL_FLASH;
+ pattern->flags |= SUPPORT_5325E_SWITCH;
+ pattern->flags |= SUPPORT_4704_CHIP;
+ pattern->flags |= SUPPORT_5352E_CHIP;
+
+ return pattern;
+}
diff --git a/release/tools/trx b/release/tools/trx
new file mode 100755
index 00000000..4e308eb7
--- /dev/null
+++ b/release/tools/trx
Binary files differ