From 27b76ab0671089c47506615a796a261e993896a7 Mon Sep 17 00:00:00 2001
From: James <>
Date: Sun, 17 Mar 2013 12:16:37 +0000
Subject: fish
---
tools/.svn/entries | 209 +
tools/.svn/prop-base/Makefile.svn-base | 5 +
tools/.svn/text-base/Makefile.svn-base | 149 +
tools/Makefile | 149 +
tools/autoconf/.svn/entries | 65 +
tools/autoconf/.svn/text-base/Makefile.svn-base | 37 +
tools/autoconf/Makefile | 37 +
tools/autoconf/patches/.svn/entries | 96 +
.../.svn/text-base/000-relocatable.patch.svn-base | 167 +
.../.svn/text-base/001-no_emacs_lib.patch.svn-base | 22 +
tools/autoconf/patches/000-relocatable.patch | 167 +
tools/autoconf/patches/001-no_emacs_lib.patch | 22 +
tools/automake/.svn/entries | 68 +
tools/automake/.svn/text-base/Makefile.svn-base | 36 +
tools/automake/Makefile | 36 +
tools/automake/files/.svn/entries | 62 +
.../automake/files/.svn/prop-base/aclocal.svn-base | 5 +
.../automake/files/.svn/text-base/aclocal.svn-base | 2 +
tools/automake/files/aclocal | 2 +
tools/automake/patches/.svn/entries | 130 +
.../.svn/text-base/000-relocatable.patch.svn-base | 46 +
...al-skip-not-existing-directories.patch.svn-base | 15 +
.../200-fix_missing_py_compile.patch.svn-base | 14 +
tools/automake/patches/000-relocatable.patch | 46 +
...100-aclocal-skip-not-existing-directories.patch | 15 +
.../patches/200-fix_missing_py_compile.patch | 14 +
tools/b43-tools/.svn/entries | 68 +
tools/b43-tools/.svn/text-base/Makefile.svn-base | 51 +
tools/b43-tools/Makefile | 51 +
tools/b43-tools/files/.svn/entries | 62 +
.../files/.svn/prop-base/b43-fwsquash.py.svn-base | 5 +
.../files/.svn/text-base/b43-fwsquash.py.svn-base | 122 +
tools/b43-tools/files/b43-fwsquash.py | 122 +
tools/b43-tools/patches/.svn/entries | 130 +
.../.svn/text-base/001-fw-dirname.patch.svn-base | 16 +
.../.svn/text-base/002-no_libfl.patch.svn-base | 14 +
...error-undefined-reference-to-yyd.patch.svn-base | 27 +
tools/b43-tools/patches/001-fw-dirname.patch | 16 +
tools/b43-tools/patches/002-no_libfl.patch | 14 +
...-compile-error-undefined-reference-to-yyd.patch | 27 +
tools/bison/.svn/entries | 65 +
tools/bison/.svn/text-base/Makefile.svn-base | 28 +
tools/bison/Makefile | 28 +
tools/bison/patches/.svn/entries | 130 +
.../.svn/text-base/000-relocatable.patch.svn-base | 20 +
.../text-base/010-intl-stub-compat.patch.svn-base | 15 +
.../text-base/100-fix-gets-removal.patch.svn-base | 16 +
tools/bison/patches/000-relocatable.patch | 20 +
tools/bison/patches/010-intl-stub-compat.patch | 15 +
tools/bison/patches/100-fix-gets-removal.patch | 16 +
tools/ccache/.svn/entries | 65 +
tools/ccache/.svn/text-base/Makefile.svn-base | 52 +
tools/ccache/Makefile | 52 +
tools/ccache/files/.svn/entries | 96 +
.../ccache/files/.svn/prop-base/ccache_cc.svn-base | 5 +
.../files/.svn/prop-base/ccache_cxx.svn-base | 5 +
.../ccache/files/.svn/text-base/ccache_cc.svn-base | 2 +
.../files/.svn/text-base/ccache_cxx.svn-base | 2 +
tools/ccache/files/ccache_cc | 2 +
tools/ccache/files/ccache_cxx | 2 +
tools/cloog/.svn/entries | 62 +
tools/cloog/.svn/text-base/Makefile.svn-base | 39 +
tools/cloog/Makefile | 39 +
tools/cmake/.svn/entries | 62 +
tools/cmake/.svn/text-base/Makefile.svn-base | 27 +
tools/cmake/Makefile | 27 +
tools/dosfstools/.svn/entries | 62 +
tools/dosfstools/.svn/text-base/Makefile.svn-base | 30 +
tools/dosfstools/Makefile | 30 +
tools/e2fsprogs/.svn/entries | 65 +
tools/e2fsprogs/.svn/text-base/Makefile.svn-base | 52 +
tools/e2fsprogs/Makefile | 52 +
tools/e2fsprogs/patches/.svn/entries | 164 +
.../001-exit_0_on_corrected_errors.patch.svn-base | 11 +
.../002-dont-build-e4defrag.patch.svn-base | 11 +
.../text-base/003-openbsd-compat.patch.svn-base | 24 +
.../text-base/004-freebsd-compat.patch.svn-base | 13 +
.../patches/001-exit_0_on_corrected_errors.patch | 11 +
.../patches/002-dont-build-e4defrag.patch | 11 +
tools/e2fsprogs/patches/003-openbsd-compat.patch | 24 +
tools/e2fsprogs/patches/004-freebsd-compat.patch | 13 +
tools/firmware-utils/.svn/entries | 65 +
.../.svn/prop-base/Makefile.svn-base | 5 +
.../.svn/text-base/Makefile.svn-base | 71 +
tools/firmware-utils/Makefile | 71 +
tools/firmware-utils/src/.svn/entries | 2204 +++++++++
.../src/.svn/prop-base/addpattern.c.svn-base | 5 +
.../src/.svn/prop-base/bcm_tag.h.svn-base | 5 +
.../src/.svn/prop-base/buffalo-enc.c.svn-base | 5 +
.../src/.svn/prop-base/buffalo-lib.c.svn-base | 5 +
.../src/.svn/prop-base/buffalo-lib.h.svn-base | 5 +
.../src/.svn/prop-base/buffalo-tag.c.svn-base | 5 +
.../src/.svn/prop-base/buffalo-tftp.c.svn-base | 5 +
.../src/.svn/prop-base/cyg_crc.h.svn-base | 5 +
.../src/.svn/prop-base/cyg_crc16.c.svn-base | 5 +
.../src/.svn/prop-base/cyg_crc32.c.svn-base | 5 +
.../.svn/prop-base/fix-u-media-header.c.svn-base | 5 +
.../src/.svn/prop-base/md5.c.svn-base | 5 +
.../src/.svn/prop-base/md5.h.svn-base | 5 +
.../src/.svn/prop-base/mkcameofw.c.svn-base | 5 +
.../src/.svn/prop-base/mkcasfw.c.svn-base | 5 +
.../src/.svn/prop-base/mkdir615h1.c.svn-base | 5 +
.../src/.svn/prop-base/mkfwimage2.c.svn-base | 5 +
.../src/.svn/prop-base/mkplanexfw.c.svn-base | 5 +
.../src/.svn/prop-base/mktplinkfw.c.svn-base | 5 +
.../src/.svn/prop-base/mkwrgimg.c.svn-base | 5 +
.../src/.svn/prop-base/mkzcfw.c.svn-base | 5 +
.../src/.svn/prop-base/mkzynfw.c.svn-base | 5 +
.../src/.svn/prop-base/motorola-bin.c.svn-base | 5 +
.../src/.svn/prop-base/osbridge-crc.c.svn-base | 5 +
.../src/.svn/prop-base/pc1crypt.c.svn-base | 5 +
.../src/.svn/prop-base/seama.c.svn-base | 5 +
.../src/.svn/prop-base/seama.h.svn-base | 5 +
.../src/.svn/prop-base/sha1.c.svn-base | 5 +
.../src/.svn/prop-base/sha1.h.svn-base | 5 +
.../src/.svn/prop-base/trx.c.svn-base | 5 +
.../src/.svn/prop-base/wrt400n.c.svn-base | 5 +
.../src/.svn/prop-base/zynos.h.svn-base | 5 +
.../src/.svn/text-base/add_header.c.svn-base | 138 +
.../src/.svn/text-base/addpattern.c.svn-base | 325 ++
.../src/.svn/text-base/airlink.c.svn-base | 332 ++
.../src/.svn/text-base/bcm_tag.h.svn-base | 70 +
.../src/.svn/text-base/buffalo-enc.c.svn-base | 298 ++
.../src/.svn/text-base/buffalo-lib.c.svn-base | 480 ++
.../src/.svn/text-base/buffalo-lib.h.svn-base | 121 +
.../src/.svn/text-base/buffalo-tag.c.svn-base | 374 ++
.../src/.svn/text-base/buffalo-tftp.c.svn-base | 179 +
.../src/.svn/text-base/csysimg.h.svn-base | 79 +
.../src/.svn/text-base/cyg_crc.h.svn-base | 109 +
.../src/.svn/text-base/cyg_crc16.c.svn-base | 110 +
.../src/.svn/text-base/cyg_crc32.c.svn-base | 172 +
.../src/.svn/text-base/dgfirmware.c.svn-base | 376 ++
.../src/.svn/text-base/encode_crc.c.svn-base | 151 +
.../.svn/text-base/fix-u-media-header.c.svn-base | 354 ++
.../src/.svn/text-base/fw.h.svn-base | 70 +
.../src/.svn/text-base/imagetag.c.svn-base | 524 ++
.../src/.svn/text-base/imagetag.ggo.svn-base | 45 +
.../src/.svn/text-base/imagetag_cmdline.c.svn-base | 1174 +++++
.../src/.svn/text-base/imagetag_cmdline.h.svn-base | 272 ++
.../src/.svn/text-base/lzma2eva.c.svn-base | 190 +
.../src/.svn/text-base/makeamitbin.c.svn-base | 316 ++
.../src/.svn/text-base/md5.c.svn-base | 307 ++
.../src/.svn/text-base/md5.h.svn-base | 65 +
.../src/.svn/text-base/mkbrncmdline.c.svn-base | 168 +
.../src/.svn/text-base/mkbrnimg.c.svn-base | 183 +
.../src/.svn/text-base/mkcameofw.c.svn-base | 405 ++
.../src/.svn/text-base/mkcasfw.c.svn-base | 1030 ++++
.../src/.svn/text-base/mkchkimg.c.svn-base | 327 ++
.../src/.svn/text-base/mkcsysimg.c.svn-base | 1157 +++++
.../src/.svn/text-base/mkdapimg.c.svn-base | 191 +
.../src/.svn/text-base/mkdir615h1.c.svn-base | 410 ++
.../src/.svn/text-base/mkdniimg.c.svn-base | 208 +
.../src/.svn/text-base/mkedimaximg.c.svn-base | 259 +
.../src/.svn/text-base/mkfwimage.c.svn-base | 467 ++
.../src/.svn/text-base/mkfwimage2.c.svn-base | 447 ++
.../src/.svn/text-base/mkmylofw.c.svn-base | 1297 +++++
.../src/.svn/text-base/mkplanexfw.c.svn-base | 269 ++
.../src/.svn/text-base/mktitanimg.c.svn-base | 1040 ++++
.../src/.svn/text-base/mktitanimg.h.svn-base | 171 +
.../src/.svn/text-base/mktplinkfw.c.svn-base | 1084 +++++
.../src/.svn/text-base/mkwrgimg.c.svn-base | 240 +
.../src/.svn/text-base/mkzcfw.c.svn-base | 408 ++
.../src/.svn/text-base/mkzynfw.c.svn-base | 1130 +++++
.../src/.svn/text-base/motorola-bin.c.svn-base | 227 +
.../src/.svn/text-base/myloader.h.svn-base | 176 +
.../src/.svn/text-base/nand_ecc.c.svn-base | 204 +
.../src/.svn/text-base/osbridge-crc.c.svn-base | 309 ++
.../src/.svn/text-base/pc1crypt.c.svn-base | 361 ++
.../src/.svn/text-base/ptgen.c.svn-base | 234 +
.../src/.svn/text-base/seama.c.svn-base | 529 ++
.../src/.svn/text-base/seama.h.svn-base | 108 +
.../src/.svn/text-base/sha1.c.svn-base | 443 ++
.../src/.svn/text-base/sha1.h.svn-base | 57 +
.../src/.svn/text-base/spw303v.c.svn-base | 242 +
.../src/.svn/text-base/srec2bin.c.svn-base | 524 ++
.../src/.svn/text-base/trx.c.svn-base | 419 ++
.../src/.svn/text-base/trx2edips.c.svn-base | 171 +
.../src/.svn/text-base/trx2usr.c.svn-base | 186 +
.../src/.svn/text-base/wndr3700.c.svn-base | 150 +
.../src/.svn/text-base/wrt400n.c.svn-base | 334 ++
.../src/.svn/text-base/xorimage.c.svn-base | 135 +
.../src/.svn/text-base/zynos.h.svn-base | 225 +
tools/firmware-utils/src/add_header.c | 138 +
tools/firmware-utils/src/addpattern.c | 325 ++
tools/firmware-utils/src/airlink.c | 332 ++
tools/firmware-utils/src/bcm_tag.h | 70 +
tools/firmware-utils/src/buffalo-enc.c | 298 ++
tools/firmware-utils/src/buffalo-lib.c | 480 ++
tools/firmware-utils/src/buffalo-lib.h | 121 +
tools/firmware-utils/src/buffalo-tag.c | 374 ++
tools/firmware-utils/src/buffalo-tftp.c | 179 +
tools/firmware-utils/src/csysimg.h | 79 +
tools/firmware-utils/src/cyg_crc.h | 109 +
tools/firmware-utils/src/cyg_crc16.c | 110 +
tools/firmware-utils/src/cyg_crc32.c | 172 +
tools/firmware-utils/src/dgfirmware.c | 376 ++
tools/firmware-utils/src/encode_crc.c | 151 +
tools/firmware-utils/src/fix-u-media-header.c | 354 ++
tools/firmware-utils/src/fw.h | 70 +
tools/firmware-utils/src/imagetag.c | 524 ++
tools/firmware-utils/src/imagetag.ggo | 45 +
tools/firmware-utils/src/imagetag_cmdline.c | 1174 +++++
tools/firmware-utils/src/imagetag_cmdline.h | 272 ++
tools/firmware-utils/src/lzma2eva.c | 190 +
tools/firmware-utils/src/makeamitbin.c | 316 ++
tools/firmware-utils/src/md5.c | 307 ++
tools/firmware-utils/src/md5.h | 65 +
tools/firmware-utils/src/mkbrncmdline.c | 168 +
tools/firmware-utils/src/mkbrnimg.c | 183 +
tools/firmware-utils/src/mkcameofw.c | 405 ++
tools/firmware-utils/src/mkcasfw.c | 1030 ++++
tools/firmware-utils/src/mkchkimg.c | 327 ++
tools/firmware-utils/src/mkcsysimg.c | 1157 +++++
tools/firmware-utils/src/mkdapimg.c | 191 +
tools/firmware-utils/src/mkdir615h1.c | 410 ++
tools/firmware-utils/src/mkdniimg.c | 208 +
tools/firmware-utils/src/mkedimaximg.c | 259 +
tools/firmware-utils/src/mkfwimage.c | 467 ++
tools/firmware-utils/src/mkfwimage2.c | 447 ++
tools/firmware-utils/src/mkmylofw.c | 1297 +++++
tools/firmware-utils/src/mkplanexfw.c | 269 ++
tools/firmware-utils/src/mktitanimg.c | 1040 ++++
tools/firmware-utils/src/mktitanimg.h | 171 +
tools/firmware-utils/src/mktplinkfw.c | 1084 +++++
tools/firmware-utils/src/mkwrgimg.c | 240 +
tools/firmware-utils/src/mkzcfw.c | 408 ++
tools/firmware-utils/src/mkzynfw.c | 1130 +++++
tools/firmware-utils/src/motorola-bin.c | 227 +
tools/firmware-utils/src/myloader.h | 176 +
tools/firmware-utils/src/nand_ecc.c | 204 +
tools/firmware-utils/src/osbridge-crc.c | 309 ++
tools/firmware-utils/src/pc1crypt.c | 361 ++
tools/firmware-utils/src/ptgen.c | 234 +
tools/firmware-utils/src/seama.c | 529 ++
tools/firmware-utils/src/seama.h | 108 +
tools/firmware-utils/src/sha1.c | 443 ++
tools/firmware-utils/src/sha1.h | 57 +
tools/firmware-utils/src/spw303v.c | 242 +
tools/firmware-utils/src/srec2bin.c | 524 ++
tools/firmware-utils/src/trx.c | 419 ++
tools/firmware-utils/src/trx2edips.c | 171 +
tools/firmware-utils/src/trx2usr.c | 186 +
tools/firmware-utils/src/wndr3700.c | 150 +
tools/firmware-utils/src/wrt400n.c | 334 ++
tools/firmware-utils/src/xorimage.c | 135 +
tools/firmware-utils/src/zynos.h | 225 +
tools/flex/.svn/entries | 62 +
tools/flex/.svn/text-base/Makefile.svn-base | 28 +
tools/flex/Makefile | 28 +
tools/flock/.svn/entries | 65 +
tools/flock/.svn/text-base/Makefile.svn-base | 22 +
tools/flock/Makefile | 22 +
tools/flock/src/.svn/entries | 62 +
tools/flock/src/.svn/text-base/flock.c.svn-base | 325 ++
tools/flock/src/flock.c | 325 ++
tools/genext2fs/.svn/entries | 62 +
tools/genext2fs/.svn/text-base/Makefile.svn-base | 51 +
tools/genext2fs/Makefile | 51 +
tools/gmp/.svn/entries | 65 +
tools/gmp/.svn/text-base/Makefile.svn-base | 30 +
tools/gmp/Makefile | 30 +
tools/gmp/patches/.svn/entries | 28 +
tools/include/.svn/entries | 167 +
tools/include/.svn/text-base/byteswap.h.svn-base | 3 +
tools/include/.svn/text-base/elf.h.svn-base | 3007 ++++++++++++
tools/include/.svn/text-base/endian.h.svn-base | 40 +
tools/include/.svn/text-base/getline.h.svn-base | 68 +
tools/include/byteswap.h | 3 +
tools/include/elf.h | 3007 ++++++++++++
tools/include/endian.h | 40 +
tools/include/getline.h | 68 +
tools/include/sys/.svn/entries | 62 +
.../sys/.svn/text-base/sysmacros.h.svn-base | 56 +
tools/include/sys/sysmacros.h | 56 +
tools/ipkg-utils/.svn/entries | 65 +
tools/ipkg-utils/.svn/prop-base/Makefile.svn-base | 5 +
tools/ipkg-utils/.svn/text-base/Makefile.svn-base | 32 +
tools/ipkg-utils/Makefile | 32 +
tools/ipkg-utils/patches/.svn/entries | 470 ++
.../.svn/prop-base/100-build_clean.patch.svn-base | 5 +
.../.svn/prop-base/110-buildpackage.patch.svn-base | 5 +
.../.svn/prop-base/120-build_tar.patch.svn-base | 5 +
.../.svn/text-base/100-build_clean.patch.svn-base | 35 +
.../.svn/text-base/110-buildpackage.patch.svn-base | 23 +
.../111-buildpackage_conffiles.patch.svn-base | 11 +
.../.svn/text-base/120-build_tar.patch.svn-base | 36 +
.../text-base/130-tar_wildcards.patch.svn-base | 23 +
.../.svn/text-base/140-portability.patch.svn-base | 19 +
.../text-base/150-uppercase_letters.patch.svn-base | 22 +
.../patches/.svn/text-base/160-find.patch.svn-base | 39 +
.../text-base/170-resolve_conffiles.patch.svn-base | 23 +
.../180-add_installed_size.patch.svn-base | 14 +
.../190-preserve_permissions.patch.svn-base | 12 +
.../text-base/200-force_gnu_format.patch.svn-base | 27 +
.../210-remove_field_checks.patch.svn-base | 36 +
tools/ipkg-utils/patches/100-build_clean.patch | 35 +
tools/ipkg-utils/patches/110-buildpackage.patch | 23 +
.../patches/111-buildpackage_conffiles.patch | 11 +
tools/ipkg-utils/patches/120-build_tar.patch | 36 +
tools/ipkg-utils/patches/130-tar_wildcards.patch | 23 +
tools/ipkg-utils/patches/140-portability.patch | 19 +
.../ipkg-utils/patches/150-uppercase_letters.patch | 22 +
tools/ipkg-utils/patches/160-find.patch | 39 +
.../ipkg-utils/patches/170-resolve_conffiles.patch | 23 +
.../patches/180-add_installed_size.patch | 14 +
.../patches/190-preserve_permissions.patch | 12 +
.../ipkg-utils/patches/200-force_gnu_format.patch | 27 +
.../patches/210-remove_field_checks.patch | 36 +
tools/libelf/.svn/entries | 62 +
tools/libelf/.svn/text-base/Makefile.svn-base | 51 +
tools/libelf/Makefile | 51 +
tools/libtool/.svn/entries | 68 +
tools/libtool/.svn/text-base/Makefile.svn-base | 35 +
tools/libtool/Makefile | 35 +
tools/libtool/files/.svn/entries | 130 +
.../.svn/text-base/libtool-v1.5.patch.svn-base | 118 +
.../.svn/text-base/libtool-v2.2.patch.svn-base | 123 +
.../.svn/text-base/libtool-v2.4.patch.svn-base | 160 +
tools/libtool/files/libtool-v1.5.patch | 118 +
tools/libtool/files/libtool-v2.2.patch | 123 +
tools/libtool/files/libtool-v2.4.patch | 160 +
tools/libtool/patches/.svn/entries | 266 ++
.../.svn/text-base/000-relocatable.patch.svn-base | 96 +
.../text-base/001-fix-func_append.patch.svn-base | 22 +
.../.svn/text-base/100-libdir-fixes.patch.svn-base | 94 +
...ont-use-target-dir-for-relinking.patch.svn-base | 20 +
...-strip-unsafe-dirs-for-relinking.patch.svn-base | 24 +
.../text-base/150-trailingslash.patch.svn-base | 49 +
.../text-base/200-openwrt-branding.patch.svn-base | 112 +
tools/libtool/patches/000-relocatable.patch | 96 +
tools/libtool/patches/001-fix-func_append.patch | 22 +
tools/libtool/patches/100-libdir-fixes.patch | 94 +
.../110-dont-use-target-dir-for-relinking.patch | 20 +
.../120-strip-unsafe-dirs-for-relinking.patch | 24 +
tools/libtool/patches/150-trailingslash.patch | 49 +
tools/libtool/patches/200-openwrt-branding.patch | 112 +
tools/lzma-old/.svn/entries | 65 +
tools/lzma-old/.svn/prop-base/Makefile.svn-base | 5 +
tools/lzma-old/.svn/text-base/Makefile.svn-base | 36 +
tools/lzma-old/Makefile | 36 +
tools/lzma-old/patches/.svn/entries | 96 +
.../.svn/text-base/100-lzma_zlib.patch.svn-base | 404 ++
.../.svn/text-base/110-ranlib.patch.svn-base | 10 +
tools/lzma-old/patches/100-lzma_zlib.patch | 404 ++
tools/lzma-old/patches/110-ranlib.patch | 10 +
tools/lzma/.svn/entries | 65 +
tools/lzma/.svn/text-base/Makefile.svn-base | 36 +
tools/lzma/Makefile | 36 +
tools/lzma/patches/.svn/entries | 164 +
.../.svn/text-base/001-large_files.patch.svn-base | 13 +
.../patches/.svn/text-base/002-lzmp.patch.svn-base | 1059 ++++
.../text-base/003-compile_fixes.patch.svn-base | 26 +
.../text-base/100-static_library.patch.svn-base | 70 +
tools/lzma/patches/001-large_files.patch | 13 +
tools/lzma/patches/002-lzmp.patch | 1059 ++++
tools/lzma/patches/003-compile_fixes.patch | 26 +
tools/lzma/patches/100-static_library.patch | 70 +
tools/m4/.svn/entries | 65 +
tools/m4/.svn/text-base/Makefile.svn-base | 30 +
tools/m4/Makefile | 30 +
tools/m4/patches/.svn/entries | 62 +
.../text-base/100-fix-gets-removal.patch.svn-base | 15 +
tools/m4/patches/100-fix-gets-removal.patch | 15 +
tools/missing-macros/.svn/entries | 65 +
.../.svn/text-base/Makefile.svn-base | 26 +
tools/missing-macros/Makefile | 26 +
tools/missing-macros/src/.svn/entries | 65 +
.../src/.svn/text-base/README.svn-base | 100 +
tools/missing-macros/src/README | 100 +
tools/missing-macros/src/m4/.svn/entries | 946 ++++
.../src/m4/.svn/text-base/as-ac-expand.m4.svn-base | 43 +
.../m4/.svn/text-base/as-compiler-flag.m4.svn-base | 62 +
.../.svn/text-base/as-unaligned-access.m4.svn-base | 41 +
.../src/m4/.svn/text-base/as-version.m4.svn-base | 71 +
.../src/m4/.svn/text-base/dnet.m4.svn-base | 322 ++
.../src/m4/.svn/text-base/esd.m4.svn-base | 196 +
.../.svn/text-base/fake-gtk-doc-check.m4.svn-base | 13 +
.../m4/.svn/text-base/fake-intltool.m4.svn-base | 16 +
.../src/m4/.svn/text-base/glibc2.m4.svn-base | 30 +
.../src/m4/.svn/text-base/glibc21.m4.svn-base | 30 +
.../src/m4/.svn/text-base/intdiv0.m4.svn-base | 84 +
.../src/m4/.svn/text-base/intmax.m4.svn-base | 33 +
.../src/m4/.svn/text-base/inttypes-pri.m4.svn-base | 36 +
.../src/m4/.svn/text-base/inttypes_h.m4.svn-base | 26 +
.../src/m4/.svn/text-base/lib-ld.m4.svn-base | 110 +
.../src/m4/.svn/text-base/lib-link.m4.svn-base | 774 +++
.../src/m4/.svn/text-base/lib-prefix.m4.svn-base | 224 +
.../src/m4/.svn/text-base/mfx_acc.m4.svn-base | 163 +
.../src/m4/.svn/text-base/mfx_cppflags.m4.svn-base | 41 +
.../src/m4/.svn/text-base/mfx_limits.m4.svn-base | 154 +
.../src/m4/.svn/text-base/progtest.m4.svn-base | 92 +
.../src/m4/.svn/text-base/stdint_h.m4.svn-base | 26 +
.../src/m4/.svn/text-base/uintmax_t.m4.svn-base | 30 +
.../src/m4/.svn/text-base/va_copy.m4.svn-base | 111 +
.../src/m4/.svn/text-base/wint_t.m4.svn-base | 28 +
.../src/m4/.svn/text-base/xaw.m4.svn-base | 65 +
.../src/m4/.svn/text-base/xmms.m4.svn-base | 149 +
tools/missing-macros/src/m4/as-ac-expand.m4 | 43 +
tools/missing-macros/src/m4/as-compiler-flag.m4 | 62 +
tools/missing-macros/src/m4/as-unaligned-access.m4 | 41 +
tools/missing-macros/src/m4/as-version.m4 | 71 +
tools/missing-macros/src/m4/dnet.m4 | 322 ++
tools/missing-macros/src/m4/esd.m4 | 196 +
tools/missing-macros/src/m4/fake-gtk-doc-check.m4 | 13 +
tools/missing-macros/src/m4/fake-intltool.m4 | 16 +
tools/missing-macros/src/m4/glibc2.m4 | 30 +
tools/missing-macros/src/m4/glibc21.m4 | 30 +
tools/missing-macros/src/m4/intdiv0.m4 | 84 +
tools/missing-macros/src/m4/intmax.m4 | 33 +
tools/missing-macros/src/m4/inttypes-pri.m4 | 36 +
tools/missing-macros/src/m4/inttypes_h.m4 | 26 +
tools/missing-macros/src/m4/lib-ld.m4 | 110 +
tools/missing-macros/src/m4/lib-link.m4 | 774 +++
tools/missing-macros/src/m4/lib-prefix.m4 | 224 +
tools/missing-macros/src/m4/mfx_acc.m4 | 163 +
tools/missing-macros/src/m4/mfx_cppflags.m4 | 41 +
tools/missing-macros/src/m4/mfx_limits.m4 | 154 +
tools/missing-macros/src/m4/progtest.m4 | 92 +
tools/missing-macros/src/m4/stdint_h.m4 | 26 +
tools/missing-macros/src/m4/uintmax_t.m4 | 30 +
tools/missing-macros/src/m4/va_copy.m4 | 111 +
tools/missing-macros/src/m4/wint_t.m4 | 28 +
tools/missing-macros/src/m4/xaw.m4 | 65 +
tools/missing-macros/src/m4/xmms.m4 | 149 +
tools/mkimage/.svn/entries | 65 +
tools/mkimage/.svn/text-base/Makefile.svn-base | 42 +
tools/mkimage/Makefile | 42 +
tools/mkimage/patches/.svn/entries | 198 +
.../text-base/010-freebsd-ulong-fix.patch.svn-base | 13 +
.../text-base/020-openbsd_fixes.patch.svn-base | 18 +
...030-allow-to-use-different-magic.patch.svn-base | 63 +
.../text-base/040-include_order.patch.svn-base | 14 +
.../050-image_h_portability.patch.svn-base | 31 +
tools/mkimage/patches/010-freebsd-ulong-fix.patch | 13 +
tools/mkimage/patches/020-openbsd_fixes.patch | 18 +
.../patches/030-allow-to-use-different-magic.patch | 63 +
tools/mkimage/patches/040-include_order.patch | 14 +
.../mkimage/patches/050-image_h_portability.patch | 31 +
tools/mklibs/.svn/entries | 68 +
tools/mklibs/.svn/text-base/Makefile.svn-base | 35 +
tools/mklibs/Makefile | 35 +
tools/mklibs/include/.svn/entries | 62 +
tools/mklibs/include/.svn/text-base/elf.h.svn-base | 2559 ++++++++++
tools/mklibs/include/elf.h | 2559 ++++++++++
tools/mklibs/patches/.svn/entries | 402 ++
.../.svn/text-base/001-compile.patch.svn-base | 8 +
.../002-disable_symbol_checks.patch.svn-base | 20 +
.../.svn/text-base/003-no_copy.patch.svn-base | 50 +
.../text-base/004-libpthread_link.patch.svn-base | 28 +
.../text-base/005-duplicate_syms.patch.svn-base | 35 +
.../.svn/text-base/006-uclibc_init.patch.svn-base | 14 +
.../.svn/text-base/007-gc_sections.patch.svn-base | 11 +
.../008-uclibc_libgcc_link.patch.svn-base | 37 +
.../009-uclibc_libpthread_symbols.patch.svn-base | 63 +
.../010-remove_STT_GNU_IFUNC.patch.svn-base | 20 +
.../text-base/011-remove_multiarch.patch.svn-base | 10 +
tools/mklibs/patches/001-compile.patch | 8 +
.../mklibs/patches/002-disable_symbol_checks.patch | 20 +
tools/mklibs/patches/003-no_copy.patch | 50 +
tools/mklibs/patches/004-libpthread_link.patch | 28 +
tools/mklibs/patches/005-duplicate_syms.patch | 35 +
tools/mklibs/patches/006-uclibc_init.patch | 14 +
tools/mklibs/patches/007-gc_sections.patch | 11 +
tools/mklibs/patches/008-uclibc_libgcc_link.patch | 37 +
.../patches/009-uclibc_libpthread_symbols.patch | 63 +
.../mklibs/patches/010-remove_STT_GNU_IFUNC.patch | 20 +
tools/mklibs/patches/011-remove_multiarch.patch | 10 +
tools/mm-macros/.svn/entries | 62 +
tools/mm-macros/.svn/text-base/Makefile.svn-base | 31 +
tools/mm-macros/Makefile | 31 +
tools/mpc/.svn/entries | 62 +
tools/mpc/.svn/text-base/Makefile.svn-base | 28 +
tools/mpc/Makefile | 28 +
tools/mpfr/.svn/entries | 65 +
tools/mpfr/.svn/text-base/Makefile.svn-base | 26 +
tools/mpfr/Makefile | 26 +
tools/mpfr/patches/.svn/entries | 62 +
.../.svn/text-base/001-only_src.patch.svn-base | 22 +
tools/mpfr/patches/001-only_src.patch | 22 +
tools/mtd-utils/.svn/entries | 68 +
tools/mtd-utils/.svn/prop-base/Makefile.svn-base | 5 +
tools/mtd-utils/.svn/text-base/Makefile.svn-base | 65 +
tools/mtd-utils/Makefile | 65 +
tools/mtd-utils/include/.svn/entries | 65 +
.../include/.svn/text-base/fls.h.svn-base | 2 +
tools/mtd-utils/include/fls.h | 2 +
tools/mtd-utils/include/linux/.svn/entries | 62 +
.../include/linux/.svn/text-base/types.h.svn-base | 18 +
tools/mtd-utils/include/linux/types.h | 18 +
tools/mtd-utils/patches/.svn/entries | 300 ++
.../.svn/text-base/110-portability.patch.svn-base | 150 +
.../.svn/text-base/120-cygwin_fixes.patch.svn-base | 457 ++
.../.svn/text-base/130-lzma_jffs2.patch.svn-base | 5031 ++++++++++++++++++++
.../text-base/131-fix_lib_compile.patch.svn-base | 11 +
.../.svn/text-base/133-error-fix.patch.svn-base | 20 +
.../text-base/134-freebsd_loff_t.patch.svn-base | 13 +
.../135-mkubifs_optional_lzo.patch.svn-base | 119 +
.../136-mkfs.ubifs-xz-support.patch.svn-base | 404 ++
tools/mtd-utils/patches/110-portability.patch | 150 +
tools/mtd-utils/patches/120-cygwin_fixes.patch | 457 ++
tools/mtd-utils/patches/130-lzma_jffs2.patch | 5031 ++++++++++++++++++++
tools/mtd-utils/patches/131-fix_lib_compile.patch | 11 +
tools/mtd-utils/patches/133-error-fix.patch | 20 +
tools/mtd-utils/patches/134-freebsd_loff_t.patch | 13 +
.../patches/135-mkubifs_optional_lzo.patch | 119 +
.../patches/136-mkfs.ubifs-xz-support.patch | 404 ++
tools/mtools/.svn/entries | 62 +
tools/mtools/.svn/text-base/Makefile.svn-base | 33 +
tools/mtools/Makefile | 33 +
tools/padjffs2/.svn/entries | 65 +
tools/padjffs2/.svn/prop-base/Makefile.svn-base | 5 +
tools/padjffs2/.svn/text-base/Makefile.svn-base | 36 +
tools/padjffs2/Makefile | 36 +
tools/padjffs2/src/.svn/entries | 96 +
.../padjffs2/src/.svn/prop-base/Makefile.svn-base | 5 +
.../src/.svn/prop-base/padjffs2.c.svn-base | 5 +
.../padjffs2/src/.svn/text-base/Makefile.svn-base | 15 +
.../src/.svn/text-base/padjffs2.c.svn-base | 155 +
tools/padjffs2/src/Makefile | 15 +
tools/padjffs2/src/padjffs2.c | 155 +
tools/patch-image/.svn/entries | 65 +
tools/patch-image/.svn/text-base/Makefile.svn-base | 28 +
tools/patch-image/Makefile | 28 +
tools/patch-image/src/.svn/entries | 96 +
.../src/.svn/prop-base/patch-cmdline.c.svn-base | 5 +
.../src/.svn/prop-base/patch-dtb.c.svn-base | 5 +
.../src/.svn/text-base/patch-cmdline.c.svn-base | 79 +
.../src/.svn/text-base/patch-dtb.c.svn-base | 101 +
tools/patch-image/src/patch-cmdline.c | 79 +
tools/patch-image/src/patch-dtb.c | 101 +
tools/patch/.svn/entries | 62 +
tools/patch/.svn/text-base/Makefile.svn-base | 18 +
tools/patch/Makefile | 18 +
tools/pkg-config/.svn/entries | 68 +
tools/pkg-config/.svn/text-base/Makefile.svn-base | 34 +
tools/pkg-config/Makefile | 34 +
tools/pkg-config/files/.svn/entries | 62 +
.../files/.svn/prop-base/pkg-config.svn-base | 5 +
.../files/.svn/text-base/pkg-config.svn-base | 3 +
tools/pkg-config/files/pkg-config | 3 +
tools/pkg-config/patches/.svn/entries | 62 +
.../100-disable_compat_cmd.patch.svn-base | 22 +
.../patches/100-disable_compat_cmd.patch | 22 +
tools/ppl/.svn/entries | 65 +
tools/ppl/.svn/text-base/Makefile.svn-base | 35 +
tools/ppl/Makefile | 35 +
tools/ppl/patches/.svn/entries | 96 +
.../.svn/text-base/001-gmp_5_fix.patch.svn-base | 38 +
.../002-replace-pkglib_DATA.patch.svn-base | 75 +
tools/ppl/patches/001-gmp_5_fix.patch | 38 +
tools/ppl/patches/002-replace-pkglib_DATA.patch | 75 +
tools/qemu/.svn/entries | 65 +
tools/qemu/.svn/text-base/Makefile.svn-base | 41 +
tools/qemu/Makefile | 41 +
tools/qemu/patches/.svn/entries | 28 +
tools/quilt/.svn/entries | 65 +
tools/quilt/.svn/text-base/Makefile.svn-base | 39 +
tools/quilt/Makefile | 39 +
tools/quilt/patches/.svn/entries | 130 +
.../.svn/text-base/000-relocatable.patch.svn-base | 83 +
.../.svn/text-base/001-fix_compile.patch.svn-base | 18 +
.../100-patch_2.6.1_version.patch.svn-base | 15 +
tools/quilt/patches/000-relocatable.patch | 83 +
tools/quilt/patches/001-fix_compile.patch | 18 +
tools/quilt/patches/100-patch_2.6.1_version.patch | 15 +
tools/scons/.svn/entries | 68 +
tools/scons/.svn/text-base/Makefile.svn-base | 34 +
tools/scons/Makefile | 34 +
tools/scons/files/.svn/entries | 62 +
.../scons/files/.svn/prop-base/pywrap.sh.svn-base | 5 +
.../scons/files/.svn/text-base/pywrap.sh.svn-base | 15 +
tools/scons/files/pywrap.sh | 15 +
tools/scons/patches/.svn/entries | 62 +
.../.svn/text-base/001-platform_env.patch.svn-base | 11 +
tools/scons/patches/001-platform_env.patch | 11 +
tools/sdcc/.svn/entries | 65 +
tools/sdcc/.svn/text-base/Makefile.svn-base | 43 +
tools/sdcc/Makefile | 43 +
tools/sdcc/patches/.svn/entries | 96 +
.../100-workaround-gcc-4.6.2-hang.patch.svn-base | 20 +
.../200-fix_order_of_linking.patch.svn-base | 92 +
.../patches/100-workaround-gcc-4.6.2-hang.patch | 20 +
tools/sdcc/patches/200-fix_order_of_linking.patch | 92 +
tools/sed/.svn/entries | 62 +
tools/sed/.svn/prop-base/Makefile.svn-base | 5 +
tools/sed/.svn/text-base/Makefile.svn-base | 43 +
tools/sed/Makefile | 43 +
tools/squashfs/.svn/entries | 65 +
tools/squashfs/.svn/prop-base/Makefile.svn-base | 5 +
tools/squashfs/.svn/text-base/Makefile.svn-base | 39 +
tools/squashfs/Makefile | 39 +
tools/squashfs/patches/.svn/entries | 62 +
.../patches/.svn/prop-base/100-lzma.patch.svn-base | 5 +
.../patches/.svn/text-base/100-lzma.patch.svn-base | 22 +
tools/squashfs/patches/100-lzma.patch | 22 +
tools/squashfs4/.svn/entries | 65 +
tools/squashfs4/.svn/prop-base/Makefile.svn-base | 5 +
tools/squashfs4/.svn/text-base/Makefile.svn-base | 43 +
tools/squashfs4/Makefile | 43 +
tools/squashfs4/patches/.svn/entries | 266 ++
.../.svn/text-base/100-portability.patch.svn-base | 40 +
.../110-allow_static_liblzma.patch.svn-base | 30 +
.../.svn/text-base/120-cygwin_fixes.patch.svn-base | 153 +
.../text-base/150-freebsd_fixes.patch.svn-base | 10 +
.../160-expose_lzma_xz_options.patch.svn-base | 929 ++++
...port_for_LZMA_MAGIC_to_unsqashfs.patch.svn-base | 72 +
.../text-base/180-openbsd_compat.patch.svn-base | 26 +
tools/squashfs4/patches/100-portability.patch | 40 +
.../patches/110-allow_static_liblzma.patch | 30 +
tools/squashfs4/patches/120-cygwin_fixes.patch | 153 +
tools/squashfs4/patches/150-freebsd_fixes.patch | 10 +
.../patches/160-expose_lzma_xz_options.patch | 929 ++++
...0-add_support_for_LZMA_MAGIC_to_unsqashfs.patch | 72 +
tools/squashfs4/patches/180-openbsd_compat.patch | 26 +
tools/sstrip/.svn/entries | 65 +
tools/sstrip/.svn/prop-base/Makefile.svn-base | 5 +
tools/sstrip/.svn/text-base/Makefile.svn-base | 25 +
tools/sstrip/Makefile | 25 +
tools/sstrip/src/.svn/entries | 62 +
tools/sstrip/src/.svn/prop-base/sstrip.c.svn-base | 5 +
tools/sstrip/src/.svn/text-base/sstrip.c.svn-base | 465 ++
tools/sstrip/src/sstrip.c | 465 ++
tools/upslug2/.svn/entries | 65 +
tools/upslug2/.svn/text-base/Makefile.svn-base | 36 +
tools/upslug2/Makefile | 36 +
tools/upslug2/patches/.svn/entries | 96 +
.../.svn/text-base/100-libpcap_fix.patch.svn-base | 153 +
.../text-base/110-wrt350nv2_support.patch.svn-base | 279 ++
tools/upslug2/patches/100-libpcap_fix.patch | 153 +
tools/upslug2/patches/110-wrt350nv2_support.patch | 279 ++
tools/upx/.svn/entries | 65 +
tools/upx/.svn/text-base/Makefile.svn-base | 35 +
tools/upx/Makefile | 35 +
tools/upx/patches/.svn/entries | 62 +
.../.svn/text-base/100-lzmaonly.patch.svn-base | 156 +
tools/upx/patches/100-lzmaonly.patch | 156 +
tools/wrt350nv2-builder/.svn/entries | 65 +
.../.svn/text-base/Makefile.svn-base | 41 +
tools/wrt350nv2-builder/Makefile | 41 +
tools/wrt350nv2-builder/src/.svn/entries | 266 ++
.../src/.svn/text-base/crypt.h.svn-base | 132 +
.../src/.svn/text-base/ioapi.c.svn-base | 177 +
.../src/.svn/text-base/ioapi.h.svn-base | 75 +
.../src/.svn/text-base/md5.c.svn-base | 381 ++
.../src/.svn/text-base/md5.h.svn-base | 91 +
.../src/.svn/text-base/upgrade.h.svn-base | 77 +
.../.svn/text-base/wrt350nv2-builder.c.svn-base | 1126 +++++
tools/wrt350nv2-builder/src/crypt.h | 132 +
tools/wrt350nv2-builder/src/ioapi.c | 177 +
tools/wrt350nv2-builder/src/ioapi.h | 75 +
tools/wrt350nv2-builder/src/md5.c | 381 ++
tools/wrt350nv2-builder/src/md5.h | 91 +
tools/wrt350nv2-builder/src/upgrade.h | 77 +
tools/wrt350nv2-builder/src/wrt350nv2-builder.c | 1126 +++++
tools/xfce-macros/.svn/entries | 62 +
tools/xfce-macros/.svn/text-base/Makefile.svn-base | 32 +
tools/xfce-macros/Makefile | 32 +
tools/xorg-macros/.svn/dir-prop-base | 5 +
tools/xorg-macros/.svn/entries | 62 +
tools/xorg-macros/.svn/text-base/Makefile.svn-base | 31 +
tools/xorg-macros/Makefile | 31 +
tools/xz/.svn/entries | 62 +
tools/xz/.svn/text-base/Makefile.svn-base | 27 +
tools/xz/Makefile | 27 +
tools/yaffs2/.svn/entries | 65 +
tools/yaffs2/.svn/text-base/Makefile.svn-base | 39 +
tools/yaffs2/Makefile | 39 +
tools/yaffs2/patches/.svn/entries | 96 +
.../.svn/text-base/100-compile.patch.svn-base | 125 +
.../text-base/110-openbsd-compat.patch.svn-base | 14 +
tools/yaffs2/patches/100-compile.patch | 125 +
tools/yaffs2/patches/110-openbsd-compat.patch | 14 +
672 files changed, 109727 insertions(+)
create mode 100644 tools/.svn/entries
create mode 100644 tools/.svn/prop-base/Makefile.svn-base
create mode 100644 tools/.svn/text-base/Makefile.svn-base
create mode 100644 tools/Makefile
create mode 100644 tools/autoconf/.svn/entries
create mode 100644 tools/autoconf/.svn/text-base/Makefile.svn-base
create mode 100644 tools/autoconf/Makefile
create mode 100644 tools/autoconf/patches/.svn/entries
create mode 100644 tools/autoconf/patches/.svn/text-base/000-relocatable.patch.svn-base
create mode 100644 tools/autoconf/patches/.svn/text-base/001-no_emacs_lib.patch.svn-base
create mode 100644 tools/autoconf/patches/000-relocatable.patch
create mode 100644 tools/autoconf/patches/001-no_emacs_lib.patch
create mode 100644 tools/automake/.svn/entries
create mode 100644 tools/automake/.svn/text-base/Makefile.svn-base
create mode 100644 tools/automake/Makefile
create mode 100644 tools/automake/files/.svn/entries
create mode 100644 tools/automake/files/.svn/prop-base/aclocal.svn-base
create mode 100644 tools/automake/files/.svn/text-base/aclocal.svn-base
create mode 100755 tools/automake/files/aclocal
create mode 100644 tools/automake/patches/.svn/entries
create mode 100644 tools/automake/patches/.svn/text-base/000-relocatable.patch.svn-base
create mode 100644 tools/automake/patches/.svn/text-base/100-aclocal-skip-not-existing-directories.patch.svn-base
create mode 100644 tools/automake/patches/.svn/text-base/200-fix_missing_py_compile.patch.svn-base
create mode 100644 tools/automake/patches/000-relocatable.patch
create mode 100644 tools/automake/patches/100-aclocal-skip-not-existing-directories.patch
create mode 100644 tools/automake/patches/200-fix_missing_py_compile.patch
create mode 100644 tools/b43-tools/.svn/entries
create mode 100644 tools/b43-tools/.svn/text-base/Makefile.svn-base
create mode 100644 tools/b43-tools/Makefile
create mode 100644 tools/b43-tools/files/.svn/entries
create mode 100644 tools/b43-tools/files/.svn/prop-base/b43-fwsquash.py.svn-base
create mode 100644 tools/b43-tools/files/.svn/text-base/b43-fwsquash.py.svn-base
create mode 100755 tools/b43-tools/files/b43-fwsquash.py
create mode 100644 tools/b43-tools/patches/.svn/entries
create mode 100644 tools/b43-tools/patches/.svn/text-base/001-fw-dirname.patch.svn-base
create mode 100644 tools/b43-tools/patches/.svn/text-base/002-no_libfl.patch.svn-base
create mode 100644 tools/b43-tools/patches/.svn/text-base/100-b43-asm-fix-compile-error-undefined-reference-to-yyd.patch.svn-base
create mode 100644 tools/b43-tools/patches/001-fw-dirname.patch
create mode 100644 tools/b43-tools/patches/002-no_libfl.patch
create mode 100644 tools/b43-tools/patches/100-b43-asm-fix-compile-error-undefined-reference-to-yyd.patch
create mode 100644 tools/bison/.svn/entries
create mode 100644 tools/bison/.svn/text-base/Makefile.svn-base
create mode 100644 tools/bison/Makefile
create mode 100644 tools/bison/patches/.svn/entries
create mode 100644 tools/bison/patches/.svn/text-base/000-relocatable.patch.svn-base
create mode 100644 tools/bison/patches/.svn/text-base/010-intl-stub-compat.patch.svn-base
create mode 100644 tools/bison/patches/.svn/text-base/100-fix-gets-removal.patch.svn-base
create mode 100644 tools/bison/patches/000-relocatable.patch
create mode 100644 tools/bison/patches/010-intl-stub-compat.patch
create mode 100644 tools/bison/patches/100-fix-gets-removal.patch
create mode 100644 tools/ccache/.svn/entries
create mode 100644 tools/ccache/.svn/text-base/Makefile.svn-base
create mode 100644 tools/ccache/Makefile
create mode 100644 tools/ccache/files/.svn/entries
create mode 100644 tools/ccache/files/.svn/prop-base/ccache_cc.svn-base
create mode 100644 tools/ccache/files/.svn/prop-base/ccache_cxx.svn-base
create mode 100644 tools/ccache/files/.svn/text-base/ccache_cc.svn-base
create mode 100644 tools/ccache/files/.svn/text-base/ccache_cxx.svn-base
create mode 100755 tools/ccache/files/ccache_cc
create mode 100755 tools/ccache/files/ccache_cxx
create mode 100644 tools/cloog/.svn/entries
create mode 100644 tools/cloog/.svn/text-base/Makefile.svn-base
create mode 100644 tools/cloog/Makefile
create mode 100644 tools/cmake/.svn/entries
create mode 100644 tools/cmake/.svn/text-base/Makefile.svn-base
create mode 100644 tools/cmake/Makefile
create mode 100644 tools/dosfstools/.svn/entries
create mode 100644 tools/dosfstools/.svn/text-base/Makefile.svn-base
create mode 100644 tools/dosfstools/Makefile
create mode 100644 tools/e2fsprogs/.svn/entries
create mode 100644 tools/e2fsprogs/.svn/text-base/Makefile.svn-base
create mode 100644 tools/e2fsprogs/Makefile
create mode 100644 tools/e2fsprogs/patches/.svn/entries
create mode 100644 tools/e2fsprogs/patches/.svn/text-base/001-exit_0_on_corrected_errors.patch.svn-base
create mode 100644 tools/e2fsprogs/patches/.svn/text-base/002-dont-build-e4defrag.patch.svn-base
create mode 100644 tools/e2fsprogs/patches/.svn/text-base/003-openbsd-compat.patch.svn-base
create mode 100644 tools/e2fsprogs/patches/.svn/text-base/004-freebsd-compat.patch.svn-base
create mode 100644 tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch
create mode 100644 tools/e2fsprogs/patches/002-dont-build-e4defrag.patch
create mode 100644 tools/e2fsprogs/patches/003-openbsd-compat.patch
create mode 100644 tools/e2fsprogs/patches/004-freebsd-compat.patch
create mode 100644 tools/firmware-utils/.svn/entries
create mode 100644 tools/firmware-utils/.svn/prop-base/Makefile.svn-base
create mode 100644 tools/firmware-utils/.svn/text-base/Makefile.svn-base
create mode 100644 tools/firmware-utils/Makefile
create mode 100644 tools/firmware-utils/src/.svn/entries
create mode 100644 tools/firmware-utils/src/.svn/prop-base/addpattern.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/bcm_tag.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/buffalo-enc.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/buffalo-lib.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/buffalo-lib.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/buffalo-tag.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/buffalo-tftp.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/cyg_crc.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/cyg_crc16.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/cyg_crc32.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/fix-u-media-header.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/md5.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/md5.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/mkcameofw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/mkcasfw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/mkdir615h1.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/mkfwimage2.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/mkplanexfw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/mktplinkfw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/mkwrgimg.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/mkzcfw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/mkzynfw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/motorola-bin.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/osbridge-crc.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/pc1crypt.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/seama.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/seama.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/sha1.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/sha1.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/trx.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/wrt400n.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/prop-base/zynos.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/add_header.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/addpattern.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/airlink.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/bcm_tag.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/buffalo-enc.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/buffalo-lib.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/buffalo-lib.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/buffalo-tag.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/buffalo-tftp.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/csysimg.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/cyg_crc.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/cyg_crc16.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/cyg_crc32.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/dgfirmware.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/encode_crc.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/fix-u-media-header.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/fw.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/imagetag.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/imagetag.ggo.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/imagetag_cmdline.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/imagetag_cmdline.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/lzma2eva.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/makeamitbin.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/md5.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/md5.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkbrncmdline.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkbrnimg.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkcameofw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkcasfw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkchkimg.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkcsysimg.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkdapimg.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkdir615h1.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkdniimg.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkedimaximg.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkfwimage.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkfwimage2.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkmylofw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkplanexfw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mktitanimg.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mktitanimg.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mktplinkfw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkwrgimg.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkzcfw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/mkzynfw.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/motorola-bin.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/myloader.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/nand_ecc.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/osbridge-crc.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/pc1crypt.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/ptgen.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/seama.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/seama.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/sha1.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/sha1.h.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/spw303v.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/srec2bin.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/trx.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/trx2edips.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/trx2usr.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/wndr3700.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/wrt400n.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/xorimage.c.svn-base
create mode 100644 tools/firmware-utils/src/.svn/text-base/zynos.h.svn-base
create mode 100644 tools/firmware-utils/src/add_header.c
create mode 100644 tools/firmware-utils/src/addpattern.c
create mode 100644 tools/firmware-utils/src/airlink.c
create mode 100644 tools/firmware-utils/src/bcm_tag.h
create mode 100644 tools/firmware-utils/src/buffalo-enc.c
create mode 100644 tools/firmware-utils/src/buffalo-lib.c
create mode 100644 tools/firmware-utils/src/buffalo-lib.h
create mode 100644 tools/firmware-utils/src/buffalo-tag.c
create mode 100644 tools/firmware-utils/src/buffalo-tftp.c
create mode 100644 tools/firmware-utils/src/csysimg.h
create mode 100644 tools/firmware-utils/src/cyg_crc.h
create mode 100644 tools/firmware-utils/src/cyg_crc16.c
create mode 100644 tools/firmware-utils/src/cyg_crc32.c
create mode 100644 tools/firmware-utils/src/dgfirmware.c
create mode 100644 tools/firmware-utils/src/encode_crc.c
create mode 100644 tools/firmware-utils/src/fix-u-media-header.c
create mode 100644 tools/firmware-utils/src/fw.h
create mode 100644 tools/firmware-utils/src/imagetag.c
create mode 100644 tools/firmware-utils/src/imagetag.ggo
create mode 100644 tools/firmware-utils/src/imagetag_cmdline.c
create mode 100644 tools/firmware-utils/src/imagetag_cmdline.h
create mode 100644 tools/firmware-utils/src/lzma2eva.c
create mode 100644 tools/firmware-utils/src/makeamitbin.c
create mode 100644 tools/firmware-utils/src/md5.c
create mode 100644 tools/firmware-utils/src/md5.h
create mode 100644 tools/firmware-utils/src/mkbrncmdline.c
create mode 100644 tools/firmware-utils/src/mkbrnimg.c
create mode 100644 tools/firmware-utils/src/mkcameofw.c
create mode 100644 tools/firmware-utils/src/mkcasfw.c
create mode 100644 tools/firmware-utils/src/mkchkimg.c
create mode 100644 tools/firmware-utils/src/mkcsysimg.c
create mode 100644 tools/firmware-utils/src/mkdapimg.c
create mode 100644 tools/firmware-utils/src/mkdir615h1.c
create mode 100644 tools/firmware-utils/src/mkdniimg.c
create mode 100644 tools/firmware-utils/src/mkedimaximg.c
create mode 100644 tools/firmware-utils/src/mkfwimage.c
create mode 100644 tools/firmware-utils/src/mkfwimage2.c
create mode 100644 tools/firmware-utils/src/mkmylofw.c
create mode 100644 tools/firmware-utils/src/mkplanexfw.c
create mode 100644 tools/firmware-utils/src/mktitanimg.c
create mode 100644 tools/firmware-utils/src/mktitanimg.h
create mode 100644 tools/firmware-utils/src/mktplinkfw.c
create mode 100644 tools/firmware-utils/src/mkwrgimg.c
create mode 100644 tools/firmware-utils/src/mkzcfw.c
create mode 100644 tools/firmware-utils/src/mkzynfw.c
create mode 100644 tools/firmware-utils/src/motorola-bin.c
create mode 100644 tools/firmware-utils/src/myloader.h
create mode 100644 tools/firmware-utils/src/nand_ecc.c
create mode 100644 tools/firmware-utils/src/osbridge-crc.c
create mode 100644 tools/firmware-utils/src/pc1crypt.c
create mode 100644 tools/firmware-utils/src/ptgen.c
create mode 100644 tools/firmware-utils/src/seama.c
create mode 100644 tools/firmware-utils/src/seama.h
create mode 100644 tools/firmware-utils/src/sha1.c
create mode 100644 tools/firmware-utils/src/sha1.h
create mode 100644 tools/firmware-utils/src/spw303v.c
create mode 100644 tools/firmware-utils/src/srec2bin.c
create mode 100644 tools/firmware-utils/src/trx.c
create mode 100644 tools/firmware-utils/src/trx2edips.c
create mode 100644 tools/firmware-utils/src/trx2usr.c
create mode 100644 tools/firmware-utils/src/wndr3700.c
create mode 100644 tools/firmware-utils/src/wrt400n.c
create mode 100644 tools/firmware-utils/src/xorimage.c
create mode 100644 tools/firmware-utils/src/zynos.h
create mode 100644 tools/flex/.svn/entries
create mode 100644 tools/flex/.svn/text-base/Makefile.svn-base
create mode 100644 tools/flex/Makefile
create mode 100644 tools/flock/.svn/entries
create mode 100644 tools/flock/.svn/text-base/Makefile.svn-base
create mode 100644 tools/flock/Makefile
create mode 100644 tools/flock/src/.svn/entries
create mode 100644 tools/flock/src/.svn/text-base/flock.c.svn-base
create mode 100644 tools/flock/src/flock.c
create mode 100644 tools/genext2fs/.svn/entries
create mode 100644 tools/genext2fs/.svn/text-base/Makefile.svn-base
create mode 100644 tools/genext2fs/Makefile
create mode 100644 tools/gmp/.svn/entries
create mode 100644 tools/gmp/.svn/text-base/Makefile.svn-base
create mode 100644 tools/gmp/Makefile
create mode 100644 tools/gmp/patches/.svn/entries
create mode 100644 tools/include/.svn/entries
create mode 100644 tools/include/.svn/text-base/byteswap.h.svn-base
create mode 100644 tools/include/.svn/text-base/elf.h.svn-base
create mode 100644 tools/include/.svn/text-base/endian.h.svn-base
create mode 100644 tools/include/.svn/text-base/getline.h.svn-base
create mode 100644 tools/include/byteswap.h
create mode 100644 tools/include/elf.h
create mode 100644 tools/include/endian.h
create mode 100644 tools/include/getline.h
create mode 100644 tools/include/sys/.svn/entries
create mode 100644 tools/include/sys/.svn/text-base/sysmacros.h.svn-base
create mode 100644 tools/include/sys/sysmacros.h
create mode 100644 tools/ipkg-utils/.svn/entries
create mode 100644 tools/ipkg-utils/.svn/prop-base/Makefile.svn-base
create mode 100644 tools/ipkg-utils/.svn/text-base/Makefile.svn-base
create mode 100644 tools/ipkg-utils/Makefile
create mode 100644 tools/ipkg-utils/patches/.svn/entries
create mode 100644 tools/ipkg-utils/patches/.svn/prop-base/100-build_clean.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/prop-base/110-buildpackage.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/prop-base/120-build_tar.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/100-build_clean.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/110-buildpackage.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/111-buildpackage_conffiles.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/120-build_tar.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/130-tar_wildcards.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/140-portability.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/150-uppercase_letters.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/160-find.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/170-resolve_conffiles.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/180-add_installed_size.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/190-preserve_permissions.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/200-force_gnu_format.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/.svn/text-base/210-remove_field_checks.patch.svn-base
create mode 100644 tools/ipkg-utils/patches/100-build_clean.patch
create mode 100644 tools/ipkg-utils/patches/110-buildpackage.patch
create mode 100644 tools/ipkg-utils/patches/111-buildpackage_conffiles.patch
create mode 100644 tools/ipkg-utils/patches/120-build_tar.patch
create mode 100644 tools/ipkg-utils/patches/130-tar_wildcards.patch
create mode 100644 tools/ipkg-utils/patches/140-portability.patch
create mode 100644 tools/ipkg-utils/patches/150-uppercase_letters.patch
create mode 100644 tools/ipkg-utils/patches/160-find.patch
create mode 100644 tools/ipkg-utils/patches/170-resolve_conffiles.patch
create mode 100644 tools/ipkg-utils/patches/180-add_installed_size.patch
create mode 100644 tools/ipkg-utils/patches/190-preserve_permissions.patch
create mode 100644 tools/ipkg-utils/patches/200-force_gnu_format.patch
create mode 100644 tools/ipkg-utils/patches/210-remove_field_checks.patch
create mode 100644 tools/libelf/.svn/entries
create mode 100644 tools/libelf/.svn/text-base/Makefile.svn-base
create mode 100644 tools/libelf/Makefile
create mode 100644 tools/libtool/.svn/entries
create mode 100644 tools/libtool/.svn/text-base/Makefile.svn-base
create mode 100644 tools/libtool/Makefile
create mode 100644 tools/libtool/files/.svn/entries
create mode 100644 tools/libtool/files/.svn/text-base/libtool-v1.5.patch.svn-base
create mode 100644 tools/libtool/files/.svn/text-base/libtool-v2.2.patch.svn-base
create mode 100644 tools/libtool/files/.svn/text-base/libtool-v2.4.patch.svn-base
create mode 100644 tools/libtool/files/libtool-v1.5.patch
create mode 100644 tools/libtool/files/libtool-v2.2.patch
create mode 100644 tools/libtool/files/libtool-v2.4.patch
create mode 100644 tools/libtool/patches/.svn/entries
create mode 100644 tools/libtool/patches/.svn/text-base/000-relocatable.patch.svn-base
create mode 100644 tools/libtool/patches/.svn/text-base/001-fix-func_append.patch.svn-base
create mode 100644 tools/libtool/patches/.svn/text-base/100-libdir-fixes.patch.svn-base
create mode 100644 tools/libtool/patches/.svn/text-base/110-dont-use-target-dir-for-relinking.patch.svn-base
create mode 100644 tools/libtool/patches/.svn/text-base/120-strip-unsafe-dirs-for-relinking.patch.svn-base
create mode 100644 tools/libtool/patches/.svn/text-base/150-trailingslash.patch.svn-base
create mode 100644 tools/libtool/patches/.svn/text-base/200-openwrt-branding.patch.svn-base
create mode 100644 tools/libtool/patches/000-relocatable.patch
create mode 100644 tools/libtool/patches/001-fix-func_append.patch
create mode 100644 tools/libtool/patches/100-libdir-fixes.patch
create mode 100644 tools/libtool/patches/110-dont-use-target-dir-for-relinking.patch
create mode 100644 tools/libtool/patches/120-strip-unsafe-dirs-for-relinking.patch
create mode 100644 tools/libtool/patches/150-trailingslash.patch
create mode 100644 tools/libtool/patches/200-openwrt-branding.patch
create mode 100644 tools/lzma-old/.svn/entries
create mode 100644 tools/lzma-old/.svn/prop-base/Makefile.svn-base
create mode 100644 tools/lzma-old/.svn/text-base/Makefile.svn-base
create mode 100644 tools/lzma-old/Makefile
create mode 100644 tools/lzma-old/patches/.svn/entries
create mode 100644 tools/lzma-old/patches/.svn/text-base/100-lzma_zlib.patch.svn-base
create mode 100644 tools/lzma-old/patches/.svn/text-base/110-ranlib.patch.svn-base
create mode 100644 tools/lzma-old/patches/100-lzma_zlib.patch
create mode 100644 tools/lzma-old/patches/110-ranlib.patch
create mode 100644 tools/lzma/.svn/entries
create mode 100644 tools/lzma/.svn/text-base/Makefile.svn-base
create mode 100644 tools/lzma/Makefile
create mode 100644 tools/lzma/patches/.svn/entries
create mode 100644 tools/lzma/patches/.svn/text-base/001-large_files.patch.svn-base
create mode 100644 tools/lzma/patches/.svn/text-base/002-lzmp.patch.svn-base
create mode 100644 tools/lzma/patches/.svn/text-base/003-compile_fixes.patch.svn-base
create mode 100644 tools/lzma/patches/.svn/text-base/100-static_library.patch.svn-base
create mode 100644 tools/lzma/patches/001-large_files.patch
create mode 100644 tools/lzma/patches/002-lzmp.patch
create mode 100644 tools/lzma/patches/003-compile_fixes.patch
create mode 100644 tools/lzma/patches/100-static_library.patch
create mode 100644 tools/m4/.svn/entries
create mode 100644 tools/m4/.svn/text-base/Makefile.svn-base
create mode 100644 tools/m4/Makefile
create mode 100644 tools/m4/patches/.svn/entries
create mode 100644 tools/m4/patches/.svn/text-base/100-fix-gets-removal.patch.svn-base
create mode 100644 tools/m4/patches/100-fix-gets-removal.patch
create mode 100644 tools/missing-macros/.svn/entries
create mode 100644 tools/missing-macros/.svn/text-base/Makefile.svn-base
create mode 100644 tools/missing-macros/Makefile
create mode 100644 tools/missing-macros/src/.svn/entries
create mode 100644 tools/missing-macros/src/.svn/text-base/README.svn-base
create mode 100644 tools/missing-macros/src/README
create mode 100644 tools/missing-macros/src/m4/.svn/entries
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/as-ac-expand.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/as-compiler-flag.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/as-unaligned-access.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/as-version.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/dnet.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/esd.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/fake-gtk-doc-check.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/fake-intltool.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/glibc2.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/glibc21.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/intdiv0.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/intmax.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/inttypes-pri.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/inttypes_h.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/lib-ld.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/lib-link.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/lib-prefix.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/mfx_acc.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/mfx_cppflags.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/mfx_limits.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/progtest.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/stdint_h.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/uintmax_t.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/va_copy.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/wint_t.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/xaw.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/.svn/text-base/xmms.m4.svn-base
create mode 100644 tools/missing-macros/src/m4/as-ac-expand.m4
create mode 100644 tools/missing-macros/src/m4/as-compiler-flag.m4
create mode 100644 tools/missing-macros/src/m4/as-unaligned-access.m4
create mode 100644 tools/missing-macros/src/m4/as-version.m4
create mode 100644 tools/missing-macros/src/m4/dnet.m4
create mode 100644 tools/missing-macros/src/m4/esd.m4
create mode 100644 tools/missing-macros/src/m4/fake-gtk-doc-check.m4
create mode 100644 tools/missing-macros/src/m4/fake-intltool.m4
create mode 100644 tools/missing-macros/src/m4/glibc2.m4
create mode 100644 tools/missing-macros/src/m4/glibc21.m4
create mode 100644 tools/missing-macros/src/m4/intdiv0.m4
create mode 100644 tools/missing-macros/src/m4/intmax.m4
create mode 100644 tools/missing-macros/src/m4/inttypes-pri.m4
create mode 100644 tools/missing-macros/src/m4/inttypes_h.m4
create mode 100644 tools/missing-macros/src/m4/lib-ld.m4
create mode 100644 tools/missing-macros/src/m4/lib-link.m4
create mode 100644 tools/missing-macros/src/m4/lib-prefix.m4
create mode 100644 tools/missing-macros/src/m4/mfx_acc.m4
create mode 100644 tools/missing-macros/src/m4/mfx_cppflags.m4
create mode 100644 tools/missing-macros/src/m4/mfx_limits.m4
create mode 100644 tools/missing-macros/src/m4/progtest.m4
create mode 100644 tools/missing-macros/src/m4/stdint_h.m4
create mode 100644 tools/missing-macros/src/m4/uintmax_t.m4
create mode 100644 tools/missing-macros/src/m4/va_copy.m4
create mode 100644 tools/missing-macros/src/m4/wint_t.m4
create mode 100644 tools/missing-macros/src/m4/xaw.m4
create mode 100644 tools/missing-macros/src/m4/xmms.m4
create mode 100644 tools/mkimage/.svn/entries
create mode 100644 tools/mkimage/.svn/text-base/Makefile.svn-base
create mode 100644 tools/mkimage/Makefile
create mode 100644 tools/mkimage/patches/.svn/entries
create mode 100644 tools/mkimage/patches/.svn/text-base/010-freebsd-ulong-fix.patch.svn-base
create mode 100644 tools/mkimage/patches/.svn/text-base/020-openbsd_fixes.patch.svn-base
create mode 100644 tools/mkimage/patches/.svn/text-base/030-allow-to-use-different-magic.patch.svn-base
create mode 100644 tools/mkimage/patches/.svn/text-base/040-include_order.patch.svn-base
create mode 100644 tools/mkimage/patches/.svn/text-base/050-image_h_portability.patch.svn-base
create mode 100644 tools/mkimage/patches/010-freebsd-ulong-fix.patch
create mode 100644 tools/mkimage/patches/020-openbsd_fixes.patch
create mode 100644 tools/mkimage/patches/030-allow-to-use-different-magic.patch
create mode 100644 tools/mkimage/patches/040-include_order.patch
create mode 100644 tools/mkimage/patches/050-image_h_portability.patch
create mode 100644 tools/mklibs/.svn/entries
create mode 100644 tools/mklibs/.svn/text-base/Makefile.svn-base
create mode 100644 tools/mklibs/Makefile
create mode 100644 tools/mklibs/include/.svn/entries
create mode 100644 tools/mklibs/include/.svn/text-base/elf.h.svn-base
create mode 100644 tools/mklibs/include/elf.h
create mode 100644 tools/mklibs/patches/.svn/entries
create mode 100644 tools/mklibs/patches/.svn/text-base/001-compile.patch.svn-base
create mode 100644 tools/mklibs/patches/.svn/text-base/002-disable_symbol_checks.patch.svn-base
create mode 100644 tools/mklibs/patches/.svn/text-base/003-no_copy.patch.svn-base
create mode 100644 tools/mklibs/patches/.svn/text-base/004-libpthread_link.patch.svn-base
create mode 100644 tools/mklibs/patches/.svn/text-base/005-duplicate_syms.patch.svn-base
create mode 100644 tools/mklibs/patches/.svn/text-base/006-uclibc_init.patch.svn-base
create mode 100644 tools/mklibs/patches/.svn/text-base/007-gc_sections.patch.svn-base
create mode 100644 tools/mklibs/patches/.svn/text-base/008-uclibc_libgcc_link.patch.svn-base
create mode 100644 tools/mklibs/patches/.svn/text-base/009-uclibc_libpthread_symbols.patch.svn-base
create mode 100644 tools/mklibs/patches/.svn/text-base/010-remove_STT_GNU_IFUNC.patch.svn-base
create mode 100644 tools/mklibs/patches/.svn/text-base/011-remove_multiarch.patch.svn-base
create mode 100644 tools/mklibs/patches/001-compile.patch
create mode 100644 tools/mklibs/patches/002-disable_symbol_checks.patch
create mode 100644 tools/mklibs/patches/003-no_copy.patch
create mode 100644 tools/mklibs/patches/004-libpthread_link.patch
create mode 100644 tools/mklibs/patches/005-duplicate_syms.patch
create mode 100644 tools/mklibs/patches/006-uclibc_init.patch
create mode 100644 tools/mklibs/patches/007-gc_sections.patch
create mode 100644 tools/mklibs/patches/008-uclibc_libgcc_link.patch
create mode 100644 tools/mklibs/patches/009-uclibc_libpthread_symbols.patch
create mode 100644 tools/mklibs/patches/010-remove_STT_GNU_IFUNC.patch
create mode 100644 tools/mklibs/patches/011-remove_multiarch.patch
create mode 100644 tools/mm-macros/.svn/entries
create mode 100644 tools/mm-macros/.svn/text-base/Makefile.svn-base
create mode 100644 tools/mm-macros/Makefile
create mode 100644 tools/mpc/.svn/entries
create mode 100644 tools/mpc/.svn/text-base/Makefile.svn-base
create mode 100644 tools/mpc/Makefile
create mode 100644 tools/mpfr/.svn/entries
create mode 100644 tools/mpfr/.svn/text-base/Makefile.svn-base
create mode 100644 tools/mpfr/Makefile
create mode 100644 tools/mpfr/patches/.svn/entries
create mode 100644 tools/mpfr/patches/.svn/text-base/001-only_src.patch.svn-base
create mode 100644 tools/mpfr/patches/001-only_src.patch
create mode 100644 tools/mtd-utils/.svn/entries
create mode 100644 tools/mtd-utils/.svn/prop-base/Makefile.svn-base
create mode 100644 tools/mtd-utils/.svn/text-base/Makefile.svn-base
create mode 100644 tools/mtd-utils/Makefile
create mode 100644 tools/mtd-utils/include/.svn/entries
create mode 100644 tools/mtd-utils/include/.svn/text-base/fls.h.svn-base
create mode 100644 tools/mtd-utils/include/fls.h
create mode 100644 tools/mtd-utils/include/linux/.svn/entries
create mode 100644 tools/mtd-utils/include/linux/.svn/text-base/types.h.svn-base
create mode 100644 tools/mtd-utils/include/linux/types.h
create mode 100644 tools/mtd-utils/patches/.svn/entries
create mode 100644 tools/mtd-utils/patches/.svn/text-base/110-portability.patch.svn-base
create mode 100644 tools/mtd-utils/patches/.svn/text-base/120-cygwin_fixes.patch.svn-base
create mode 100644 tools/mtd-utils/patches/.svn/text-base/130-lzma_jffs2.patch.svn-base
create mode 100644 tools/mtd-utils/patches/.svn/text-base/131-fix_lib_compile.patch.svn-base
create mode 100644 tools/mtd-utils/patches/.svn/text-base/133-error-fix.patch.svn-base
create mode 100644 tools/mtd-utils/patches/.svn/text-base/134-freebsd_loff_t.patch.svn-base
create mode 100644 tools/mtd-utils/patches/.svn/text-base/135-mkubifs_optional_lzo.patch.svn-base
create mode 100644 tools/mtd-utils/patches/.svn/text-base/136-mkfs.ubifs-xz-support.patch.svn-base
create mode 100644 tools/mtd-utils/patches/110-portability.patch
create mode 100644 tools/mtd-utils/patches/120-cygwin_fixes.patch
create mode 100644 tools/mtd-utils/patches/130-lzma_jffs2.patch
create mode 100644 tools/mtd-utils/patches/131-fix_lib_compile.patch
create mode 100644 tools/mtd-utils/patches/133-error-fix.patch
create mode 100644 tools/mtd-utils/patches/134-freebsd_loff_t.patch
create mode 100644 tools/mtd-utils/patches/135-mkubifs_optional_lzo.patch
create mode 100644 tools/mtd-utils/patches/136-mkfs.ubifs-xz-support.patch
create mode 100644 tools/mtools/.svn/entries
create mode 100644 tools/mtools/.svn/text-base/Makefile.svn-base
create mode 100644 tools/mtools/Makefile
create mode 100644 tools/padjffs2/.svn/entries
create mode 100644 tools/padjffs2/.svn/prop-base/Makefile.svn-base
create mode 100644 tools/padjffs2/.svn/text-base/Makefile.svn-base
create mode 100644 tools/padjffs2/Makefile
create mode 100644 tools/padjffs2/src/.svn/entries
create mode 100644 tools/padjffs2/src/.svn/prop-base/Makefile.svn-base
create mode 100644 tools/padjffs2/src/.svn/prop-base/padjffs2.c.svn-base
create mode 100644 tools/padjffs2/src/.svn/text-base/Makefile.svn-base
create mode 100644 tools/padjffs2/src/.svn/text-base/padjffs2.c.svn-base
create mode 100644 tools/padjffs2/src/Makefile
create mode 100644 tools/padjffs2/src/padjffs2.c
create mode 100644 tools/patch-image/.svn/entries
create mode 100644 tools/patch-image/.svn/text-base/Makefile.svn-base
create mode 100644 tools/patch-image/Makefile
create mode 100644 tools/patch-image/src/.svn/entries
create mode 100644 tools/patch-image/src/.svn/prop-base/patch-cmdline.c.svn-base
create mode 100644 tools/patch-image/src/.svn/prop-base/patch-dtb.c.svn-base
create mode 100644 tools/patch-image/src/.svn/text-base/patch-cmdline.c.svn-base
create mode 100644 tools/patch-image/src/.svn/text-base/patch-dtb.c.svn-base
create mode 100644 tools/patch-image/src/patch-cmdline.c
create mode 100644 tools/patch-image/src/patch-dtb.c
create mode 100644 tools/patch/.svn/entries
create mode 100644 tools/patch/.svn/text-base/Makefile.svn-base
create mode 100644 tools/patch/Makefile
create mode 100644 tools/pkg-config/.svn/entries
create mode 100644 tools/pkg-config/.svn/text-base/Makefile.svn-base
create mode 100644 tools/pkg-config/Makefile
create mode 100644 tools/pkg-config/files/.svn/entries
create mode 100644 tools/pkg-config/files/.svn/prop-base/pkg-config.svn-base
create mode 100644 tools/pkg-config/files/.svn/text-base/pkg-config.svn-base
create mode 100755 tools/pkg-config/files/pkg-config
create mode 100644 tools/pkg-config/patches/.svn/entries
create mode 100644 tools/pkg-config/patches/.svn/text-base/100-disable_compat_cmd.patch.svn-base
create mode 100644 tools/pkg-config/patches/100-disable_compat_cmd.patch
create mode 100644 tools/ppl/.svn/entries
create mode 100644 tools/ppl/.svn/text-base/Makefile.svn-base
create mode 100644 tools/ppl/Makefile
create mode 100644 tools/ppl/patches/.svn/entries
create mode 100644 tools/ppl/patches/.svn/text-base/001-gmp_5_fix.patch.svn-base
create mode 100644 tools/ppl/patches/.svn/text-base/002-replace-pkglib_DATA.patch.svn-base
create mode 100644 tools/ppl/patches/001-gmp_5_fix.patch
create mode 100644 tools/ppl/patches/002-replace-pkglib_DATA.patch
create mode 100644 tools/qemu/.svn/entries
create mode 100644 tools/qemu/.svn/text-base/Makefile.svn-base
create mode 100644 tools/qemu/Makefile
create mode 100644 tools/qemu/patches/.svn/entries
create mode 100644 tools/quilt/.svn/entries
create mode 100644 tools/quilt/.svn/text-base/Makefile.svn-base
create mode 100644 tools/quilt/Makefile
create mode 100644 tools/quilt/patches/.svn/entries
create mode 100644 tools/quilt/patches/.svn/text-base/000-relocatable.patch.svn-base
create mode 100644 tools/quilt/patches/.svn/text-base/001-fix_compile.patch.svn-base
create mode 100644 tools/quilt/patches/.svn/text-base/100-patch_2.6.1_version.patch.svn-base
create mode 100644 tools/quilt/patches/000-relocatable.patch
create mode 100644 tools/quilt/patches/001-fix_compile.patch
create mode 100644 tools/quilt/patches/100-patch_2.6.1_version.patch
create mode 100644 tools/scons/.svn/entries
create mode 100644 tools/scons/.svn/text-base/Makefile.svn-base
create mode 100644 tools/scons/Makefile
create mode 100644 tools/scons/files/.svn/entries
create mode 100644 tools/scons/files/.svn/prop-base/pywrap.sh.svn-base
create mode 100644 tools/scons/files/.svn/text-base/pywrap.sh.svn-base
create mode 100755 tools/scons/files/pywrap.sh
create mode 100644 tools/scons/patches/.svn/entries
create mode 100644 tools/scons/patches/.svn/text-base/001-platform_env.patch.svn-base
create mode 100644 tools/scons/patches/001-platform_env.patch
create mode 100644 tools/sdcc/.svn/entries
create mode 100644 tools/sdcc/.svn/text-base/Makefile.svn-base
create mode 100644 tools/sdcc/Makefile
create mode 100644 tools/sdcc/patches/.svn/entries
create mode 100644 tools/sdcc/patches/.svn/text-base/100-workaround-gcc-4.6.2-hang.patch.svn-base
create mode 100644 tools/sdcc/patches/.svn/text-base/200-fix_order_of_linking.patch.svn-base
create mode 100644 tools/sdcc/patches/100-workaround-gcc-4.6.2-hang.patch
create mode 100644 tools/sdcc/patches/200-fix_order_of_linking.patch
create mode 100644 tools/sed/.svn/entries
create mode 100644 tools/sed/.svn/prop-base/Makefile.svn-base
create mode 100644 tools/sed/.svn/text-base/Makefile.svn-base
create mode 100644 tools/sed/Makefile
create mode 100644 tools/squashfs/.svn/entries
create mode 100644 tools/squashfs/.svn/prop-base/Makefile.svn-base
create mode 100644 tools/squashfs/.svn/text-base/Makefile.svn-base
create mode 100644 tools/squashfs/Makefile
create mode 100644 tools/squashfs/patches/.svn/entries
create mode 100644 tools/squashfs/patches/.svn/prop-base/100-lzma.patch.svn-base
create mode 100644 tools/squashfs/patches/.svn/text-base/100-lzma.patch.svn-base
create mode 100644 tools/squashfs/patches/100-lzma.patch
create mode 100644 tools/squashfs4/.svn/entries
create mode 100644 tools/squashfs4/.svn/prop-base/Makefile.svn-base
create mode 100644 tools/squashfs4/.svn/text-base/Makefile.svn-base
create mode 100644 tools/squashfs4/Makefile
create mode 100644 tools/squashfs4/patches/.svn/entries
create mode 100644 tools/squashfs4/patches/.svn/text-base/100-portability.patch.svn-base
create mode 100644 tools/squashfs4/patches/.svn/text-base/110-allow_static_liblzma.patch.svn-base
create mode 100644 tools/squashfs4/patches/.svn/text-base/120-cygwin_fixes.patch.svn-base
create mode 100644 tools/squashfs4/patches/.svn/text-base/150-freebsd_fixes.patch.svn-base
create mode 100644 tools/squashfs4/patches/.svn/text-base/160-expose_lzma_xz_options.patch.svn-base
create mode 100644 tools/squashfs4/patches/.svn/text-base/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch.svn-base
create mode 100644 tools/squashfs4/patches/.svn/text-base/180-openbsd_compat.patch.svn-base
create mode 100644 tools/squashfs4/patches/100-portability.patch
create mode 100644 tools/squashfs4/patches/110-allow_static_liblzma.patch
create mode 100644 tools/squashfs4/patches/120-cygwin_fixes.patch
create mode 100644 tools/squashfs4/patches/150-freebsd_fixes.patch
create mode 100644 tools/squashfs4/patches/160-expose_lzma_xz_options.patch
create mode 100644 tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch
create mode 100644 tools/squashfs4/patches/180-openbsd_compat.patch
create mode 100644 tools/sstrip/.svn/entries
create mode 100644 tools/sstrip/.svn/prop-base/Makefile.svn-base
create mode 100644 tools/sstrip/.svn/text-base/Makefile.svn-base
create mode 100644 tools/sstrip/Makefile
create mode 100644 tools/sstrip/src/.svn/entries
create mode 100644 tools/sstrip/src/.svn/prop-base/sstrip.c.svn-base
create mode 100644 tools/sstrip/src/.svn/text-base/sstrip.c.svn-base
create mode 100644 tools/sstrip/src/sstrip.c
create mode 100644 tools/upslug2/.svn/entries
create mode 100644 tools/upslug2/.svn/text-base/Makefile.svn-base
create mode 100644 tools/upslug2/Makefile
create mode 100644 tools/upslug2/patches/.svn/entries
create mode 100644 tools/upslug2/patches/.svn/text-base/100-libpcap_fix.patch.svn-base
create mode 100644 tools/upslug2/patches/.svn/text-base/110-wrt350nv2_support.patch.svn-base
create mode 100644 tools/upslug2/patches/100-libpcap_fix.patch
create mode 100644 tools/upslug2/patches/110-wrt350nv2_support.patch
create mode 100644 tools/upx/.svn/entries
create mode 100644 tools/upx/.svn/text-base/Makefile.svn-base
create mode 100644 tools/upx/Makefile
create mode 100644 tools/upx/patches/.svn/entries
create mode 100644 tools/upx/patches/.svn/text-base/100-lzmaonly.patch.svn-base
create mode 100644 tools/upx/patches/100-lzmaonly.patch
create mode 100644 tools/wrt350nv2-builder/.svn/entries
create mode 100644 tools/wrt350nv2-builder/.svn/text-base/Makefile.svn-base
create mode 100644 tools/wrt350nv2-builder/Makefile
create mode 100644 tools/wrt350nv2-builder/src/.svn/entries
create mode 100644 tools/wrt350nv2-builder/src/.svn/text-base/crypt.h.svn-base
create mode 100644 tools/wrt350nv2-builder/src/.svn/text-base/ioapi.c.svn-base
create mode 100644 tools/wrt350nv2-builder/src/.svn/text-base/ioapi.h.svn-base
create mode 100644 tools/wrt350nv2-builder/src/.svn/text-base/md5.c.svn-base
create mode 100644 tools/wrt350nv2-builder/src/.svn/text-base/md5.h.svn-base
create mode 100644 tools/wrt350nv2-builder/src/.svn/text-base/upgrade.h.svn-base
create mode 100644 tools/wrt350nv2-builder/src/.svn/text-base/wrt350nv2-builder.c.svn-base
create mode 100644 tools/wrt350nv2-builder/src/crypt.h
create mode 100644 tools/wrt350nv2-builder/src/ioapi.c
create mode 100644 tools/wrt350nv2-builder/src/ioapi.h
create mode 100644 tools/wrt350nv2-builder/src/md5.c
create mode 100644 tools/wrt350nv2-builder/src/md5.h
create mode 100644 tools/wrt350nv2-builder/src/upgrade.h
create mode 100644 tools/wrt350nv2-builder/src/wrt350nv2-builder.c
create mode 100644 tools/xfce-macros/.svn/entries
create mode 100644 tools/xfce-macros/.svn/text-base/Makefile.svn-base
create mode 100644 tools/xfce-macros/Makefile
create mode 100644 tools/xorg-macros/.svn/dir-prop-base
create mode 100644 tools/xorg-macros/.svn/entries
create mode 100644 tools/xorg-macros/.svn/text-base/Makefile.svn-base
create mode 100644 tools/xorg-macros/Makefile
create mode 100644 tools/xz/.svn/entries
create mode 100644 tools/xz/.svn/text-base/Makefile.svn-base
create mode 100644 tools/xz/Makefile
create mode 100644 tools/yaffs2/.svn/entries
create mode 100644 tools/yaffs2/.svn/text-base/Makefile.svn-base
create mode 100644 tools/yaffs2/Makefile
create mode 100644 tools/yaffs2/patches/.svn/entries
create mode 100644 tools/yaffs2/patches/.svn/text-base/100-compile.patch.svn-base
create mode 100644 tools/yaffs2/patches/.svn/text-base/110-openbsd-compat.patch.svn-base
create mode 100644 tools/yaffs2/patches/100-compile.patch
create mode 100644 tools/yaffs2/patches/110-openbsd-compat.patch
(limited to 'tools')
diff --git a/tools/.svn/entries b/tools/.svn/entries
new file mode 100644
index 0000000..d9d8ffc
--- /dev/null
+++ b/tools/.svn/entries
@@ -0,0 +1,209 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-11T15:55:23.989487Z
+35963
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+mpc
+dir
+
+m4
+dir
+
+cmake
+dir
+
+squashfs4
+dir
+
+mtd-utils
+dir
+
+pkg-config
+dir
+
+scons
+dir
+
+yaffs2
+dir
+
+missing-macros
+dir
+
+ppl
+dir
+
+mm-macros
+dir
+
+squashfs
+dir
+
+flex
+dir
+
+quilt
+dir
+
+patch
+dir
+
+xorg-macros
+dir
+
+lzma
+dir
+
+mpfr
+dir
+
+genext2fs
+dir
+
+ccache
+dir
+
+xfce-macros
+dir
+
+bison
+dir
+
+e2fsprogs
+dir
+
+sed
+dir
+
+sdcc
+dir
+
+upx
+dir
+
+mtools
+dir
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+b7d821d3ca629f427ff6af83624cb300
+2013-03-07T17:32:29.455175Z
+35900
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5676
+
+autoconf
+dir
+
+wrt350nv2-builder
+dir
+
+patch-image
+dir
+
+lzma-old
+dir
+
+mklibs
+dir
+
+gmp
+dir
+
+include
+dir
+
+sstrip
+dir
+
+b43-tools
+dir
+
+ipkg-utils
+dir
+
+libelf
+dir
+
+flock
+dir
+
+padjffs2
+dir
+
+dosfstools
+dir
+
+upslug2
+dir
+
+xz
+dir
+
+cloog
+dir
+
+libtool
+dir
+
+automake
+dir
+
+qemu
+dir
+
+mkimage
+dir
+
+firmware-utils
+dir
+
diff --git a/tools/.svn/prop-base/Makefile.svn-base b/tools/.svn/prop-base/Makefile.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/.svn/prop-base/Makefile.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/.svn/text-base/Makefile.svn-base b/tools/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..1d65e50
--- /dev/null
+++ b/tools/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,149 @@
+#
+# Copyright (C) 2006-2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# Main makefile for the host tools
+#
+curdir:=tools
+
+# subdirectories to descend into
+tools-y :=
+ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN)$(CONFIG_GCC_LLVM),)
+tools-y += gmp mpfr mpc libelf
+endif
+tools-y += m4 libtool autoconf automake flex bison pkg-config sed mklibs
+tools-y += sstrip ipkg-utils genext2fs e2fsprogs mtd-utils mkimage
+tools-y += firmware-utils patch-image patch quilt yaffs2 flock padjffs2
+tools-y += mm-macros xorg-macros xfce-macros missing-macros xz cmake scons
+tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
+tools-$(CONFIG_powerpc) += upx
+tools-$(CONFIG_TARGET_x86) += qemu
+tools-$(CONFIG_TARGET_brcm2708) += mtools dosfstools
+ifneq ($(CONFIG_TARGET_ar71xx),)
+tools-y += lzma-old squashfs
+endif
+tools-y += lzma squashfs4
+ifneq ($(CONFIG_PACKAGE_kmod-b43)$(CONFIG_PACKAGE_kmod-b43legacy)$(CONFIG_BRCMSMAC_USE_FW_FROM_WL),)
+tools-y += b43-tools
+endif
+
+ifneq ($(CONFIG_PACKAGE_firmwarehotplug),)
+tools-y += sdcc
+endif
+
+ifdef CONFIG_GCC_USE_GRAPHITE
+ ifeq ($(CONFIG_GCC_USE_SYSTEM_PPL_CLOOG),)
+ tools-y += ppl cloog
+ $(curdir)/cloog/compile := $(curdir)/ppl/install
+ endif
+endif
+
+# builddir dependencies
+$(curdir)/bison/compile := $(curdir)/flex/install
+$(curdir)/flex/compile := $(curdir)/m4/install
+$(curdir)/pkg-config/compile := $(curdir)/sed/install
+$(curdir)/libtool/compile := $(curdir)/sed/install
+$(curdir)/squashfs/compile := $(curdir)/lzma-old/install
+$(curdir)/squashfs4/compile := $(curdir)/xz/install
+$(curdir)/quilt/compile := $(curdir)/sed/install $(curdir)/autoconf/install
+$(curdir)/dtc/compile := $(curdir)/bison/install
+$(curdir)/autoconf/compile := $(curdir)/m4/install $(curdir)/libtool/install
+$(curdir)/automake/compile := $(curdir)/m4/install $(curdir)/autoconf/install $(curdir)/pkg-config/install $(curdir)/xz/install
+$(curdir)/gmp/compile := $(curdir)/automake/install
+$(curdir)/mpc/compile := $(curdir)/mpfr/install $(curdir)/gmp/install
+$(curdir)/mpfr/compile := $(curdir)/gmp/install
+$(curdir)/ppl/compile := $(curdir)/gmp/install
+$(curdir)/cloog/compile := $(curdir)/ppl/install
+$(curdir)/mtd-utils/compile := $(curdir)/e2fsprogs/install $(curdir)/xz/install
+$(curdir)/mkimage/compile := $(curdir)/sed/install
+$(curdir)/mklibs/compile := $(curdir)/automake/install
+$(curdir)/qemu/compile := $(curdir)/e2fsprogs/install
+$(curdir)/upslug2/compile := $(curdir)/automake/install
+$(curdir)/mm-macros/compile := $(curdir)/automake/install
+$(curdir)/xorg-macros/compile := $(curdir)/automake/install
+$(curdir)/xfce-macros/compile := $(curdir)/automake/install
+$(curdir)/missing-macros/compile := $(curdir)/automake/install
+$(curdir)/e2fsprogs/compile := $(curdir)/automake/install
+$(curdir)/libelf/compile := $(curdir)/automake/install
+$(curdir)/sdcc/compile := $(curdir)/bison/install
+$(curdir)/b43-tools/compile := $(curdir)/bison/install
+
+ifneq ($(CONFIG_CCACHE),)
+$(foreach tool, $(tools-y), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/install))
+tools-y += ccache
+endif
+
+$(curdir)/builddirs := $(tools-y) $(tools-dep) $(tools-)
+$(curdir)/builddirs-default := $(tools-y)
+
+ifndef DUMP_TARGET_DB
+define PrepareStaging
+ @for dir in $(1); do ( \
+ $(if $(QUIET),,set -x;) \
+ mkdir -p "$$dir"; \
+ cd "$$dir"; \
+ mkdir -p bin lib include stamp; \
+ ); done
+endef
+
+# preparatory work
+$(STAGING_DIR)/.prepared: $(TMP_DIR)/.build
+ $(call PrepareStaging,$(STAGING_DIR))
+ mkdir -p $(BUILD_DIR)/stamp
+ touch $@
+
+$(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
+ $(call PrepareStaging,$(STAGING_DIR_HOST))
+ mkdir -p $(BUILD_DIR_HOST)/stamp $(STAGING_DIR_HOST)/include/sys
+ $(INSTALL_DATA) $(TOPDIR)/tools/include/*.h $(STAGING_DIR_HOST)/include/
+ $(INSTALL_DATA) $(TOPDIR)/tools/include/sys/*.h $(STAGING_DIR_HOST)/include/sys/
+ ln -sf lib $(STAGING_DIR_HOST)/lib64
+ touch $@
+
+
+define PrepareCommand
+$(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
+ @mkdir -p "$$(dir $$@)"; rm -f "$$@"
+ @export FILE="$$$$(which $(2) 2>/dev/null | grep -v 'not found' | head -n1)"; [ -n "$$$$FILE" ] || { \
+ echo "Command $(1) not found."; false; \
+ }; ln -s "$$$$FILE" "$$@"
+
+endef
+endif
+
+$(STAGING_DIR_HOST)/bin/stat: $(STAGING_DIR)/.prepared
+ @rm -f $@
+ @if stat --version > /dev/null 2>&1; then \
+ ln -s `which stat` $@; \
+ elif gstat --version > /dev/null 2>&1; then \
+ ln -s `which gstat` $@; \
+ elif gnustat --version > /dev/null 2>&1; then \
+ ln -s `which gnustat` $@; \
+ else \
+ echo "GNU stat not found"; \
+ false; \
+ fi
+
+$(eval $(call PrepareCommand,find,gfind find))
+$(eval $(call PrepareCommand,md5sum,gmd5sum md5sum $(SCRIPT_DIR)/md5sum))
+$(eval $(call PrepareCommand,cp,gcp cp))
+$(eval $(call PrepareCommand,seq,gseq seq))
+$(eval $(call PrepareCommand,python,python2 python2.7 python))
+$(eval $(call PrepareCommand,awk,gawk awk))
+$(eval $(call PrepareCommand,getopt,gnugetopt /usr/local/bin/getopt getopt))
+$(eval $(call PrepareCommand,grep,ggrep grep))
+$(eval $(call PrepareCommand,tar,gtar tar))
+$(eval $(call PrepareCommand,diff,gdiff diff))
+
+$(curdir)/cmddeps = $(patsubst %,$(STAGING_DIR_HOST)/bin/%,find md5sum cp stat seq python awk getopt grep tar diff)
+$(curdir)//prepare = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
+$(curdir)//compile = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
+
+# prerequisites for the individual targets
+$(curdir)/ := .config prereq
+$(curdir)//install = $(1)/compile
+
+$(eval $(call stampfile,$(curdir),tools,install,,CONFIG_CCACHE CONFIG_powerpc CONFIG_GCC_VERSION_4_5 CONFIG_GCC_USE_GRAPHITE CONFIG_TARGET_orion_generic))
+$(eval $(call subdir,$(curdir)))
diff --git a/tools/Makefile b/tools/Makefile
new file mode 100644
index 0000000..1d65e50
--- /dev/null
+++ b/tools/Makefile
@@ -0,0 +1,149 @@
+#
+# Copyright (C) 2006-2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# Main makefile for the host tools
+#
+curdir:=tools
+
+# subdirectories to descend into
+tools-y :=
+ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN)$(CONFIG_GCC_LLVM),)
+tools-y += gmp mpfr mpc libelf
+endif
+tools-y += m4 libtool autoconf automake flex bison pkg-config sed mklibs
+tools-y += sstrip ipkg-utils genext2fs e2fsprogs mtd-utils mkimage
+tools-y += firmware-utils patch-image patch quilt yaffs2 flock padjffs2
+tools-y += mm-macros xorg-macros xfce-macros missing-macros xz cmake scons
+tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
+tools-$(CONFIG_powerpc) += upx
+tools-$(CONFIG_TARGET_x86) += qemu
+tools-$(CONFIG_TARGET_brcm2708) += mtools dosfstools
+ifneq ($(CONFIG_TARGET_ar71xx),)
+tools-y += lzma-old squashfs
+endif
+tools-y += lzma squashfs4
+ifneq ($(CONFIG_PACKAGE_kmod-b43)$(CONFIG_PACKAGE_kmod-b43legacy)$(CONFIG_BRCMSMAC_USE_FW_FROM_WL),)
+tools-y += b43-tools
+endif
+
+ifneq ($(CONFIG_PACKAGE_firmwarehotplug),)
+tools-y += sdcc
+endif
+
+ifdef CONFIG_GCC_USE_GRAPHITE
+ ifeq ($(CONFIG_GCC_USE_SYSTEM_PPL_CLOOG),)
+ tools-y += ppl cloog
+ $(curdir)/cloog/compile := $(curdir)/ppl/install
+ endif
+endif
+
+# builddir dependencies
+$(curdir)/bison/compile := $(curdir)/flex/install
+$(curdir)/flex/compile := $(curdir)/m4/install
+$(curdir)/pkg-config/compile := $(curdir)/sed/install
+$(curdir)/libtool/compile := $(curdir)/sed/install
+$(curdir)/squashfs/compile := $(curdir)/lzma-old/install
+$(curdir)/squashfs4/compile := $(curdir)/xz/install
+$(curdir)/quilt/compile := $(curdir)/sed/install $(curdir)/autoconf/install
+$(curdir)/dtc/compile := $(curdir)/bison/install
+$(curdir)/autoconf/compile := $(curdir)/m4/install $(curdir)/libtool/install
+$(curdir)/automake/compile := $(curdir)/m4/install $(curdir)/autoconf/install $(curdir)/pkg-config/install $(curdir)/xz/install
+$(curdir)/gmp/compile := $(curdir)/automake/install
+$(curdir)/mpc/compile := $(curdir)/mpfr/install $(curdir)/gmp/install
+$(curdir)/mpfr/compile := $(curdir)/gmp/install
+$(curdir)/ppl/compile := $(curdir)/gmp/install
+$(curdir)/cloog/compile := $(curdir)/ppl/install
+$(curdir)/mtd-utils/compile := $(curdir)/e2fsprogs/install $(curdir)/xz/install
+$(curdir)/mkimage/compile := $(curdir)/sed/install
+$(curdir)/mklibs/compile := $(curdir)/automake/install
+$(curdir)/qemu/compile := $(curdir)/e2fsprogs/install
+$(curdir)/upslug2/compile := $(curdir)/automake/install
+$(curdir)/mm-macros/compile := $(curdir)/automake/install
+$(curdir)/xorg-macros/compile := $(curdir)/automake/install
+$(curdir)/xfce-macros/compile := $(curdir)/automake/install
+$(curdir)/missing-macros/compile := $(curdir)/automake/install
+$(curdir)/e2fsprogs/compile := $(curdir)/automake/install
+$(curdir)/libelf/compile := $(curdir)/automake/install
+$(curdir)/sdcc/compile := $(curdir)/bison/install
+$(curdir)/b43-tools/compile := $(curdir)/bison/install
+
+ifneq ($(CONFIG_CCACHE),)
+$(foreach tool, $(tools-y), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/install))
+tools-y += ccache
+endif
+
+$(curdir)/builddirs := $(tools-y) $(tools-dep) $(tools-)
+$(curdir)/builddirs-default := $(tools-y)
+
+ifndef DUMP_TARGET_DB
+define PrepareStaging
+ @for dir in $(1); do ( \
+ $(if $(QUIET),,set -x;) \
+ mkdir -p "$$dir"; \
+ cd "$$dir"; \
+ mkdir -p bin lib include stamp; \
+ ); done
+endef
+
+# preparatory work
+$(STAGING_DIR)/.prepared: $(TMP_DIR)/.build
+ $(call PrepareStaging,$(STAGING_DIR))
+ mkdir -p $(BUILD_DIR)/stamp
+ touch $@
+
+$(STAGING_DIR_HOST)/.prepared: $(TMP_DIR)/.build
+ $(call PrepareStaging,$(STAGING_DIR_HOST))
+ mkdir -p $(BUILD_DIR_HOST)/stamp $(STAGING_DIR_HOST)/include/sys
+ $(INSTALL_DATA) $(TOPDIR)/tools/include/*.h $(STAGING_DIR_HOST)/include/
+ $(INSTALL_DATA) $(TOPDIR)/tools/include/sys/*.h $(STAGING_DIR_HOST)/include/sys/
+ ln -sf lib $(STAGING_DIR_HOST)/lib64
+ touch $@
+
+
+define PrepareCommand
+$(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
+ @mkdir -p "$$(dir $$@)"; rm -f "$$@"
+ @export FILE="$$$$(which $(2) 2>/dev/null | grep -v 'not found' | head -n1)"; [ -n "$$$$FILE" ] || { \
+ echo "Command $(1) not found."; false; \
+ }; ln -s "$$$$FILE" "$$@"
+
+endef
+endif
+
+$(STAGING_DIR_HOST)/bin/stat: $(STAGING_DIR)/.prepared
+ @rm -f $@
+ @if stat --version > /dev/null 2>&1; then \
+ ln -s `which stat` $@; \
+ elif gstat --version > /dev/null 2>&1; then \
+ ln -s `which gstat` $@; \
+ elif gnustat --version > /dev/null 2>&1; then \
+ ln -s `which gnustat` $@; \
+ else \
+ echo "GNU stat not found"; \
+ false; \
+ fi
+
+$(eval $(call PrepareCommand,find,gfind find))
+$(eval $(call PrepareCommand,md5sum,gmd5sum md5sum $(SCRIPT_DIR)/md5sum))
+$(eval $(call PrepareCommand,cp,gcp cp))
+$(eval $(call PrepareCommand,seq,gseq seq))
+$(eval $(call PrepareCommand,python,python2 python2.7 python))
+$(eval $(call PrepareCommand,awk,gawk awk))
+$(eval $(call PrepareCommand,getopt,gnugetopt /usr/local/bin/getopt getopt))
+$(eval $(call PrepareCommand,grep,ggrep grep))
+$(eval $(call PrepareCommand,tar,gtar tar))
+$(eval $(call PrepareCommand,diff,gdiff diff))
+
+$(curdir)/cmddeps = $(patsubst %,$(STAGING_DIR_HOST)/bin/%,find md5sum cp stat seq python awk getopt grep tar diff)
+$(curdir)//prepare = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
+$(curdir)//compile = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
+
+# prerequisites for the individual targets
+$(curdir)/ := .config prereq
+$(curdir)//install = $(1)/compile
+
+$(eval $(call stampfile,$(curdir),tools,install,,CONFIG_CCACHE CONFIG_powerpc CONFIG_GCC_VERSION_4_5 CONFIG_GCC_USE_GRAPHITE CONFIG_TARGET_orion_generic))
+$(eval $(call subdir,$(curdir)))
diff --git a/tools/autoconf/.svn/entries b/tools/autoconf/.svn/entries
new file mode 100644
index 0000000..b670f95
--- /dev/null
+++ b/tools/autoconf/.svn/entries
@@ -0,0 +1,65 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/autoconf
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-01-28T04:42:15.299551Z
+29931
+jow
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+patches
+dir
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+5ecc5501073408b8948d76dc69ec05e7
+2010-12-06T12:14:50.352456Z
+24279
+acoul
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+802
+
diff --git a/tools/autoconf/.svn/text-base/Makefile.svn-base b/tools/autoconf/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..f5d22c3
--- /dev/null
+++ b/tools/autoconf/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=autoconf
+PKG_VERSION:=2.68
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@GNU/autoconf
+PKG_MD5SUM:=864d785215aa60d627c91fcb21b05b07
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Configure
+ $(call Host/Configure/Default,\
+ --datarootdir=$(STAGING_DIR_HOST)/share \
+ )
+endef
+
+define Host/Compile
+ export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR)
+endef
+
+define Host/Install
+ export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) install
+endef
+
+define Host/Clean
+ -export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) uninstall
+ $(call Host/Clean/Default)
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/autoconf/Makefile b/tools/autoconf/Makefile
new file mode 100644
index 0000000..f5d22c3
--- /dev/null
+++ b/tools/autoconf/Makefile
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=autoconf
+PKG_VERSION:=2.68
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@GNU/autoconf
+PKG_MD5SUM:=864d785215aa60d627c91fcb21b05b07
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Configure
+ $(call Host/Configure/Default,\
+ --datarootdir=$(STAGING_DIR_HOST)/share \
+ )
+endef
+
+define Host/Compile
+ export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR)
+endef
+
+define Host/Install
+ export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) install
+endef
+
+define Host/Clean
+ -export SHELL="$(BASH)"; $(MAKE) -C $(HOST_BUILD_DIR) uninstall
+ $(call Host/Clean/Default)
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/autoconf/patches/.svn/entries b/tools/autoconf/patches/.svn/entries
new file mode 100644
index 0000000..9d0c079
--- /dev/null
+++ b/tools/autoconf/patches/.svn/entries
@@ -0,0 +1,96 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/autoconf/patches
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-01-28T04:42:15.299551Z
+29931
+jow
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+001-no_emacs_lib.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+e71800ea50e7d72cafba984cdfd254f7
+2012-01-20T02:56:08.150625Z
+29821
+jow
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+789
+
+000-relocatable.patch
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+58db4a2e18d0c1bab463ae088fc37433
+2012-01-28T04:42:15.299551Z
+29931
+jow
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6209
+
diff --git a/tools/autoconf/patches/.svn/text-base/000-relocatable.patch.svn-base b/tools/autoconf/patches/.svn/text-base/000-relocatable.patch.svn-base
new file mode 100644
index 0000000..0b83a2b
--- /dev/null
+++ b/tools/autoconf/patches/.svn/text-base/000-relocatable.patch.svn-base
@@ -0,0 +1,167 @@
+--- a/bin/autoheader.in
++++ b/bin/autoheader.in
+@@ -29,7 +29,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ unshift @INC, "$pkgdatadir";
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+@@ -51,7 +52,7 @@ use strict;
+ use vars qw ($config_h %verbatim %symbol);
+
+ # Lib files.
+-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
++my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
+ local $config_h;
+ my $config_h_in;
+ my @prepend_include;
+--- a/bin/autom4te.in
++++ b/bin/autom4te.in
+@@ -25,7 +25,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ unshift @INC, $pkgdatadir;
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+@@ -45,7 +46,8 @@ use File::Basename;
+ use strict;
+
+ # Data directory.
+-my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
++my $pkgdatadir = $ENV{'AC_MACRODIR'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+
+ # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
+ my %language;
+@@ -88,7 +90,7 @@ my @include;
+ my $freeze = 0;
+
+ # $M4.
+-my $m4 = $ENV{"M4"} || '@M4@';
++my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/m4' : '@M4@');
+ # Some non-GNU m4's don't reject the --help option, so give them /dev/null.
+ fatal "need GNU m4 1.4 or later: $m4"
+ if system "$m4 --help &1 | grep reload-state >/dev/null";
+@@ -270,6 +272,12 @@ sub load_configuration ($)
+
+ my @words = shellwords ($_);
+ my $type = shift @words;
++
++ if ($ENV{'STAGING_DIR'})
++ {
++ @words = map { s!^@pkgdatadir@!$ENV{'STAGING_DIR'}/../host/share/autoconf!; $_ } @words;
++ }
++
+ if ($type eq 'begin-language:')
+ {
+ fatal "$file:$.: end-language missing for: $lang"
+--- a/bin/autoreconf.in
++++ b/bin/autoreconf.in
+@@ -27,7 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ unshift @INC, $pkgdatadir;
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+@@ -107,9 +108,9 @@ Written by David J. MacKenzie and Akim D
+ ";
+
+ # Lib files.
+-my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@';
+-my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@';
+-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
++my $autoconf = $ENV{'AUTOCONF'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoconf-name@' : '@bindir@/@autoconf-name@');
++my $autoheader = $ENV{'AUTOHEADER'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoheader-name@' : '@bindir@/@autoheader-name@');
++my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
+ my $automake = $ENV{'AUTOMAKE'} || 'automake';
+ my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
+ my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
+--- a/bin/autoscan.in
++++ b/bin/autoscan.in
+@@ -26,7 +26,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ unshift @INC, $pkgdatadir;
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+@@ -92,10 +93,10 @@ my $configure_scan = 'configure.scan';
+ my $log;
+
+ # Autoconf and lib files.
+-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
++my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
+ my $autoconf = "$autom4te --language=autoconf";
+ my @prepend_include;
+-my @include = ('@pkgdatadir@');
++my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+
+ # $help
+ # -----
+--- a/bin/autoupdate.in
++++ b/bin/autoupdate.in
+@@ -27,7 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ unshift @INC, $pkgdatadir;
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+@@ -51,10 +52,10 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bin
+ my $autoconf = "$autom4te --language=autoconf";
+ # We need to find m4sugar.
+ my @prepend_include;
+-my @include = ('@pkgdatadir@');
++my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ my $force = 0;
+ # m4.
+-my $m4 = $ENV{"M4"} || '@M4@';
++my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/m4' : '@M4@');
+
+
+ # $HELP
+--- a/bin/ifnames.in
++++ b/bin/ifnames.in
+@@ -31,7 +31,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ unshift @INC, $pkgdatadir;
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+--- a/bin/autoconf.as
++++ b/bin/autoconf.as
+@@ -85,7 +85,11 @@ exit_missing_arg='
+ # restore font-lock: '
+
+ # Variables.
+-: ${AUTOM4TE='@bindir@/@autom4te-name@'}
++if test -n "$STAGING_DIR"; then
++ : ${AUTOM4TE="$STAGING_DIR/../host/bin/@autom4te-name@"}
++else
++ : ${AUTOM4TE='@bindir@/@autom4te-name@'}
++fi
+ autom4te_options=
+ outfile=
+ verbose=false
diff --git a/tools/autoconf/patches/.svn/text-base/001-no_emacs_lib.patch.svn-base b/tools/autoconf/patches/.svn/text-base/001-no_emacs_lib.patch.svn-base
new file mode 100644
index 0000000..02e115d
--- /dev/null
+++ b/tools/autoconf/patches/.svn/text-base/001-no_emacs_lib.patch.svn-base
@@ -0,0 +1,22 @@
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -16,7 +16,7 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program. If not, see .
+
+-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
++SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
+ nodist_pkgdata_DATA = autom4te.cfg
+ EXTRA_DIST = autom4te.in freeze.mk
+
+--- a/lib/Makefile.in
++++ b/lib/Makefile.in
+@@ -226,7 +226,7 @@ target_alias = @target_alias@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
++SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
+ nodist_pkgdata_DATA = autom4te.cfg
+ EXTRA_DIST = autom4te.in freeze.mk
+ edit = sed \
diff --git a/tools/autoconf/patches/000-relocatable.patch b/tools/autoconf/patches/000-relocatable.patch
new file mode 100644
index 0000000..0b83a2b
--- /dev/null
+++ b/tools/autoconf/patches/000-relocatable.patch
@@ -0,0 +1,167 @@
+--- a/bin/autoheader.in
++++ b/bin/autoheader.in
+@@ -29,7 +29,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ unshift @INC, "$pkgdatadir";
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+@@ -51,7 +52,7 @@ use strict;
+ use vars qw ($config_h %verbatim %symbol);
+
+ # Lib files.
+-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
++my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
+ local $config_h;
+ my $config_h_in;
+ my @prepend_include;
+--- a/bin/autom4te.in
++++ b/bin/autom4te.in
+@@ -25,7 +25,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ unshift @INC, $pkgdatadir;
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+@@ -45,7 +46,8 @@ use File::Basename;
+ use strict;
+
+ # Data directory.
+-my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
++my $pkgdatadir = $ENV{'AC_MACRODIR'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+
+ # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
+ my %language;
+@@ -88,7 +90,7 @@ my @include;
+ my $freeze = 0;
+
+ # $M4.
+-my $m4 = $ENV{"M4"} || '@M4@';
++my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/m4' : '@M4@');
+ # Some non-GNU m4's don't reject the --help option, so give them /dev/null.
+ fatal "need GNU m4 1.4 or later: $m4"
+ if system "$m4 --help &1 | grep reload-state >/dev/null";
+@@ -270,6 +272,12 @@ sub load_configuration ($)
+
+ my @words = shellwords ($_);
+ my $type = shift @words;
++
++ if ($ENV{'STAGING_DIR'})
++ {
++ @words = map { s!^@pkgdatadir@!$ENV{'STAGING_DIR'}/../host/share/autoconf!; $_ } @words;
++ }
++
+ if ($type eq 'begin-language:')
+ {
+ fatal "$file:$.: end-language missing for: $lang"
+--- a/bin/autoreconf.in
++++ b/bin/autoreconf.in
+@@ -27,7 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ unshift @INC, $pkgdatadir;
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+@@ -107,9 +108,9 @@ Written by David J. MacKenzie and Akim D
+ ";
+
+ # Lib files.
+-my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@';
+-my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@';
+-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
++my $autoconf = $ENV{'AUTOCONF'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoconf-name@' : '@bindir@/@autoconf-name@');
++my $autoheader = $ENV{'AUTOHEADER'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoheader-name@' : '@bindir@/@autoheader-name@');
++my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
+ my $automake = $ENV{'AUTOMAKE'} || 'automake';
+ my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
+ my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
+--- a/bin/autoscan.in
++++ b/bin/autoscan.in
+@@ -26,7 +26,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ unshift @INC, $pkgdatadir;
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+@@ -92,10 +93,10 @@ my $configure_scan = 'configure.scan';
+ my $log;
+
+ # Autoconf and lib files.
+-my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
++my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
+ my $autoconf = "$autom4te --language=autoconf";
+ my @prepend_include;
+-my @include = ('@pkgdatadir@');
++my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+
+ # $help
+ # -----
+--- a/bin/autoupdate.in
++++ b/bin/autoupdate.in
+@@ -27,7 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ unshift @INC, $pkgdatadir;
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+@@ -51,10 +52,10 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bin
+ my $autoconf = "$autom4te --language=autoconf";
+ # We need to find m4sugar.
+ my @prepend_include;
+-my @include = ('@pkgdatadir@');
++my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ my $force = 0;
+ # m4.
+-my $m4 = $ENV{"M4"} || '@M4@';
++my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/m4' : '@M4@');
+
+
+ # $HELP
+--- a/bin/ifnames.in
++++ b/bin/ifnames.in
+@@ -31,7 +31,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
++ my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
+ unshift @INC, $pkgdatadir;
+
+ # Override SHELL. On DJGPP SHELL may not be set to a shell
+--- a/bin/autoconf.as
++++ b/bin/autoconf.as
+@@ -85,7 +85,11 @@ exit_missing_arg='
+ # restore font-lock: '
+
+ # Variables.
+-: ${AUTOM4TE='@bindir@/@autom4te-name@'}
++if test -n "$STAGING_DIR"; then
++ : ${AUTOM4TE="$STAGING_DIR/../host/bin/@autom4te-name@"}
++else
++ : ${AUTOM4TE='@bindir@/@autom4te-name@'}
++fi
+ autom4te_options=
+ outfile=
+ verbose=false
diff --git a/tools/autoconf/patches/001-no_emacs_lib.patch b/tools/autoconf/patches/001-no_emacs_lib.patch
new file mode 100644
index 0000000..02e115d
--- /dev/null
+++ b/tools/autoconf/patches/001-no_emacs_lib.patch
@@ -0,0 +1,22 @@
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -16,7 +16,7 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program. If not, see .
+
+-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
++SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
+ nodist_pkgdata_DATA = autom4te.cfg
+ EXTRA_DIST = autom4te.in freeze.mk
+
+--- a/lib/Makefile.in
++++ b/lib/Makefile.in
+@@ -226,7 +226,7 @@ target_alias = @target_alias@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
++SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
+ nodist_pkgdata_DATA = autom4te.cfg
+ EXTRA_DIST = autom4te.in freeze.mk
+ edit = sed \
diff --git a/tools/automake/.svn/entries b/tools/automake/.svn/entries
new file mode 100644
index 0000000..5b84a23
--- /dev/null
+++ b/tools/automake/.svn/entries
@@ -0,0 +1,68 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/automake
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-06-07T14:57:08.645114Z
+32109
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+files
+dir
+
+patches
+dir
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+cad56c7eb3c40c272c406e1e2ae310c3
+2012-04-02T16:25:28.723158Z
+31173
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1026
+
diff --git a/tools/automake/.svn/text-base/Makefile.svn-base b/tools/automake/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..63d28bd
--- /dev/null
+++ b/tools/automake/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2006-2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=automake
+PKG_VERSION:=1.11.3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNU/automake
+PKG_MD5SUM:=3d72b2076eb4397ad5e9a2aace6357fd
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_CONFIGURE_ARGS += --datarootdir=$(STAGING_DIR_HOST)/share
+HOST_CONFIGURE_VARS += am_cv_prog_PERL_ithreads=no
+
+define Host/Install
+ $(MAKE) -C $(HOST_BUILD_DIR) install
+ mv $(STAGING_DIR_HOST)/bin/aclocal $(STAGING_DIR_HOST)/bin/aclocal.real
+ $(INSTALL_BIN) ./files/aclocal $(STAGING_DIR_HOST)/bin
+ ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.9
+ ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.10
+ ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.11
+ ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.11.1
+endef
+
+define Host/Clean
+ -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
+ $(call Host/Clean/Default)
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/automake/Makefile b/tools/automake/Makefile
new file mode 100644
index 0000000..63d28bd
--- /dev/null
+++ b/tools/automake/Makefile
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2006-2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=automake
+PKG_VERSION:=1.11.3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNU/automake
+PKG_MD5SUM:=3d72b2076eb4397ad5e9a2aace6357fd
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_CONFIGURE_ARGS += --datarootdir=$(STAGING_DIR_HOST)/share
+HOST_CONFIGURE_VARS += am_cv_prog_PERL_ithreads=no
+
+define Host/Install
+ $(MAKE) -C $(HOST_BUILD_DIR) install
+ mv $(STAGING_DIR_HOST)/bin/aclocal $(STAGING_DIR_HOST)/bin/aclocal.real
+ $(INSTALL_BIN) ./files/aclocal $(STAGING_DIR_HOST)/bin
+ ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.9
+ ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.10
+ ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.11
+ ln -sf aclocal $(STAGING_DIR_HOST)/bin/aclocal-1.11.1
+endef
+
+define Host/Clean
+ -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
+ $(call Host/Clean/Default)
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/automake/files/.svn/entries b/tools/automake/files/.svn/entries
new file mode 100644
index 0000000..aa674f9
--- /dev/null
+++ b/tools/automake/files/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/automake/files
+svn://svn.openwrt.org/openwrt
+
+
+
+2009-04-22T22:05:55.175489Z
+15339
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+aclocal
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+822a72d2dbf46d1c8c54489255ba310c
+2009-04-22T22:05:55.175489Z
+15339
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+51
+
diff --git a/tools/automake/files/.svn/prop-base/aclocal.svn-base b/tools/automake/files/.svn/prop-base/aclocal.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/tools/automake/files/.svn/prop-base/aclocal.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/tools/automake/files/.svn/text-base/aclocal.svn-base b/tools/automake/files/.svn/text-base/aclocal.svn-base
new file mode 100644
index 0000000..a60df10
--- /dev/null
+++ b/tools/automake/files/.svn/text-base/aclocal.svn-base
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+aclocal.real $ACLOCAL_INCLUDE $@
diff --git a/tools/automake/files/aclocal b/tools/automake/files/aclocal
new file mode 100755
index 0000000..a60df10
--- /dev/null
+++ b/tools/automake/files/aclocal
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+aclocal.real $ACLOCAL_INCLUDE $@
diff --git a/tools/automake/patches/.svn/entries b/tools/automake/patches/.svn/entries
new file mode 100644
index 0000000..20f2516
--- /dev/null
+++ b/tools/automake/patches/.svn/entries
@@ -0,0 +1,130 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/automake/patches
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-06-07T14:57:08.645114Z
+32109
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+000-relocatable.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+e880c23289a5df995d97738e18ff8186
+2012-04-02T16:25:28.723158Z
+31173
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1913
+
+200-fix_missing_py_compile.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+980b94a6450bd9afdeb326948a33fc9a
+2012-06-07T14:57:08.645114Z
+32109
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+554
+
+100-aclocal-skip-not-existing-directories.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+3ac18eebc0149260495787503697aa08
+2012-04-02T16:25:28.723158Z
+31173
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+347
+
diff --git a/tools/automake/patches/.svn/text-base/000-relocatable.patch.svn-base b/tools/automake/patches/.svn/text-base/000-relocatable.patch.svn-base
new file mode 100644
index 0000000..827797c
--- /dev/null
+++ b/tools/automake/patches/.svn/text-base/000-relocatable.patch.svn-base
@@ -0,0 +1,46 @@
+--- a/aclocal.in
++++ b/aclocal.in
+@@ -29,7 +29,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $perllibdir = $ENV{'perllibdir'} || '@datadir@/@PACKAGE@-@APIVERSION@';
++ my $perllibdir = $ENV{'perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@');
+ unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
+ }
+
+@@ -61,8 +62,8 @@ $perl_threads = 0;
+ # ACLOCAL_PATH environment variable, and reset with the `--system-acdir'
+ # option.
+ my @user_includes = ();
+-my @automake_includes = ("@datadir@/aclocal-$APIVERSION");
+-my @system_includes = ('@datadir@/aclocal');
++my @automake_includes = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . "/../host/share/aclocal-$APIVERSION" : "@datadir@/aclocal-$APIVERSION");
++my @system_includes = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/aclocal' : '@datadir@/aclocal');
+
+ # Whether we should copy M4 file in $user_includes[0].
+ my $install = 0;
+--- a/automake.in
++++ b/automake.in
+@@ -31,7 +31,8 @@ package Language;
+
+ BEGIN
+ {
+- my $perllibdir = $ENV{'perllibdir'} || '@datadir@/@PACKAGE@-@APIVERSION@';
++ my $perllibdir = $ENV{'perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@');
+ unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
+
+ # Override SHELL. This is required on DJGPP so that system() uses
+--- a/lib/Automake/Config.in
++++ b/lib/Automake/Config.in
+@@ -31,7 +31,7 @@ our $APIVERSION = '@APIVERSION@';
+ our $PACKAGE = '@PACKAGE@';
+ our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@';
+ our $VERSION = '@VERSION@';
+-our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
++our $libdir = $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@';
+ our $perl_threads = @PERL_THREADS@;
+
+ 1;
diff --git a/tools/automake/patches/.svn/text-base/100-aclocal-skip-not-existing-directories.patch.svn-base b/tools/automake/patches/.svn/text-base/100-aclocal-skip-not-existing-directories.patch.svn-base
new file mode 100644
index 0000000..7829d0e
--- /dev/null
+++ b/tools/automake/patches/.svn/text-base/100-aclocal-skip-not-existing-directories.patch.svn-base
@@ -0,0 +1,15 @@
+--- a/aclocal.in
++++ b/aclocal.in
+@@ -314,6 +314,12 @@ sub scan_m4_dirs ($@)
+
+ foreach my $m4dir (@dirlist)
+ {
++ if (! -d $m4dir)
++ {
++ msg ('override', "warning: skipping not existing directory `$m4dir'");
++ next;
++ }
++
+ if (! opendir (DIR, $m4dir))
+ {
+ fatal "couldn't open directory `$m4dir': $!";
diff --git a/tools/automake/patches/.svn/text-base/200-fix_missing_py_compile.patch.svn-base b/tools/automake/patches/.svn/text-base/200-fix_missing_py_compile.patch.svn-base
new file mode 100644
index 0000000..b03bdff
--- /dev/null
+++ b/tools/automake/patches/.svn/text-base/200-fix_missing_py_compile.patch.svn-base
@@ -0,0 +1,14 @@
+Index: automake-1.11.3/lib/am/python.am
+===================================================================
+--- automake-1.11.3.orig/lib/am/python.am 2012-01-31 12:41:18.000000000 +0100
++++ automake-1.11.3/lib/am/python.am 2012-06-07 16:42:53.488515898 +0200
+@@ -23,8 +23,8 @@
+ ## Installing. ##
+ ## ------------ ##
+
+-if %?INSTALL%
+ ?FIRST?am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
++if %?INSTALL%
+ am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
+ .PHONY install-%EXEC?exec:data%-am: install-%DIR%PYTHON
+ install-%DIR%PYTHON: $(%DIR%_PYTHON)
diff --git a/tools/automake/patches/000-relocatable.patch b/tools/automake/patches/000-relocatable.patch
new file mode 100644
index 0000000..827797c
--- /dev/null
+++ b/tools/automake/patches/000-relocatable.patch
@@ -0,0 +1,46 @@
+--- a/aclocal.in
++++ b/aclocal.in
+@@ -29,7 +29,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
+
+ BEGIN
+ {
+- my $perllibdir = $ENV{'perllibdir'} || '@datadir@/@PACKAGE@-@APIVERSION@';
++ my $perllibdir = $ENV{'perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@');
+ unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
+ }
+
+@@ -61,8 +62,8 @@ $perl_threads = 0;
+ # ACLOCAL_PATH environment variable, and reset with the `--system-acdir'
+ # option.
+ my @user_includes = ();
+-my @automake_includes = ("@datadir@/aclocal-$APIVERSION");
+-my @system_includes = ('@datadir@/aclocal');
++my @automake_includes = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . "/../host/share/aclocal-$APIVERSION" : "@datadir@/aclocal-$APIVERSION");
++my @system_includes = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/aclocal' : '@datadir@/aclocal');
+
+ # Whether we should copy M4 file in $user_includes[0].
+ my $install = 0;
+--- a/automake.in
++++ b/automake.in
+@@ -31,7 +31,8 @@ package Language;
+
+ BEGIN
+ {
+- my $perllibdir = $ENV{'perllibdir'} || '@datadir@/@PACKAGE@-@APIVERSION@';
++ my $perllibdir = $ENV{'perllibdir'} ||
++ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@');
+ unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
+
+ # Override SHELL. This is required on DJGPP so that system() uses
+--- a/lib/Automake/Config.in
++++ b/lib/Automake/Config.in
+@@ -31,7 +31,7 @@ our $APIVERSION = '@APIVERSION@';
+ our $PACKAGE = '@PACKAGE@';
+ our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@';
+ our $VERSION = '@VERSION@';
+-our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
++our $libdir = $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@';
+ our $perl_threads = @PERL_THREADS@;
+
+ 1;
diff --git a/tools/automake/patches/100-aclocal-skip-not-existing-directories.patch b/tools/automake/patches/100-aclocal-skip-not-existing-directories.patch
new file mode 100644
index 0000000..7829d0e
--- /dev/null
+++ b/tools/automake/patches/100-aclocal-skip-not-existing-directories.patch
@@ -0,0 +1,15 @@
+--- a/aclocal.in
++++ b/aclocal.in
+@@ -314,6 +314,12 @@ sub scan_m4_dirs ($@)
+
+ foreach my $m4dir (@dirlist)
+ {
++ if (! -d $m4dir)
++ {
++ msg ('override', "warning: skipping not existing directory `$m4dir'");
++ next;
++ }
++
+ if (! opendir (DIR, $m4dir))
+ {
+ fatal "couldn't open directory `$m4dir': $!";
diff --git a/tools/automake/patches/200-fix_missing_py_compile.patch b/tools/automake/patches/200-fix_missing_py_compile.patch
new file mode 100644
index 0000000..b03bdff
--- /dev/null
+++ b/tools/automake/patches/200-fix_missing_py_compile.patch
@@ -0,0 +1,14 @@
+Index: automake-1.11.3/lib/am/python.am
+===================================================================
+--- automake-1.11.3.orig/lib/am/python.am 2012-01-31 12:41:18.000000000 +0100
++++ automake-1.11.3/lib/am/python.am 2012-06-07 16:42:53.488515898 +0200
+@@ -23,8 +23,8 @@
+ ## Installing. ##
+ ## ------------ ##
+
+-if %?INSTALL%
+ ?FIRST?am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
++if %?INSTALL%
+ am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
+ .PHONY install-%EXEC?exec:data%-am: install-%DIR%PYTHON
+ install-%DIR%PYTHON: $(%DIR%_PYTHON)
diff --git a/tools/b43-tools/.svn/entries b/tools/b43-tools/.svn/entries
new file mode 100644
index 0000000..a0de33d
--- /dev/null
+++ b/tools/b43-tools/.svn/entries
@@ -0,0 +1,68 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/b43-tools
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-02-28T10:43:02.730422Z
+35830
+hauke
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+files
+dir
+
+patches
+dir
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+883fccb0780093237cf5d5a7150d2ac0
+2012-12-07T18:30:19.257724Z
+34574
+hauke
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1493
+
diff --git a/tools/b43-tools/.svn/text-base/Makefile.svn-base b/tools/b43-tools/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..e25bfc2
--- /dev/null
+++ b/tools/b43-tools/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=b43-tools
+PKG_VERSION:=017
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=git://git.bues.ch/b43-tools.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)
+PKG_SOURCE_VERSION:=691cd291afdb3dbfcf6b9624f8f4bd068af153d0
+#PKG_MIRROR_MD5SUM:=50ca3c763ee21ee213addd17cf1c1b86
+HOST_BUILD_DIR=$(BUILD_DIR_HOST)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/host-build.mk
+
+
+define Host/Compile
+ +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/fwcutter \
+ CFLAGS="$(HOST_CFLAGS) -include endian.h" \
+ $(HOST_MAKE_FLAGS) \
+ $(1) QUIET_SPARSE=:
+ +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/assembler \
+ CFLAGS="$(HOST_CFLAGS) -include endian.h" \
+ $(HOST_MAKE_FLAGS) \
+ LDFLAGS= \
+ $(1) QUIET_SPARSE=:
+endef
+
+define Host/Install
+ $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/fwcutter/b43-fwcutter $(STAGING_DIR_HOST)/bin/
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/assembler/b43-asm $(STAGING_DIR_HOST)/bin/
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/assembler/b43-asm.bin $(STAGING_DIR_HOST)/bin/
+ $(INSTALL_BIN) ./files/b43-fwsquash.py $(STAGING_DIR_HOST)/bin/
+endef
+
+define Host/Clean
+ rm -f $(STAGING_DIR_HOST)/bin/b43-fwcutter
+ rm -f $(STAGING_DIR_HOST)/bin/b43-asm
+ rm -f $(STAGING_DIR_HOST)/bin/b43-asm.bin
+ rm -f $(STAGING_DIR_HOST)/bin/b43-fwsquash.py
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/b43-tools/Makefile b/tools/b43-tools/Makefile
new file mode 100644
index 0000000..e25bfc2
--- /dev/null
+++ b/tools/b43-tools/Makefile
@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=b43-tools
+PKG_VERSION:=017
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=git://git.bues.ch/b43-tools.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)
+PKG_SOURCE_VERSION:=691cd291afdb3dbfcf6b9624f8f4bd068af153d0
+#PKG_MIRROR_MD5SUM:=50ca3c763ee21ee213addd17cf1c1b86
+HOST_BUILD_DIR=$(BUILD_DIR_HOST)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/host-build.mk
+
+
+define Host/Compile
+ +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/fwcutter \
+ CFLAGS="$(HOST_CFLAGS) -include endian.h" \
+ $(HOST_MAKE_FLAGS) \
+ $(1) QUIET_SPARSE=:
+ +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR)/assembler \
+ CFLAGS="$(HOST_CFLAGS) -include endian.h" \
+ $(HOST_MAKE_FLAGS) \
+ LDFLAGS= \
+ $(1) QUIET_SPARSE=:
+endef
+
+define Host/Install
+ $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/fwcutter/b43-fwcutter $(STAGING_DIR_HOST)/bin/
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/assembler/b43-asm $(STAGING_DIR_HOST)/bin/
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/assembler/b43-asm.bin $(STAGING_DIR_HOST)/bin/
+ $(INSTALL_BIN) ./files/b43-fwsquash.py $(STAGING_DIR_HOST)/bin/
+endef
+
+define Host/Clean
+ rm -f $(STAGING_DIR_HOST)/bin/b43-fwcutter
+ rm -f $(STAGING_DIR_HOST)/bin/b43-asm
+ rm -f $(STAGING_DIR_HOST)/bin/b43-asm.bin
+ rm -f $(STAGING_DIR_HOST)/bin/b43-fwsquash.py
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/b43-tools/files/.svn/entries b/tools/b43-tools/files/.svn/entries
new file mode 100644
index 0000000..1e936c1
--- /dev/null
+++ b/tools/b43-tools/files/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/b43-tools/files
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-10-08T20:15:42.151953Z
+33668
+hauke
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+b43-fwsquash.py
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+f7a389b79913bf5d30607d21acd2f3a3
+2012-10-08T20:15:42.151953Z
+33668
+hauke
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3336
+
diff --git a/tools/b43-tools/files/.svn/prop-base/b43-fwsquash.py.svn-base b/tools/b43-tools/files/.svn/prop-base/b43-fwsquash.py.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/tools/b43-tools/files/.svn/prop-base/b43-fwsquash.py.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/tools/b43-tools/files/.svn/text-base/b43-fwsquash.py.svn-base b/tools/b43-tools/files/.svn/text-base/b43-fwsquash.py.svn-base
new file mode 100644
index 0000000..cd88181
--- /dev/null
+++ b/tools/b43-tools/files/.svn/text-base/b43-fwsquash.py.svn-base
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+#
+# b43 firmware file squasher
+# Removes unnecessary firmware files
+#
+# Copyright (c) 2009 Michael Buesch
+#
+# Licensed under the GNU/GPL version 2 or (at your option) any later version.
+#
+
+import sys
+import os
+
+def usage():
+ print("Usage: %s PHYTYPES COREREVS /path/to/extracted/firmware" % sys.argv[0])
+ print("")
+ print("PHYTYPES is a comma separated list of:")
+ print("A => A-PHY")
+ print("AG => Dual A-PHY G-PHY")
+ print("G => G-PHY")
+ print("LP => LP-PHY")
+ print("N => N-PHY")
+ print("HT => HT-PHY")
+ print("LCN => LCN-PHY")
+ print("")
+ print("COREREVS is a comma separated list of core revision numbers.")
+
+if len(sys.argv) != 4:
+ usage()
+ sys.exit(1)
+
+phytypes = sys.argv[1]
+corerevs = sys.argv[2]
+fwpath = sys.argv[3]
+
+phytypes = phytypes.split(',')
+try:
+ corerevs = map(lambda r: int(r), corerevs.split(','))
+except ValueError:
+ print("ERROR: \"%s\" is not a valid COREREVS string\n" % corerevs)
+ usage()
+ sys.exit(1)
+
+
+fwfiles = os.listdir(fwpath)
+fwfiles = filter(lambda str: str.endswith(".fw"), fwfiles)
+if not fwfiles:
+ print("ERROR: No firmware files found in %s" % fwpath)
+ sys.exit(1)
+
+required_fwfiles = []
+
+def revs_match(revs_a, revs_b):
+ for rev in revs_a:
+ if rev in revs_b:
+ return True
+ return False
+
+def phytypes_match(types_a, types_b):
+ for type in types_a:
+ type = type.strip().upper()
+ if type in types_b:
+ return True
+ return False
+
+revmapping = {
+ "ucode2.fw" : (2,3,),
+ "ucode4.fw" : (4,),
+ "ucode5.fw" : (5,6,7,8,9,10,),
+ "ucode11.fw" : (11,12,),
+ "ucode13.fw" : (13,),
+ "ucode14.fw" : (14,),
+ "ucode15.fw" : (15,),
+ "ucode16_mimo.fw" : (16,),
+ "ucode24_mimo.fw" : (24,),
+ "ucode29_mimo.fw" : (29,),
+ "pcm4.fw" : (1,2,3,4,),
+ "pcm5.fw" : (5,6,7,8,9,10,),
+}
+
+initvalmapping = {
+ "a0g1initvals5.fw" : ( (5,6,7,8,9,10,), ("AG",), ),
+ "a0g0initvals5.fw" : ( (5,6,7,8,9,10,), ("A", "AG",), ),
+ "b0g0initvals2.fw" : ( (2,4,), ("G",), ),
+ "b0g0initvals5.fw" : ( (5,6,7,8,9,10,), ("G",), ),
+ "b0g0initvals13.fw" : ( (13,), ("G",), ),
+ "n0initvals11.fw" : ( (11,12,), ("N",), ),
+ "n0initvals16.fw" : ( (16,), ("N",), ),
+ "lp0initvals13.fw" : ( (13,), ("LP",), ),
+ "lp0initvals14.fw" : ( (14,), ("LP",), ),
+ "lp0initvals15.fw" : ( (15,), ("LP",), ),
+ "lcn0initvals24.fw" : ( (24,), ("LCN",), ),
+ "ht0initvals29.fw" : ( (29,), ("HT",), ),
+ "a0g1bsinitvals5.fw" : ( (5,6,7,8,9,10,), ("AG",), ),
+ "a0g0bsinitvals5.fw" : ( (5,6,7,8,9,10,), ("A", "AG"), ),
+ "b0g0bsinitvals5.fw" : ( (5,6,7,8,9,10,), ("G",), ),
+ "n0bsinitvals11.fw" : ( (11,12,), ("N",), ),
+ "n0bsinitvals16.fw" : ( (16,), ("N",), ),
+ "lp0bsinitvals13.fw" : ( (13,), ("LP",), ),
+ "lp0bsinitvals14.fw" : ( (14,), ("LP",), ),
+ "lp0bsinitvals15.fw" : ( (15,), ("LP",), ),
+ "lcn0bsinitvals24.fw" : ( (24,), ("LCN",), ),
+ "ht0bsinitvals29.fw" : ( (29,), ("HT",), ),
+}
+
+for f in fwfiles:
+ if f in revmapping:
+ if revs_match(corerevs, revmapping[f]):
+ required_fwfiles += [f]
+ continue
+ if f in initvalmapping:
+ if revs_match(corerevs, initvalmapping[f][0]) and\
+ phytypes_match(phytypes, initvalmapping[f][1]):
+ required_fwfiles += [f]
+ continue
+ print("WARNING: Firmware file %s not found in the mapping lists" % f)
+
+for f in fwfiles:
+ if f not in required_fwfiles:
+ print("Deleting %s" % f)
+ os.unlink(fwpath + '/' + f)
+
diff --git a/tools/b43-tools/files/b43-fwsquash.py b/tools/b43-tools/files/b43-fwsquash.py
new file mode 100755
index 0000000..cd88181
--- /dev/null
+++ b/tools/b43-tools/files/b43-fwsquash.py
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+#
+# b43 firmware file squasher
+# Removes unnecessary firmware files
+#
+# Copyright (c) 2009 Michael Buesch
+#
+# Licensed under the GNU/GPL version 2 or (at your option) any later version.
+#
+
+import sys
+import os
+
+def usage():
+ print("Usage: %s PHYTYPES COREREVS /path/to/extracted/firmware" % sys.argv[0])
+ print("")
+ print("PHYTYPES is a comma separated list of:")
+ print("A => A-PHY")
+ print("AG => Dual A-PHY G-PHY")
+ print("G => G-PHY")
+ print("LP => LP-PHY")
+ print("N => N-PHY")
+ print("HT => HT-PHY")
+ print("LCN => LCN-PHY")
+ print("")
+ print("COREREVS is a comma separated list of core revision numbers.")
+
+if len(sys.argv) != 4:
+ usage()
+ sys.exit(1)
+
+phytypes = sys.argv[1]
+corerevs = sys.argv[2]
+fwpath = sys.argv[3]
+
+phytypes = phytypes.split(',')
+try:
+ corerevs = map(lambda r: int(r), corerevs.split(','))
+except ValueError:
+ print("ERROR: \"%s\" is not a valid COREREVS string\n" % corerevs)
+ usage()
+ sys.exit(1)
+
+
+fwfiles = os.listdir(fwpath)
+fwfiles = filter(lambda str: str.endswith(".fw"), fwfiles)
+if not fwfiles:
+ print("ERROR: No firmware files found in %s" % fwpath)
+ sys.exit(1)
+
+required_fwfiles = []
+
+def revs_match(revs_a, revs_b):
+ for rev in revs_a:
+ if rev in revs_b:
+ return True
+ return False
+
+def phytypes_match(types_a, types_b):
+ for type in types_a:
+ type = type.strip().upper()
+ if type in types_b:
+ return True
+ return False
+
+revmapping = {
+ "ucode2.fw" : (2,3,),
+ "ucode4.fw" : (4,),
+ "ucode5.fw" : (5,6,7,8,9,10,),
+ "ucode11.fw" : (11,12,),
+ "ucode13.fw" : (13,),
+ "ucode14.fw" : (14,),
+ "ucode15.fw" : (15,),
+ "ucode16_mimo.fw" : (16,),
+ "ucode24_mimo.fw" : (24,),
+ "ucode29_mimo.fw" : (29,),
+ "pcm4.fw" : (1,2,3,4,),
+ "pcm5.fw" : (5,6,7,8,9,10,),
+}
+
+initvalmapping = {
+ "a0g1initvals5.fw" : ( (5,6,7,8,9,10,), ("AG",), ),
+ "a0g0initvals5.fw" : ( (5,6,7,8,9,10,), ("A", "AG",), ),
+ "b0g0initvals2.fw" : ( (2,4,), ("G",), ),
+ "b0g0initvals5.fw" : ( (5,6,7,8,9,10,), ("G",), ),
+ "b0g0initvals13.fw" : ( (13,), ("G",), ),
+ "n0initvals11.fw" : ( (11,12,), ("N",), ),
+ "n0initvals16.fw" : ( (16,), ("N",), ),
+ "lp0initvals13.fw" : ( (13,), ("LP",), ),
+ "lp0initvals14.fw" : ( (14,), ("LP",), ),
+ "lp0initvals15.fw" : ( (15,), ("LP",), ),
+ "lcn0initvals24.fw" : ( (24,), ("LCN",), ),
+ "ht0initvals29.fw" : ( (29,), ("HT",), ),
+ "a0g1bsinitvals5.fw" : ( (5,6,7,8,9,10,), ("AG",), ),
+ "a0g0bsinitvals5.fw" : ( (5,6,7,8,9,10,), ("A", "AG"), ),
+ "b0g0bsinitvals5.fw" : ( (5,6,7,8,9,10,), ("G",), ),
+ "n0bsinitvals11.fw" : ( (11,12,), ("N",), ),
+ "n0bsinitvals16.fw" : ( (16,), ("N",), ),
+ "lp0bsinitvals13.fw" : ( (13,), ("LP",), ),
+ "lp0bsinitvals14.fw" : ( (14,), ("LP",), ),
+ "lp0bsinitvals15.fw" : ( (15,), ("LP",), ),
+ "lcn0bsinitvals24.fw" : ( (24,), ("LCN",), ),
+ "ht0bsinitvals29.fw" : ( (29,), ("HT",), ),
+}
+
+for f in fwfiles:
+ if f in revmapping:
+ if revs_match(corerevs, revmapping[f]):
+ required_fwfiles += [f]
+ continue
+ if f in initvalmapping:
+ if revs_match(corerevs, initvalmapping[f][0]) and\
+ phytypes_match(phytypes, initvalmapping[f][1]):
+ required_fwfiles += [f]
+ continue
+ print("WARNING: Firmware file %s not found in the mapping lists" % f)
+
+for f in fwfiles:
+ if f not in required_fwfiles:
+ print("Deleting %s" % f)
+ os.unlink(fwpath + '/' + f)
+
diff --git a/tools/b43-tools/patches/.svn/entries b/tools/b43-tools/patches/.svn/entries
new file mode 100644
index 0000000..d2d454a
--- /dev/null
+++ b/tools/b43-tools/patches/.svn/entries
@@ -0,0 +1,130 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/b43-tools/patches
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-02-28T10:43:02.730422Z
+35830
+hauke
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+002-no_libfl.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+80715d12b1af61c7679168155f97d4aa
+2012-10-25T16:39:38.826580Z
+33934
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+219
+
+100-b43-asm-fix-compile-error-undefined-reference-to-yyd.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+e4f61db6959bd82fb13ea3a9ec0c22ba
+2013-02-28T10:43:02.730422Z
+35830
+hauke
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+778
+
+001-fw-dirname.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+9d956bcfa5498419bfb7c08e27f69821
+2012-10-08T20:15:42.151953Z
+33668
+hauke
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+352
+
diff --git a/tools/b43-tools/patches/.svn/text-base/001-fw-dirname.patch.svn-base b/tools/b43-tools/patches/.svn/text-base/001-fw-dirname.patch.svn-base
new file mode 100644
index 0000000..e9bd032
--- /dev/null
+++ b/tools/b43-tools/patches/.svn/text-base/001-fw-dirname.patch.svn-base
@@ -0,0 +1,16 @@
+--- a/fwcutter/fwcutter.c
++++ b/fwcutter/fwcutter.c
+@@ -48,13 +48,8 @@
+ #include "fwcutter.h"
+ #include "fwcutter_list.h"
+
+-#if defined(__DragonFly__) || defined(__FreeBSD__)
+-#define V3_FW_DIRNAME "v3"
+-#define V4_FW_DIRNAME "v4"
+-#else
+ #define V3_FW_DIRNAME "b43legacy"
+ #define V4_FW_DIRNAME "b43"
+-#endif
+
+ static struct cmdline_args cmdargs;
+
diff --git a/tools/b43-tools/patches/.svn/text-base/002-no_libfl.patch.svn-base b/tools/b43-tools/patches/.svn/text-base/002-no_libfl.patch.svn-base
new file mode 100644
index 0000000..2e55b08
--- /dev/null
+++ b/tools/b43-tools/patches/.svn/text-base/002-no_libfl.patch.svn-base
@@ -0,0 +1,14 @@
+--- a/assembler/main.c
++++ b/assembler/main.c
+@@ -1268,6 +1268,11 @@ static void initialize(void)
+ #endif /* YYDEBUG */
+ }
+
++int yywrap(void)
++{
++ return 1;
++}
++
+ int main(int argc, char **argv)
+ {
+ int err, res = 1;
diff --git a/tools/b43-tools/patches/.svn/text-base/100-b43-asm-fix-compile-error-undefined-reference-to-yyd.patch.svn-base b/tools/b43-tools/patches/.svn/text-base/100-b43-asm-fix-compile-error-undefined-reference-to-yyd.patch.svn-base
new file mode 100644
index 0000000..fc0553d
--- /dev/null
+++ b/tools/b43-tools/patches/.svn/text-base/100-b43-asm-fix-compile-error-undefined-reference-to-yyd.patch.svn-base
@@ -0,0 +1,27 @@
+--- a/assembler/Makefile
++++ b/assembler/Makefile
+@@ -30,7 +30,7 @@ BIN = b43-asm.bin
+ SRCS = parser.c scanner.c main.c initvals.c util.c args.c
+
+ # YACC related CFLAGS
+-CFLAGS += -DYYSTYPE="void *" -DYYERROR_VERBOSE -DYYDEBUG -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Wno-unused
++CFLAGS += -DYYSTYPE="void *" -DYYERROR_VERBOSE -DYYDEBUG=1 -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Wno-unused
+
+ .SUFFIXES:
+ .PHONY: all install clean distclean
+diff --git a/assembler/main.c b/assembler/main.c
+index afca996..a62a15e 100644
+--- a/assembler/main.c
++++ b/assembler/main.c
+@@ -1260,7 +1260,7 @@ static void initialize(void)
+ {
+ INIT_LIST_HEAD(&infile.sl);
+ INIT_LIST_HEAD(&infile.ivals);
+-#ifdef YYDEBUG
++#if YYDEBUG
+ if (IS_INSANE_DEBUG)
+ yydebug = 1;
+ else
+--
+1.7.10.4
+
diff --git a/tools/b43-tools/patches/001-fw-dirname.patch b/tools/b43-tools/patches/001-fw-dirname.patch
new file mode 100644
index 0000000..e9bd032
--- /dev/null
+++ b/tools/b43-tools/patches/001-fw-dirname.patch
@@ -0,0 +1,16 @@
+--- a/fwcutter/fwcutter.c
++++ b/fwcutter/fwcutter.c
+@@ -48,13 +48,8 @@
+ #include "fwcutter.h"
+ #include "fwcutter_list.h"
+
+-#if defined(__DragonFly__) || defined(__FreeBSD__)
+-#define V3_FW_DIRNAME "v3"
+-#define V4_FW_DIRNAME "v4"
+-#else
+ #define V3_FW_DIRNAME "b43legacy"
+ #define V4_FW_DIRNAME "b43"
+-#endif
+
+ static struct cmdline_args cmdargs;
+
diff --git a/tools/b43-tools/patches/002-no_libfl.patch b/tools/b43-tools/patches/002-no_libfl.patch
new file mode 100644
index 0000000..2e55b08
--- /dev/null
+++ b/tools/b43-tools/patches/002-no_libfl.patch
@@ -0,0 +1,14 @@
+--- a/assembler/main.c
++++ b/assembler/main.c
+@@ -1268,6 +1268,11 @@ static void initialize(void)
+ #endif /* YYDEBUG */
+ }
+
++int yywrap(void)
++{
++ return 1;
++}
++
+ int main(int argc, char **argv)
+ {
+ int err, res = 1;
diff --git a/tools/b43-tools/patches/100-b43-asm-fix-compile-error-undefined-reference-to-yyd.patch b/tools/b43-tools/patches/100-b43-asm-fix-compile-error-undefined-reference-to-yyd.patch
new file mode 100644
index 0000000..fc0553d
--- /dev/null
+++ b/tools/b43-tools/patches/100-b43-asm-fix-compile-error-undefined-reference-to-yyd.patch
@@ -0,0 +1,27 @@
+--- a/assembler/Makefile
++++ b/assembler/Makefile
+@@ -30,7 +30,7 @@ BIN = b43-asm.bin
+ SRCS = parser.c scanner.c main.c initvals.c util.c args.c
+
+ # YACC related CFLAGS
+-CFLAGS += -DYYSTYPE="void *" -DYYERROR_VERBOSE -DYYDEBUG -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Wno-unused
++CFLAGS += -DYYSTYPE="void *" -DYYERROR_VERBOSE -DYYDEBUG=1 -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Wno-unused
+
+ .SUFFIXES:
+ .PHONY: all install clean distclean
+diff --git a/assembler/main.c b/assembler/main.c
+index afca996..a62a15e 100644
+--- a/assembler/main.c
++++ b/assembler/main.c
+@@ -1260,7 +1260,7 @@ static void initialize(void)
+ {
+ INIT_LIST_HEAD(&infile.sl);
+ INIT_LIST_HEAD(&infile.ivals);
+-#ifdef YYDEBUG
++#if YYDEBUG
+ if (IS_INSANE_DEBUG)
+ yydebug = 1;
+ else
+--
+1.7.10.4
+
diff --git a/tools/bison/.svn/entries b/tools/bison/.svn/entries
new file mode 100644
index 0000000..97fe440
--- /dev/null
+++ b/tools/bison/.svn/entries
@@ -0,0 +1,65 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/bison
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-02-28T00:52:34.934626Z
+35827
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+patches
+dir
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+55987aab4398dce7f0042a6a2b586d5b
+2013-02-28T00:52:34.934626Z
+35827
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+581
+
diff --git a/tools/bison/.svn/text-base/Makefile.svn-base b/tools/bison/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..d20d1c0
--- /dev/null
+++ b/tools/bison/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2008-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bison
+PKG_VERSION:=2.7
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
+PKG_MD5SUM:=234cdfac99257cf99ac4a03c898f37b9
+PKG_CAT:=xzcat
+
+HOST_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
+
+define Host/Clean
+ -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
+ $(call Host/Clean/Default)
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/bison/Makefile b/tools/bison/Makefile
new file mode 100644
index 0000000..d20d1c0
--- /dev/null
+++ b/tools/bison/Makefile
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2008-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bison
+PKG_VERSION:=2.7
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
+PKG_MD5SUM:=234cdfac99257cf99ac4a03c898f37b9
+PKG_CAT:=xzcat
+
+HOST_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
+
+define Host/Clean
+ -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
+ $(call Host/Clean/Default)
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/bison/patches/.svn/entries b/tools/bison/patches/.svn/entries
new file mode 100644
index 0000000..e08b2b2
--- /dev/null
+++ b/tools/bison/patches/.svn/entries
@@ -0,0 +1,130 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/bison/patches
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-02-28T00:52:34.934626Z
+35827
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+100-fix-gets-removal.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+4224463f2de2d892d2d0af6a95181372
+2013-02-28T00:52:34.934626Z
+35827
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+468
+
+000-relocatable.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+ee005dbe2048ad7e4ab23c2600d69b3d
+2013-02-28T00:52:34.934626Z
+35827
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+649
+
+010-intl-stub-compat.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+bf0482e5801ab1ed0c397e3de91c6621
+2013-02-28T00:52:34.934626Z
+35827
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+440
+
diff --git a/tools/bison/patches/.svn/text-base/000-relocatable.patch.svn-base b/tools/bison/patches/.svn/text-base/000-relocatable.patch.svn-base
new file mode 100644
index 0000000..47c0ae8
--- /dev/null
+++ b/tools/bison/patches/.svn/text-base/000-relocatable.patch.svn-base
@@ -0,0 +1,20 @@
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -81,6 +81,7 @@ MOSTLYCLEANFILES = yacc
+
+ yacc:
+ $(AM_V_GEN)echo '#! /bin/sh' >$@
++ $(AM_V_at)echo 'test -n "$$STAGING_DIR" && exec "$$STAGING_DIR/../host/bin/bison" -y "$$@"' >>$@
+ $(AM_V_at)echo "exec '$(bindir)/bison' -y "'"$$@"' >>$@
+ $(AM_V_at)chmod a+x $@
+
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -1919,6 +1919,7 @@ uninstall-am: uninstall-binPROGRAMS unin
+
+ yacc:
+ $(AM_V_GEN)echo '#! /bin/sh' >$@
++ $(AM_V_at)echo 'test -n "$$STAGING_DIR" && exec "$$STAGING_DIR/../host/bin/bison" -y "$$@"' >>$@
+ $(AM_V_at)echo "exec '$(bindir)/bison' -y "'"$$@"' >>$@
+ $(AM_V_at)chmod a+x $@
+
diff --git a/tools/bison/patches/.svn/text-base/010-intl-stub-compat.patch.svn-base b/tools/bison/patches/.svn/text-base/010-intl-stub-compat.patch.svn-base
new file mode 100644
index 0000000..d2dfcad
--- /dev/null
+++ b/tools/bison/patches/.svn/text-base/010-intl-stub-compat.patch.svn-base
@@ -0,0 +1,15 @@
+--- a/src/main.c
++++ b/src/main.c
+@@ -60,9 +60,9 @@ main (int argc, char *argv[])
+ {
+ set_program_name (argv[0]);
+ setlocale (LC_ALL, "");
+- (void) bindtextdomain (PACKAGE, LOCALEDIR);
+- (void) bindtextdomain ("bison-runtime", LOCALEDIR);
+- (void) textdomain (PACKAGE);
++ bindtextdomain (PACKAGE, LOCALEDIR);
++ bindtextdomain ("bison-runtime", LOCALEDIR);
++ textdomain (PACKAGE);
+
+ {
+ char const *cp = getenv ("LC_CTYPE");
diff --git a/tools/bison/patches/.svn/text-base/100-fix-gets-removal.patch.svn-base b/tools/bison/patches/.svn/text-base/100-fix-gets-removal.patch.svn-base
new file mode 100644
index 0000000..169bfd6
--- /dev/null
+++ b/tools/bison/patches/.svn/text-base/100-fix-gets-removal.patch.svn-base
@@ -0,0 +1,16 @@
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -704,13 +704,6 @@ _GL_WARN_ON_USE (getline, "getline is un
+ # endif
+ #endif
+
+-/* It is very rare that the developer ever has full control of stdin,
+- so any use of gets warrants an unconditional warning; besides, C11
+- removed it. */
+-#undef gets
+-#if HAVE_RAW_DECL_GETS
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+-#endif
+
+
+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
diff --git a/tools/bison/patches/000-relocatable.patch b/tools/bison/patches/000-relocatable.patch
new file mode 100644
index 0000000..47c0ae8
--- /dev/null
+++ b/tools/bison/patches/000-relocatable.patch
@@ -0,0 +1,20 @@
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -81,6 +81,7 @@ MOSTLYCLEANFILES = yacc
+
+ yacc:
+ $(AM_V_GEN)echo '#! /bin/sh' >$@
++ $(AM_V_at)echo 'test -n "$$STAGING_DIR" && exec "$$STAGING_DIR/../host/bin/bison" -y "$$@"' >>$@
+ $(AM_V_at)echo "exec '$(bindir)/bison' -y "'"$$@"' >>$@
+ $(AM_V_at)chmod a+x $@
+
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -1919,6 +1919,7 @@ uninstall-am: uninstall-binPROGRAMS unin
+
+ yacc:
+ $(AM_V_GEN)echo '#! /bin/sh' >$@
++ $(AM_V_at)echo 'test -n "$$STAGING_DIR" && exec "$$STAGING_DIR/../host/bin/bison" -y "$$@"' >>$@
+ $(AM_V_at)echo "exec '$(bindir)/bison' -y "'"$$@"' >>$@
+ $(AM_V_at)chmod a+x $@
+
diff --git a/tools/bison/patches/010-intl-stub-compat.patch b/tools/bison/patches/010-intl-stub-compat.patch
new file mode 100644
index 0000000..d2dfcad
--- /dev/null
+++ b/tools/bison/patches/010-intl-stub-compat.patch
@@ -0,0 +1,15 @@
+--- a/src/main.c
++++ b/src/main.c
+@@ -60,9 +60,9 @@ main (int argc, char *argv[])
+ {
+ set_program_name (argv[0]);
+ setlocale (LC_ALL, "");
+- (void) bindtextdomain (PACKAGE, LOCALEDIR);
+- (void) bindtextdomain ("bison-runtime", LOCALEDIR);
+- (void) textdomain (PACKAGE);
++ bindtextdomain (PACKAGE, LOCALEDIR);
++ bindtextdomain ("bison-runtime", LOCALEDIR);
++ textdomain (PACKAGE);
+
+ {
+ char const *cp = getenv ("LC_CTYPE");
diff --git a/tools/bison/patches/100-fix-gets-removal.patch b/tools/bison/patches/100-fix-gets-removal.patch
new file mode 100644
index 0000000..169bfd6
--- /dev/null
+++ b/tools/bison/patches/100-fix-gets-removal.patch
@@ -0,0 +1,16 @@
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -704,13 +704,6 @@ _GL_WARN_ON_USE (getline, "getline is un
+ # endif
+ #endif
+
+-/* It is very rare that the developer ever has full control of stdin,
+- so any use of gets warrants an unconditional warning; besides, C11
+- removed it. */
+-#undef gets
+-#if HAVE_RAW_DECL_GETS
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+-#endif
+
+
+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
diff --git a/tools/ccache/.svn/entries b/tools/ccache/.svn/entries
new file mode 100644
index 0000000..41f403f
--- /dev/null
+++ b/tools/ccache/.svn/entries
@@ -0,0 +1,65 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/ccache
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-02-27T23:08:02.911935Z
+35821
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+files
+dir
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+4ba2fc1ea78cc6591237702456abfd40
+2013-02-27T23:08:02.911935Z
+35821
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1132
+
diff --git a/tools/ccache/.svn/text-base/Makefile.svn-base b/tools/ccache/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..aeac393
--- /dev/null
+++ b/tools/ccache/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2006-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/target.mk
+
+PKG_NAME:=ccache
+PKG_VERSION:=3.1.9
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://samba.org/ftp/ccache/
+PKG_MD5SUM:=522a6016bda56892653612bbdefff3e0
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
+HOST_CONFIGURE_VARS += CC="$(HOSTCC_NOCACHE)"
+
+define Host/Install/ccache
+ $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
+ $(CP) ./files/* $(STAGING_DIR_HOST)/bin/
+endef
+
+ifneq ($(strip $(shell which ccache >/dev/null && echo found)),found)
+ define Host/Clean
+ -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
+ $(call Host/Clean/Default)
+ endef
+ define Host/Install
+ $(call Host/Install/Default)
+ $(call Host/Install/ccache)
+ endef
+else
+ define Host/Prepare
+ endef
+ define Host/Configure
+ endef
+ define Host/Compile
+ endef
+ define Host/Install
+ $(call Host/Install/ccache)
+ endef
+ define Host/Clean
+ endef
+ define Download
+ endef
+endif
+
+$(eval $(call HostBuild))
diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile
new file mode 100644
index 0000000..aeac393
--- /dev/null
+++ b/tools/ccache/Makefile
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2006-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/target.mk
+
+PKG_NAME:=ccache
+PKG_VERSION:=3.1.9
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://samba.org/ftp/ccache/
+PKG_MD5SUM:=522a6016bda56892653612bbdefff3e0
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
+HOST_CONFIGURE_VARS += CC="$(HOSTCC_NOCACHE)"
+
+define Host/Install/ccache
+ $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
+ $(CP) ./files/* $(STAGING_DIR_HOST)/bin/
+endef
+
+ifneq ($(strip $(shell which ccache >/dev/null && echo found)),found)
+ define Host/Clean
+ -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
+ $(call Host/Clean/Default)
+ endef
+ define Host/Install
+ $(call Host/Install/Default)
+ $(call Host/Install/ccache)
+ endef
+else
+ define Host/Prepare
+ endef
+ define Host/Configure
+ endef
+ define Host/Compile
+ endef
+ define Host/Install
+ $(call Host/Install/ccache)
+ endef
+ define Host/Clean
+ endef
+ define Download
+ endef
+endif
+
+$(eval $(call HostBuild))
diff --git a/tools/ccache/files/.svn/entries b/tools/ccache/files/.svn/entries
new file mode 100644
index 0000000..f4f41a2
--- /dev/null
+++ b/tools/ccache/files/.svn/entries
@@ -0,0 +1,96 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/ccache/files
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-06-06T13:27:11.585623Z
+32075
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+ccache_cxx
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+b114c928783a72763b0c338becaf69ae
+2012-06-06T13:27:11.585623Z
+32075
+blogic
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+51
+
+ccache_cc
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+7594b0f4383f116e67d3421420ad02ae
+2012-06-06T13:27:11.585623Z
+32075
+blogic
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+50
+
diff --git a/tools/ccache/files/.svn/prop-base/ccache_cc.svn-base b/tools/ccache/files/.svn/prop-base/ccache_cc.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/tools/ccache/files/.svn/prop-base/ccache_cc.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/tools/ccache/files/.svn/prop-base/ccache_cxx.svn-base b/tools/ccache/files/.svn/prop-base/ccache_cxx.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/tools/ccache/files/.svn/prop-base/ccache_cxx.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/tools/ccache/files/.svn/text-base/ccache_cc.svn-base b/tools/ccache/files/.svn/text-base/ccache_cc.svn-base
new file mode 100644
index 0000000..01c4ad4
--- /dev/null
+++ b/tools/ccache/files/.svn/text-base/ccache_cc.svn-base
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ccache "${TARGET_CC_NOCACHE}" "$@"
diff --git a/tools/ccache/files/.svn/text-base/ccache_cxx.svn-base b/tools/ccache/files/.svn/text-base/ccache_cxx.svn-base
new file mode 100644
index 0000000..cc60eb3
--- /dev/null
+++ b/tools/ccache/files/.svn/text-base/ccache_cxx.svn-base
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ccache "${TARGET_CXX_NOCACHE}" "$@"
diff --git a/tools/ccache/files/ccache_cc b/tools/ccache/files/ccache_cc
new file mode 100755
index 0000000..01c4ad4
--- /dev/null
+++ b/tools/ccache/files/ccache_cc
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ccache "${TARGET_CC_NOCACHE}" "$@"
diff --git a/tools/ccache/files/ccache_cxx b/tools/ccache/files/ccache_cxx
new file mode 100755
index 0000000..cc60eb3
--- /dev/null
+++ b/tools/ccache/files/ccache_cxx
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec ccache "${TARGET_CXX_NOCACHE}" "$@"
diff --git a/tools/cloog/.svn/entries b/tools/cloog/.svn/entries
new file mode 100644
index 0000000..14e414a
--- /dev/null
+++ b/tools/cloog/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/cloog
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-04-02T16:25:20.144464Z
+31170
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+902c2c55a670e1d8423edd8195af55b5
+2012-04-02T16:25:20.144464Z
+31170
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+756
+
diff --git a/tools/cloog/.svn/text-base/Makefile.svn-base b/tools/cloog/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..140d4db
--- /dev/null
+++ b/tools/cloog/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,39 @@
+#
+# Copyright (C) 2009 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cloog-ppl
+PKG_VERSION:=0.15.11
+
+PKG_SOURCE_URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=060ae4df6fb8176e021b4d033a6c0b9e
+
+HOST_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/host-build.mk
+
+unexport CFLAGS
+
+HOST_CONFIGURE_VARS += \
+ LIBS=-lstdc++
+
+HOST_CONFIGURE_ARGS += \
+ --enable-static \
+ --disable-shared \
+ --with-ppl=$(BUILD_DIR_HOST)
+
+define Host/Configure
+ (cd $(HOST_BUILD_DIR)/$(3); \
+ $(HOST_CONFIGURE_CMD) \
+ $(HOST_CONFIGURE_VARS) \
+ $(HOST_CONFIGURE_ARGS); \
+ )
+endef
+
+
+$(eval $(call HostBuild))
diff --git a/tools/cloog/Makefile b/tools/cloog/Makefile
new file mode 100644
index 0000000..140d4db
--- /dev/null
+++ b/tools/cloog/Makefile
@@ -0,0 +1,39 @@
+#
+# Copyright (C) 2009 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cloog-ppl
+PKG_VERSION:=0.15.11
+
+PKG_SOURCE_URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=060ae4df6fb8176e021b4d033a6c0b9e
+
+HOST_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/host-build.mk
+
+unexport CFLAGS
+
+HOST_CONFIGURE_VARS += \
+ LIBS=-lstdc++
+
+HOST_CONFIGURE_ARGS += \
+ --enable-static \
+ --disable-shared \
+ --with-ppl=$(BUILD_DIR_HOST)
+
+define Host/Configure
+ (cd $(HOST_BUILD_DIR)/$(3); \
+ $(HOST_CONFIGURE_CMD) \
+ $(HOST_CONFIGURE_VARS) \
+ $(HOST_CONFIGURE_ARGS); \
+ )
+endef
+
+
+$(eval $(call HostBuild))
diff --git a/tools/cmake/.svn/entries b/tools/cmake/.svn/entries
new file mode 100644
index 0000000..a0d6673
--- /dev/null
+++ b/tools/cmake/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/cmake
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-02-28T00:52:33.072724Z
+35826
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+482d970efed1b370982e496dff80ba7f
+2013-02-28T00:52:33.072724Z
+35826
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+617
+
diff --git a/tools/cmake/.svn/text-base/Makefile.svn-base b/tools/cmake/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..4e4d71b
--- /dev/null
+++ b/tools/cmake/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2006-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cmake
+PKG_VERSION:=2.8.10.2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.cmake.org/files/v2.8/
+PKG_MD5SUM:=097278785da7182ec0aea8769d06860c
+
+HOST_BUILD_PARALLEL:=1
+HOST_CONFIGURE_PARALLEL:=1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_CONFIGURE_VARS :=
+
+HOST_CONFIGURE_ARGS := \
+ --prefix=$(STAGING_DIR_HOST) \
+ $(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)")
+
+$(eval $(call HostBuild))
diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile
new file mode 100644
index 0000000..4e4d71b
--- /dev/null
+++ b/tools/cmake/Makefile
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2006-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=cmake
+PKG_VERSION:=2.8.10.2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.cmake.org/files/v2.8/
+PKG_MD5SUM:=097278785da7182ec0aea8769d06860c
+
+HOST_BUILD_PARALLEL:=1
+HOST_CONFIGURE_PARALLEL:=1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_CONFIGURE_VARS :=
+
+HOST_CONFIGURE_ARGS := \
+ --prefix=$(STAGING_DIR_HOST) \
+ $(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)")
+
+$(eval $(call HostBuild))
diff --git a/tools/dosfstools/.svn/entries b/tools/dosfstools/.svn/entries
new file mode 100644
index 0000000..8ad3ca9
--- /dev/null
+++ b/tools/dosfstools/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/dosfstools
+svn://svn.openwrt.org/openwrt
+
+
+
+2012-08-12T12:34:30.330423Z
+33140
+jow
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:23.000000Z
+f3cc990178c90998ce63ff6d4d39b2de
+2012-08-12T12:34:30.330423Z
+33140
+jow
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+744
+
diff --git a/tools/dosfstools/.svn/text-base/Makefile.svn-base b/tools/dosfstools/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..c582489
--- /dev/null
+++ b/tools/dosfstools/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,30 @@
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=dosfstools
+PKG_VERSION:=3.0.7
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
+PKG_SOURCE_URL:=http://dosfstools.sourcearchive.com/downloads/3.0.7/
+PKG_MD5SUM:=5d4d97c79e8dae60bb08c2fba36c94d6
+PKG_CAT:=zcat
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Compile
+ $(MAKE) -C $(HOST_BUILD_DIR) SHELL="$(BASH)" LDFLAGS="$(HOST_LDFLAGS) $(HOST_STATIC_LINKING)"
+endef
+
+define Host/Install
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/mkdosfs $(STAGING_DIR_HOST)/bin/
+endef
+
+define Host/Clean
+ rm -f $(STAGING_DIR_HOST)/bin/mkdosfs
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/dosfstools/Makefile b/tools/dosfstools/Makefile
new file mode 100644
index 0000000..c582489
--- /dev/null
+++ b/tools/dosfstools/Makefile
@@ -0,0 +1,30 @@
+#
+# Copyright (C) 2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=dosfstools
+PKG_VERSION:=3.0.7
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
+PKG_SOURCE_URL:=http://dosfstools.sourcearchive.com/downloads/3.0.7/
+PKG_MD5SUM:=5d4d97c79e8dae60bb08c2fba36c94d6
+PKG_CAT:=zcat
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Compile
+ $(MAKE) -C $(HOST_BUILD_DIR) SHELL="$(BASH)" LDFLAGS="$(HOST_LDFLAGS) $(HOST_STATIC_LINKING)"
+endef
+
+define Host/Install
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/mkdosfs $(STAGING_DIR_HOST)/bin/
+endef
+
+define Host/Clean
+ rm -f $(STAGING_DIR_HOST)/bin/mkdosfs
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/e2fsprogs/.svn/entries b/tools/e2fsprogs/.svn/entries
new file mode 100644
index 0000000..93a4605
--- /dev/null
+++ b/tools/e2fsprogs/.svn/entries
@@ -0,0 +1,65 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/e2fsprogs
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-07T17:32:29.455175Z
+35900
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+patches
+dir
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+ea94fbb31c7894cd7e693d0676619625
+2013-02-28T00:52:32.083713Z
+35825
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1197
+
diff --git a/tools/e2fsprogs/.svn/text-base/Makefile.svn-base b/tools/e2fsprogs/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..3b02f1a
--- /dev/null
+++ b/tools/e2fsprogs/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2010-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=e2fsprogs
+PKG_VERSION:=1.42.7
+PKG_MD5SUM:=a1ec22ef003688dae9f76c74881b22b9
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/e2fsprogs
+
+HOST_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_CFLAGS += $(FPIC)
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
+
+HOST_CONFIGURE_ARGS += \
+ --disable-shared \
+ --disable-elf-shlibs \
+ --enable-static \
+ --enable-dynamic-e2fsck \
+ --disable-tls \
+ --disable-nls
+
+define Host/Prepare
+ $(call Host/Prepare/Default)
+ rm -rf $(HOST_BUILD_DIR)/doc
+endef
+
+define Host/Install
+ $(Host/Install/Default)
+ $(MAKE) -C $(HOST_BUILD_DIR)/lib/uuid install
+ mkdir -p $(STAGING_DIR_HOST)/include/e2fsprogs
+ $(CP) $(STAGING_DIR_HOST)/include/uuid $(STAGING_DIR_HOST)/include/e2fsprogs/
+ rm -rf $(STAGING_DIR_HOST)/include/uuid
+ $(INSTALL_DATA) $(HOST_BUILD_DIR)/lib/uuid/libuuid.a $(STAGING_DIR_HOST)/lib/
+endef
+
+define Host/Clean
+ rm -f $(STAGING_DIR_HOST)/bin/e2fsck
+ rm -f $(STAGING_DIR_HOST)/bin/tune2fs
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile
new file mode 100644
index 0000000..3b02f1a
--- /dev/null
+++ b/tools/e2fsprogs/Makefile
@@ -0,0 +1,52 @@
+#
+# Copyright (C) 2010-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=e2fsprogs
+PKG_VERSION:=1.42.7
+PKG_MD5SUM:=a1ec22ef003688dae9f76c74881b22b9
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/e2fsprogs
+
+HOST_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/host-build.mk
+
+HOST_CFLAGS += $(FPIC)
+HOST_LDFLAGS += $(HOST_STATIC_LINKING)
+
+HOST_CONFIGURE_ARGS += \
+ --disable-shared \
+ --disable-elf-shlibs \
+ --enable-static \
+ --enable-dynamic-e2fsck \
+ --disable-tls \
+ --disable-nls
+
+define Host/Prepare
+ $(call Host/Prepare/Default)
+ rm -rf $(HOST_BUILD_DIR)/doc
+endef
+
+define Host/Install
+ $(Host/Install/Default)
+ $(MAKE) -C $(HOST_BUILD_DIR)/lib/uuid install
+ mkdir -p $(STAGING_DIR_HOST)/include/e2fsprogs
+ $(CP) $(STAGING_DIR_HOST)/include/uuid $(STAGING_DIR_HOST)/include/e2fsprogs/
+ rm -rf $(STAGING_DIR_HOST)/include/uuid
+ $(INSTALL_DATA) $(HOST_BUILD_DIR)/lib/uuid/libuuid.a $(STAGING_DIR_HOST)/lib/
+endef
+
+define Host/Clean
+ rm -f $(STAGING_DIR_HOST)/bin/e2fsck
+ rm -f $(STAGING_DIR_HOST)/bin/tune2fs
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/e2fsprogs/patches/.svn/entries b/tools/e2fsprogs/patches/.svn/entries
new file mode 100644
index 0000000..5e5ce21
--- /dev/null
+++ b/tools/e2fsprogs/patches/.svn/entries
@@ -0,0 +1,164 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/e2fsprogs/patches
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-07T17:32:29.455175Z
+35900
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+001-exit_0_on_corrected_errors.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+5d54a200b3fb993a7e86df662f0d83e2
+2012-06-09T17:59:57.608158Z
+32142
+luka
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+461
+
+003-openbsd-compat.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+188ffe8df11a85e2c36f6df1e87c6837
+2013-03-07T17:32:29.455175Z
+35900
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+789
+
+004-freebsd-compat.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+43766077b4daa5c4d1c5a7f1dfb5a0a6
+2013-03-07T17:32:29.455175Z
+35900
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+403
+
+002-dont-build-e4defrag.patch
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+05d202b5d9453035a725ef1ec8eee93f
+2012-06-19T09:52:18.310232Z
+32451
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+272
+
diff --git a/tools/e2fsprogs/patches/.svn/text-base/001-exit_0_on_corrected_errors.patch.svn-base b/tools/e2fsprogs/patches/.svn/text-base/001-exit_0_on_corrected_errors.patch.svn-base
new file mode 100644
index 0000000..67a30f6
--- /dev/null
+++ b/tools/e2fsprogs/patches/.svn/text-base/001-exit_0_on_corrected_errors.patch.svn-base
@@ -0,0 +1,11 @@
+--- a/e2fsck/e2fsck.h
++++ b/e2fsck/e2fsck.h
+@@ -73,7 +73,7 @@
+ * Exit codes used by fsck-type programs
+ */
+ #define FSCK_OK 0 /* No errors */
+-#define FSCK_NONDESTRUCT 1 /* File system errors corrected */
++#define FSCK_NONDESTRUCT 0 /* File system errors corrected */
+ #define FSCK_REBOOT 2 /* System should be rebooted */
+ #define FSCK_UNCORRECTED 4 /* File system errors left uncorrected */
+ #define FSCK_ERROR 8 /* Operational error */
diff --git a/tools/e2fsprogs/patches/.svn/text-base/002-dont-build-e4defrag.patch.svn-base b/tools/e2fsprogs/patches/.svn/text-base/002-dont-build-e4defrag.patch.svn-base
new file mode 100644
index 0000000..9f6e7b1
--- /dev/null
+++ b/tools/e2fsprogs/patches/.svn/text-base/002-dont-build-e4defrag.patch.svn-base
@@ -0,0 +1,11 @@
+--- a/misc/Makefile.in
++++ b/misc/Makefile.in
+@@ -11,7 +11,7 @@ INSTALL = @INSTALL@
+
+ @MCONFIG@
+
+-@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_PROG= e4defrag
++@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_PROG=
+ @DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_MAN= e4defrag.8
+
+ @IMAGER_CMT@E2IMAGE_PROG= e2image
diff --git a/tools/e2fsprogs/patches/.svn/text-base/003-openbsd-compat.patch.svn-base b/tools/e2fsprogs/patches/.svn/text-base/003-openbsd-compat.patch.svn-base
new file mode 100644
index 0000000..1f7cdca
--- /dev/null
+++ b/tools/e2fsprogs/patches/.svn/text-base/003-openbsd-compat.patch.svn-base
@@ -0,0 +1,24 @@
+diff -Nur e2fsprogs-1.42.7.orig/lib/blkid/getsize.c e2fsprogs-1.42.7/lib/blkid/getsize.c
+--- e2fsprogs-1.42.7.orig/lib/blkid/getsize.c Fri Nov 30 03:40:18 2012
++++ e2fsprogs-1.42.7/lib/blkid/getsize.c Thu Mar 7 14:21:59 2013
+@@ -26,6 +26,9 @@
+ #include
+ #ifdef HAVE_SYS_IOCTL_H
+ #include
++#ifdef __OpenBSD__
++#include
++#endif
+ #endif
+ #ifdef HAVE_LINUX_FD_H
+ #include
+diff -Nur e2fsprogs-1.42.7.orig/lib/quota/mkquota.c e2fsprogs-1.42.7/lib/quota/mkquota.c
+--- e2fsprogs-1.42.7.orig/lib/quota/mkquota.c Wed Jan 2 01:47:20 2013
++++ e2fsprogs-1.42.7/lib/quota/mkquota.c Thu Mar 7 14:21:59 2013
+@@ -8,6 +8,7 @@
+ #include
+ #include
+ #include
++#include
+ #include
+ #include
+
diff --git a/tools/e2fsprogs/patches/.svn/text-base/004-freebsd-compat.patch.svn-base b/tools/e2fsprogs/patches/.svn/text-base/004-freebsd-compat.patch.svn-base
new file mode 100644
index 0000000..5eff499
--- /dev/null
+++ b/tools/e2fsprogs/patches/.svn/text-base/004-freebsd-compat.patch.svn-base
@@ -0,0 +1,13 @@
+diff -Nur e2fsprogs-1.42.7.orig/lib/ext2fs/tdb.c e2fsprogs-1.42.7/lib/ext2fs/tdb.c
+--- e2fsprogs-1.42.7.orig/lib/ext2fs/tdb.c 2012-07-06 15:37:27.000000000 +0200
++++ e2fsprogs-1.42.7/lib/ext2fs/tdb.c 2013-03-07 14:54:59.000000000 +0100
+@@ -56,7 +56,9 @@
+ #include
+ #endif
+ #include
++#ifndef __FreeBSD__
+ #include
++#endif
+ #include
+
+ #ifdef HAVE_SYS_MMAN_H
diff --git a/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch b/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch
new file mode 100644
index 0000000..67a30f6
--- /dev/null
+++ b/tools/e2fsprogs/patches/001-exit_0_on_corrected_errors.patch
@@ -0,0 +1,11 @@
+--- a/e2fsck/e2fsck.h
++++ b/e2fsck/e2fsck.h
+@@ -73,7 +73,7 @@
+ * Exit codes used by fsck-type programs
+ */
+ #define FSCK_OK 0 /* No errors */
+-#define FSCK_NONDESTRUCT 1 /* File system errors corrected */
++#define FSCK_NONDESTRUCT 0 /* File system errors corrected */
+ #define FSCK_REBOOT 2 /* System should be rebooted */
+ #define FSCK_UNCORRECTED 4 /* File system errors left uncorrected */
+ #define FSCK_ERROR 8 /* Operational error */
diff --git a/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch b/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch
new file mode 100644
index 0000000..9f6e7b1
--- /dev/null
+++ b/tools/e2fsprogs/patches/002-dont-build-e4defrag.patch
@@ -0,0 +1,11 @@
+--- a/misc/Makefile.in
++++ b/misc/Makefile.in
+@@ -11,7 +11,7 @@ INSTALL = @INSTALL@
+
+ @MCONFIG@
+
+-@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_PROG= e4defrag
++@DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_PROG=
+ @DEFRAG_CMT@@LINUX_CMT@E4DEFRAG_MAN= e4defrag.8
+
+ @IMAGER_CMT@E2IMAGE_PROG= e2image
diff --git a/tools/e2fsprogs/patches/003-openbsd-compat.patch b/tools/e2fsprogs/patches/003-openbsd-compat.patch
new file mode 100644
index 0000000..1f7cdca
--- /dev/null
+++ b/tools/e2fsprogs/patches/003-openbsd-compat.patch
@@ -0,0 +1,24 @@
+diff -Nur e2fsprogs-1.42.7.orig/lib/blkid/getsize.c e2fsprogs-1.42.7/lib/blkid/getsize.c
+--- e2fsprogs-1.42.7.orig/lib/blkid/getsize.c Fri Nov 30 03:40:18 2012
++++ e2fsprogs-1.42.7/lib/blkid/getsize.c Thu Mar 7 14:21:59 2013
+@@ -26,6 +26,9 @@
+ #include
+ #ifdef HAVE_SYS_IOCTL_H
+ #include
++#ifdef __OpenBSD__
++#include
++#endif
+ #endif
+ #ifdef HAVE_LINUX_FD_H
+ #include
+diff -Nur e2fsprogs-1.42.7.orig/lib/quota/mkquota.c e2fsprogs-1.42.7/lib/quota/mkquota.c
+--- e2fsprogs-1.42.7.orig/lib/quota/mkquota.c Wed Jan 2 01:47:20 2013
++++ e2fsprogs-1.42.7/lib/quota/mkquota.c Thu Mar 7 14:21:59 2013
+@@ -8,6 +8,7 @@
+ #include
+ #include
+ #include
++#include
+ #include
+ #include
+
diff --git a/tools/e2fsprogs/patches/004-freebsd-compat.patch b/tools/e2fsprogs/patches/004-freebsd-compat.patch
new file mode 100644
index 0000000..5eff499
--- /dev/null
+++ b/tools/e2fsprogs/patches/004-freebsd-compat.patch
@@ -0,0 +1,13 @@
+diff -Nur e2fsprogs-1.42.7.orig/lib/ext2fs/tdb.c e2fsprogs-1.42.7/lib/ext2fs/tdb.c
+--- e2fsprogs-1.42.7.orig/lib/ext2fs/tdb.c 2012-07-06 15:37:27.000000000 +0200
++++ e2fsprogs-1.42.7/lib/ext2fs/tdb.c 2013-03-07 14:54:59.000000000 +0100
+@@ -56,7 +56,9 @@
+ #include
+ #endif
+ #include
++#ifndef __FreeBSD__
+ #include
++#endif
+ #include
+
+ #ifdef HAVE_SYS_MMAN_H
diff --git a/tools/firmware-utils/.svn/entries b/tools/firmware-utils/.svn/entries
new file mode 100644
index 0000000..fe8bcd4
--- /dev/null
+++ b/tools/firmware-utils/.svn/entries
@@ -0,0 +1,65 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/firmware-utils
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-11T15:55:23.989487Z
+35963
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+src
+dir
+
+Makefile
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+5f3a7d723df67996fe8336ca854ad5f5
+2012-10-18T07:23:09.045743Z
+33848
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1769
+
diff --git a/tools/firmware-utils/.svn/prop-base/Makefile.svn-base b/tools/firmware-utils/.svn/prop-base/Makefile.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/.svn/prop-base/Makefile.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/.svn/text-base/Makefile.svn-base b/tools/firmware-utils/.svn/text-base/Makefile.svn-base
new file mode 100644
index 0000000..3fdf2d0
--- /dev/null
+++ b/tools/firmware-utils/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,71 @@
+#
+# Copyright (C) 2006-2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME := firmware-utils
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+define cc
+ $(HOSTCC) $(HOST_CFLAGS) -include endian.h $(HOST_STATIC_LINKING) -o $(HOST_BUILD_DIR)/bin/$(firstword $(1)) $(foreach src,$(1),src/$(src).c) $(2)
+endef
+
+define Host/Compile
+ mkdir -p $(HOST_BUILD_DIR)/bin
+ $(call cc,addpattern)
+ $(call cc,trx)
+ $(call cc,motorola-bin)
+ $(call cc,dgfirmware)
+ $(call cc,mkdir615h1 md5)
+ $(call cc,trx2usr)
+ $(call cc,ptgen)
+ $(call cc,airlink)
+ $(call cc,srec2bin)
+ $(call cc,mkmylofw)
+ $(call cc,mkcsysimg)
+ $(call cc,mkzynfw)
+ $(call cc,lzma2eva,-lz)
+ $(call cc,mkcasfw)
+ $(call cc,mkfwimage,-lz)
+ $(call cc,mkfwimage2,-lz)
+ $(call cc,imagetag imagetag_cmdline)
+ $(call cc,add_header)
+ $(call cc,makeamitbin)
+ $(call cc,encode_crc)
+ $(call cc,nand_ecc)
+ $(call cc,mkplanexfw sha1)
+ $(call cc,mktplinkfw md5)
+ $(call cc,pc1crypt)
+ $(call cc,osbridge-crc)
+ $(call cc,wrt400n cyg_crc32)
+ $(call cc,wndr3700)
+ $(call cc,mkdniimg)
+ $(call cc,mktitanimg)
+ $(call cc,mkchkimg)
+ $(call cc,mkzcfw cyg_crc32)
+ $(call cc,spw303v)
+ $(call cc,trx2edips)
+ $(call cc,xorimage)
+ $(call cc,buffalo-enc buffalo-lib, -Wall)
+ $(call cc,buffalo-tag buffalo-lib, -Wall)
+ $(call cc,buffalo-tftp buffalo-lib, -Wall)
+ $(call cc,mkwrgimg md5, -Wall)
+ $(call cc,mkedimaximg)
+ $(call cc,mkbrncmdline)
+ $(call cc,mkbrnimg)
+ $(call cc,mkdapimg)
+ $(call cc, mkcameofw, -Wall)
+ $(call cc,seama md5)
+ $(call cc,fix-u-media-header cyg_crc32,-Wall)
+endef
+
+define Host/Install
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/* $(STAGING_DIR_HOST)/bin/
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
new file mode 100644
index 0000000..3fdf2d0
--- /dev/null
+++ b/tools/firmware-utils/Makefile
@@ -0,0 +1,71 @@
+#
+# Copyright (C) 2006-2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME := firmware-utils
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+define cc
+ $(HOSTCC) $(HOST_CFLAGS) -include endian.h $(HOST_STATIC_LINKING) -o $(HOST_BUILD_DIR)/bin/$(firstword $(1)) $(foreach src,$(1),src/$(src).c) $(2)
+endef
+
+define Host/Compile
+ mkdir -p $(HOST_BUILD_DIR)/bin
+ $(call cc,addpattern)
+ $(call cc,trx)
+ $(call cc,motorola-bin)
+ $(call cc,dgfirmware)
+ $(call cc,mkdir615h1 md5)
+ $(call cc,trx2usr)
+ $(call cc,ptgen)
+ $(call cc,airlink)
+ $(call cc,srec2bin)
+ $(call cc,mkmylofw)
+ $(call cc,mkcsysimg)
+ $(call cc,mkzynfw)
+ $(call cc,lzma2eva,-lz)
+ $(call cc,mkcasfw)
+ $(call cc,mkfwimage,-lz)
+ $(call cc,mkfwimage2,-lz)
+ $(call cc,imagetag imagetag_cmdline)
+ $(call cc,add_header)
+ $(call cc,makeamitbin)
+ $(call cc,encode_crc)
+ $(call cc,nand_ecc)
+ $(call cc,mkplanexfw sha1)
+ $(call cc,mktplinkfw md5)
+ $(call cc,pc1crypt)
+ $(call cc,osbridge-crc)
+ $(call cc,wrt400n cyg_crc32)
+ $(call cc,wndr3700)
+ $(call cc,mkdniimg)
+ $(call cc,mktitanimg)
+ $(call cc,mkchkimg)
+ $(call cc,mkzcfw cyg_crc32)
+ $(call cc,spw303v)
+ $(call cc,trx2edips)
+ $(call cc,xorimage)
+ $(call cc,buffalo-enc buffalo-lib, -Wall)
+ $(call cc,buffalo-tag buffalo-lib, -Wall)
+ $(call cc,buffalo-tftp buffalo-lib, -Wall)
+ $(call cc,mkwrgimg md5, -Wall)
+ $(call cc,mkedimaximg)
+ $(call cc,mkbrncmdline)
+ $(call cc,mkbrnimg)
+ $(call cc,mkdapimg)
+ $(call cc, mkcameofw, -Wall)
+ $(call cc,seama md5)
+ $(call cc,fix-u-media-header cyg_crc32,-Wall)
+endef
+
+define Host/Install
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/* $(STAGING_DIR_HOST)/bin/
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/firmware-utils/src/.svn/entries b/tools/firmware-utils/src/.svn/entries
new file mode 100644
index 0000000..486f659
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/entries
@@ -0,0 +1,2204 @@
+10
+
+dir
+36060
+svn://svn.openwrt.org/openwrt/trunk/tools/firmware-utils/src
+svn://svn.openwrt.org/openwrt
+
+
+
+2013-03-11T15:55:23.989487Z
+35963
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3c298f89-4303-0410-b956-a3cf2f4a3e73
+
+mkdniimg.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+9be67e2f75ba394515c2607cc4701fa8
+2011-05-31T22:53:24.142663Z
+27052
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3916
+
+bcm_tag.h
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+230e8fc0c3b6d393dc40625e2a3c3079
+2012-10-08T09:59:50.127940Z
+33655
+jogo
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4273
+
+motorola-bin.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+2e6b8a84063c4ebb9e44ea5db6991c06
+2009-04-17T14:32:29.989894Z
+15245
+nico
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5852
+
+mkmylofw.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+293abba2a3373bd92026242a31b308c5
+2012-01-26T17:01:43.612170Z
+29913
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+26750
+
+mkfwimage.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+4fd705851aa066523cd8af58959257f5
+2012-02-18T14:45:54.073753Z
+30627
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+11568
+
+srec2bin.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+b292ab118cacf19d4a305902edad6797
+2007-03-18T13:06:33.575137Z
+6602
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+11685
+
+imagetag_cmdline.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+3023f5eec644002d015271724be9c411
+2012-05-27T13:22:19.592672Z
+31875
+jogo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+41872
+
+imagetag.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+95c2e8ee7b9016f81499bebf17814382
+2012-05-27T13:22:19.592672Z
+31875
+jogo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+18696
+
+imagetag_cmdline.h
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+4f55060935d5951e2efa1fadb5ac7b9b
+2012-05-27T13:22:19.592672Z
+31875
+jogo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+16399
+
+myloader.h
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+087cffea05fbb0eb029c73a4298ac684
+2012-01-26T17:01:43.612170Z
+29913
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5285
+
+buffalo-enc.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+4b73855fdece011e8bb96824c68d4192
+2011-06-13T08:12:41.593111Z
+27167
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5594
+
+makeamitbin.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+eafbccc91880502350cfecd9663d504e
+2008-10-28T16:26:42.182730Z
+13056
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7682
+
+wndr3700.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+6957f6ecf19c47b8aae226c9f54b1eb0
+2011-01-14T10:37:04.041244Z
+24980
+juhosg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3712
+
+md5.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+8ded3bdcaa9215dd314d9481406ee582
+2009-04-17T14:32:29.989894Z
+15245
+nico
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+11560
+
+zynos.h
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+d496b84ddf04cc5c94ecc738c066a693
+2010-05-14T09:20:36.774067Z
+21446
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7347
+
+buffalo-tftp.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+4d0df90ef5963929e4ecbeea03eee366
+2011-07-06T08:04:53.081037Z
+27475
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3181
+
+mkdapimg.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+4e569e8188b7548d3348037087a2d858
+2012-07-24T20:38:49.434040Z
+32822
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4323
+
+airlink.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+fd56d063831da3c7a6b2f28233b62e85
+2010-03-18T23:35:12.760353Z
+20293
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10749
+
+md5.h
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+676ced93ad98472b30903e9049b7ef20
+2009-04-17T14:32:29.989894Z
+15245
+nico
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3120
+
+mkzynfw.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+c9bcb6d65e9afb8a65e1ca66b88a1cb8
+2010-12-17T20:34:31.684059Z
+24653
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+22765
+
+mkcsysimg.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+07101110224ea4265208ca14945f1668
+2013-01-06T11:11:30.369645Z
+35019
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+21817
+
+xorimage.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+13f1e59cb8985ecd78a2cf8328c2f7d9
+2011-05-11T13:34:05.101847Z
+26877
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2834
+
+mkplanexfw.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+d92848438f64e177ad3faa1ffeb7553c
+2010-04-26T18:28:07.594314Z
+21174
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4970
+
+cyg_crc32.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+2005e143bb82ddc198ca4e919a800aee
+2009-07-12T08:59:18.519561Z
+16792
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7963
+
+cyg_crc.h
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+ba9d1cf06e7d26d19e67fff283506d18
+2009-07-12T08:59:18.519561Z
+16792
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3372
+
+fw.h
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+83657ca05dc2f9ad969c828fc75a4cfa
+2008-05-07T23:47:17.785718Z
+11061
+thepeople
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2004
+
+csysimg.h
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+2b302846fb91a62a7e2c5fe5a40217f0
+2013-01-06T11:11:30.369645Z
+35019
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2290
+
+encode_crc.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+abb090495cf833d1be139d0765d75bbe
+2010-04-12T17:08:57.277563Z
+20831
+nico
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3662
+
+mktplinkfw.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+f76742ecbd68d4309895f10f53838f8f
+2013-03-11T15:55:23.989487Z
+35963
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+24544
+
+buffalo-tag.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+1f36e174693eb97937cbcebba7d5659d
+2011-07-06T08:04:50.915820Z
+27473
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7600
+
+mkfwimage2.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+7c924de82383516b1f5192637b134b8d
+2012-12-17T12:28:15.005804Z
+34729
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10467
+
+nand_ecc.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+0b2f68c0b1ddd19c634dc25e6e4e4531
+2010-05-16T00:20:17.368392Z
+21462
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6127
+
+mkcasfw.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+cbe69fd52cce836f502fa1c5df75fb47
+2009-04-17T14:32:29.989894Z
+15245
+nico
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+19685
+
+sha1.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+951c83ba81b5ada9d8b7f42af6adeca4
+2009-04-17T14:32:29.989894Z
+15245
+nico
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+11110
+
+mkzcfw.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+d5bd3e093d2cef34abbbf00292c17bf7
+2010-09-04T05:40:56.594016Z
+22885
+mb
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7909
+
+sha1.h
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+d610be93a23cb88208b76ccd7ffa32db
+2009-04-17T14:32:29.989894Z
+15245
+nico
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+954
+
+osbridge-crc.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+777b93683baea481747a08f52c89c781
+2009-06-25T09:41:06.560503Z
+16557
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10845
+
+mktitanimg.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+07fbe7055bb80b6530f928eff7457cea
+2010-06-12T18:10:01.393607Z
+21767
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+31678
+
+mkbrncmdline.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+6de482d772a0298b9ea4c31248917748
+2012-02-14T17:48:04.445045Z
+30532
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4269
+
+imagetag.ggo
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+ece08f2d043589f29cf4401b06082573
+2012-05-27T13:22:19.592672Z
+31875
+jogo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3443
+
+mktitanimg.h
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+6e77c39669a59dc8f742f9c41097cc26
+2010-06-06T19:16:43.383336Z
+21689
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6282
+
+ptgen.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+a7ca09508be28db656655578f51b7bdd
+2012-08-22T09:22:38.050080Z
+33218
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5525
+
+lzma2eva.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+4005dd4c86e126af24e2f6c2f6ccc3e2
+2010-03-26T10:12:30.581568Z
+20437
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5132
+
+seama.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+15a1e378dc8e9631684af99ab18aaa80
+2012-10-18T07:22:57.923093Z
+33840
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+13459
+
+dgfirmware.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+246b8ef9de2c593d2efd46605493c646
+2006-02-12T06:00:38.994438Z
+3221
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7512
+
+trx2usr.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+4b894f6064c177423d7657a532977902
+2006-11-01T13:24:20.015293Z
+5373
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6167
+
+mkchkimg.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+1633daf970f1c68ee18700c976e1a670
+2010-08-06T20:21:32.963359Z
+22516
+hauke
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8345
+
+mkdir615h1.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+3d5a0540b20bd886685cae78c0abea28
+2012-08-17T17:56:02.633135Z
+33204
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+9447
+
+fix-u-media-header.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+1b186d8330846cdf1de03328d8b03f8b
+2012-10-18T07:23:09.045743Z
+33848
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7031
+
+seama.h
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+1278414a8f362044fa97fa59c2483ca4
+2012-10-18T07:22:57.923093Z
+33840
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3804
+
+add_header.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+c8d8b97595a4897ed128b03a33506faa
+2008-09-23T16:12:40.861696Z
+12667
+nbd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3524
+
+pc1crypt.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+6852f6e1165d2b70043e8c514118aa6a
+2009-06-24T16:35:38.319131Z
+16550
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7060
+
+mkbrnimg.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+183f4ce82810f736b33ea7ac129aa5e2
+2012-02-14T17:48:04.445045Z
+30532
+blogic
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4579
+
+mkcameofw.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+d7ddcf4e1278a5791af3dc2dbbcf4eb8
+2012-08-22T20:15:34.277056Z
+33233
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+7915
+
+trx.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+5ad83fc161aa3b56b6d18d7a0e506566
+2010-07-30T21:19:49.485839Z
+22418
+hauke
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+15237
+
+wrt400n.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+94b69002cdc48358e2d01ad5b3b55daa
+2009-07-12T08:59:18.519561Z
+16792
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+9879
+
+cyg_crc16.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+243df536d892b28f5547929c3b01555c
+2009-07-12T08:59:18.519561Z
+16792
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4955
+
+buffalo-lib.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+6e199be87f8c6279e647284a91e17fc7
+2011-06-13T08:12:41.593111Z
+27167
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+10360
+
+mkwrgimg.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+1a6d2ce50e959ab479f5d2e390e9f599
+2011-07-08T05:20:24.536521Z
+27553
+nbd
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4718
+
+trx2edips.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+06013ce28dfb411bf60b32967b74819e
+2011-06-21T21:13:58.991147Z
+27255
+hauke
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6283
+
+spw303v.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+221126a23ee4095566869148c2d54a83
+2011-05-11T13:34:05.101847Z
+26877
+florian
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+9367
+
+addpattern.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+bc8eab896b68b2f013fa14d46cd6eee6
+2010-07-01T10:40:22.392133Z
+22012
+markus
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8365
+
+buffalo-lib.h
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+10937b95bac5f5d5c91af1a8af938885
+2011-07-06T08:04:50.915820Z
+27473
+juhosg
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3355
+
+mkedimaximg.c
+file
+
+
+
+
+2013-03-17T12:13:22.000000Z
+92dbcfc9e88027ec1a4eb488722f9107
+2011-10-30T22:57:41.419536Z
+28688
+acinonyx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5870
+
diff --git a/tools/firmware-utils/src/.svn/prop-base/addpattern.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/addpattern.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/addpattern.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/bcm_tag.h.svn-base b/tools/firmware-utils/src/.svn/prop-base/bcm_tag.h.svn-base
new file mode 100644
index 0000000..3160658
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/bcm_tag.h.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:mergeinfo
+V 0
+
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/buffalo-enc.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/buffalo-enc.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/buffalo-enc.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/buffalo-lib.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/buffalo-lib.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/buffalo-lib.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/buffalo-lib.h.svn-base b/tools/firmware-utils/src/.svn/prop-base/buffalo-lib.h.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/buffalo-lib.h.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/buffalo-tag.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/buffalo-tag.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/buffalo-tag.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/buffalo-tftp.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/buffalo-tftp.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/buffalo-tftp.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/cyg_crc.h.svn-base b/tools/firmware-utils/src/.svn/prop-base/cyg_crc.h.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/cyg_crc.h.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/cyg_crc16.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/cyg_crc16.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/cyg_crc16.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/cyg_crc32.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/cyg_crc32.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/cyg_crc32.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/fix-u-media-header.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/fix-u-media-header.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/fix-u-media-header.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/md5.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/md5.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/md5.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/md5.h.svn-base b/tools/firmware-utils/src/.svn/prop-base/md5.h.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/md5.h.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/mkcameofw.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/mkcameofw.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/mkcameofw.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/mkcasfw.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/mkcasfw.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/mkcasfw.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/mkdir615h1.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/mkdir615h1.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/mkdir615h1.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/mkfwimage2.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/mkfwimage2.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/mkfwimage2.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/mkplanexfw.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/mkplanexfw.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/mkplanexfw.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/mktplinkfw.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/mktplinkfw.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/mktplinkfw.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/mkwrgimg.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/mkwrgimg.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/mkwrgimg.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/mkzcfw.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/mkzcfw.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/mkzcfw.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/mkzynfw.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/mkzynfw.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/mkzynfw.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/motorola-bin.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/motorola-bin.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/motorola-bin.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/osbridge-crc.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/osbridge-crc.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/osbridge-crc.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/pc1crypt.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/pc1crypt.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/pc1crypt.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/seama.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/seama.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/seama.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/seama.h.svn-base b/tools/firmware-utils/src/.svn/prop-base/seama.h.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/seama.h.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/sha1.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/sha1.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/sha1.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/sha1.h.svn-base b/tools/firmware-utils/src/.svn/prop-base/sha1.h.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/sha1.h.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/trx.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/trx.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/trx.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/wrt400n.c.svn-base b/tools/firmware-utils/src/.svn/prop-base/wrt400n.c.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/wrt400n.c.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/prop-base/zynos.h.svn-base b/tools/firmware-utils/src/.svn/prop-base/zynos.h.svn-base
new file mode 100644
index 0000000..bdbd305
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/prop-base/zynos.h.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff --git a/tools/firmware-utils/src/.svn/text-base/add_header.c.svn-base b/tools/firmware-utils/src/.svn/text-base/add_header.c.svn-base
new file mode 100644
index 0000000..37775c3
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/add_header.c.svn-base
@@ -0,0 +1,138 @@
+/*
+ * add_header.c - partially based on OpenWrt's motorola-bin.c
+ *
+ * Copyright (C) 2008 Imre Kaloz
+ * Gabor Juhos
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * The add_header utility used by various vendors preprends the buf
+ * image with a header containing a CRC32 value which is generated for the
+ * model id + reserved space for CRC32 + buf, then replaces the reserved
+ * area with the actual CRC32. This replacement tool mimics this behavior.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define BPB 8 /* bits/byte */
+
+static uint32_t crc32[1<> 1)) : (crc >> 1);
+ crc32[n] = crc;
+ }
+}
+
+static uint32_t crc32buf(unsigned char *buf, size_t len)
+{
+ uint32_t crc = 0xFFFFFFFF;
+
+ for (; len; len--, buf++)
+ crc = crc32[(uint8_t)crc ^ *buf] ^ (crc >> BPB);
+ return ~crc;
+}
+
+struct header {
+ unsigned char model[16];
+ uint32_t crc;
+};
+
+static void usage(const char *) __attribute__ (( __noreturn__ ));
+
+static void usage(const char *mess)
+{
+ fprintf(stderr, "Error: %s\n", mess);
+ fprintf(stderr, "Usage: add_header model_id input_file output_file\n");
+ fprintf(stderr, "\n");
+ exit(1);
+}
+
+int main(int argc, char **argv)
+{
+ off_t len; // of original buf
+ off_t buflen; // of the output file
+ int fd;
+ void *input_file; // pointer to the input file (mmmapped)
+ struct header header;
+ unsigned char *buf; // pointer to prefix + copy of original buf
+
+ // verify parameters
+
+ if (argc != 4)
+ usage("wrong number of arguments");
+
+ // mmap input_file
+ if ((fd = open(argv[2], O_RDONLY)) < 0
+ || (len = lseek(fd, 0, SEEK_END)) < 0
+ || (input_file = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0)) == (void *) (-1)
+ || close(fd) < 0)
+ {
+ fprintf(stderr, "Error loading file %s: %s\n", argv[2], strerror(errno));
+ exit(1);
+ }
+
+ buflen = len + sizeof(header);
+
+ init_crc32();
+
+ // copy model name into header
+ strncpy(header.model, argv[1], sizeof(header.model));
+ header.crc = 0;
+
+ // create a firmware image in memory and copy the input_file to it
+ buf = malloc(buflen);
+ memcpy(buf, &header, sizeof(header));
+ memcpy(&buf[sizeof(header)], input_file, len);
+
+ // CRC of temporary header + buf
+ header.crc = htonl(crc32buf(buf, buflen));
+
+ memcpy(buf, &header, sizeof(header));
+
+ // write the buf
+ if ((fd = open(argv[3], O_CREAT|O_WRONLY|O_TRUNC,0644)) < 0
+ || write(fd, buf, buflen) != buflen
+ || close(fd) < 0)
+ {
+ fprintf(stderr, "Error storing file %s: %s\n", argv[3], strerror(errno));
+ exit(2);
+ }
+
+ free(buf);
+
+ munmap(input_file,len);
+
+ return 0;
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/addpattern.c.svn-base b/tools/firmware-utils/src/.svn/text-base/addpattern.c.svn-base
new file mode 100644
index 0000000..da6797c
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/addpattern.c.svn-base
@@ -0,0 +1,325 @@
+/*
+ * Copyright (C) 2004 Manuel Novoa III
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* July 29, 2004
+ *
+ * This is a hacked replacement for the 'addpattern' utility used to
+ * create wrt54g .bin firmware files. It isn't pretty, but it does
+ * the job for me.
+ *
+ * Extensions:
+ * -v allows setting the version string on the command line.
+ * -{0|1} sets the (currently ignored) hw_ver flag in the header
+ * to 0 or 1 respectively.
+ */
+
+/* January 12, 2005
+ *
+ * Modified by rodent at rodent dot za dot net
+ * Support added for the new WRT54G v2.2 and WRT54GS v1.1 "flags"
+ * Without the flags set to 0x7, the above units will refuse to flash.
+ *
+ * Extensions:
+ * -{0|1|2} sets {0|1} sets hw_ver flag to 0/1. {2} sets hw_ver to 1
+ * and adds the new hardware "flags" for the v2.2/v1.1 units
+*/
+
+/* January 1, 2007
+ *
+ * Modified by juan.i.gonzalez at subdown dot net
+ * Support added for the AG241v2 and similar
+ *
+ * Extensions:
+ * -r #.# adds revision hardware flags. AG241v2 and similar.
+ *
+ * AG241V2 firmware sets the hw_ver to 0x44.
+ *
+ * Example: -r 2.0
+ *
+ * Convert 2.0 to 20 to be an integer, and add 0x30 to skip special ASCII
+ * #define HW_Version ((HW_REV * 10) + 0x30) -> from cyutils.h
+*/
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+/**********************************************************************/
+
+#define CODE_ID "U2ND" /* from code_pattern.h */
+#define CODE_PATTERN "W54S" /* from code_pattern.h */
+#define PBOT_PATTERN "PBOT"
+
+#define CYBERTAN_VERSION "v3.37.2" /* from cyutils.h */
+
+/* WRT54G v2.2 and WRT54GS v1.1 "flags" (from 3.37.32 firmware cyutils.h) */
+#define SUPPORT_4712_CHIP 0x0001
+#define SUPPORT_INTEL_FLASH 0x0002
+#define SUPPORT_5325E_SWITCH 0x0004
+/* (from 3.00.24 firmware cyutils.h) */
+#define SUPPORT_4704_CHIP 0x0008
+#define SUPPORT_5352E_CHIP 0x0010
+
+struct code_header { /* from cyutils.h */
+ char magic[4];
+ char res1[4]; /* for extra magic */
+ char fwdate[3];
+ char fwvern[3];
+ char id[4]; /* U2ND */
+ char hw_ver; /* 0: for 4702, 1: for 4712 -- new in 2.04.3 */
+
+ unsigned char sn; // Serial Number
+ unsigned char flags[2]; /* SUPPORT_ flags new for 3.37.2 (WRT54G v2.2 and WRT54GS v1.1) */
+ unsigned char stable[2]; // The image is stable (for dual image)
+ unsigned char try1[2]; // Try to boot image first time (for dual image)
+ unsigned char try2[2]; // Try to boot image second time (for dual image)
+ unsigned char try3[2]; // Try to boot image third time (for dual_image)
+ unsigned char res3[2];
+} ;
+
+struct board_info {
+ char *id;
+ char *pattern;
+ char hw_ver;
+ char sn;
+ char flags[2];
+};
+
+struct board_info boards[] = {
+ {
+ .id = "WRT160NL",
+ .pattern = "NL16",
+ .hw_ver = 0x00,
+ .sn = 0x0f,
+ .flags = {0x3f, 0x00},
+ }, {
+ /* Terminating entry */
+ .id = NULL,
+ }
+};
+
+/**********************************************************************/
+
+void usage(void) __attribute__ (( __noreturn__ ));
+
+void usage(void)
+{
+ fprintf(stderr, "Usage: addpattern [-i trxfile] [-o binfile] [-B board_id] [-p pattern] [-s serial] [-g] [-b] [-v v#.#.#] [-r #.#] [-{0|1|2|4|5}] -h\n");
+ exit(EXIT_FAILURE);
+}
+
+struct board_info *find_board(char *id)
+{
+ struct board_info *board;
+
+ for (board = boards; board->id != NULL; board++)
+ if (strcasecmp(id, board->id) == 0)
+ return board;
+
+ return NULL;
+}
+
+int main(int argc, char **argv)
+{
+ char buf[1024]; /* keep this at 1k or adjust garbage calc below */
+ struct code_header *hdr;
+ FILE *in = stdin;
+ FILE *out = stdout;
+ char *ifn = NULL;
+ char *ofn = NULL;
+ char *pattern = CODE_PATTERN;
+ char *pbotpat = PBOT_PATTERN;
+ char *version = CYBERTAN_VERSION;
+ char *board_id = NULL;
+ struct board_info *board = NULL;
+ int gflag = 0;
+ int pbotflag = 0;
+ int c;
+ int v0, v1, v2;
+ size_t off, n;
+ time_t t;
+ struct tm *ptm;
+
+ fprintf(stderr, "mjn3's addpattern replacement - v0.81\n");
+
+ hdr = (struct code_header *) buf;
+ memset(hdr, 0, sizeof(struct code_header));
+
+ while ((c = getopt(argc, argv, "i:o:p:s:gbv:01245hr:B:")) != -1) {
+ switch (c) {
+ case 'i':
+ ifn = optarg;
+ break;
+ case 'o':
+ ofn = optarg;
+ break;
+ case 'p':
+ pattern = optarg;
+ break;
+ case 's':
+ hdr->sn = (unsigned char) atoi (optarg);
+ break;
+ case 'g':
+ gflag = 1;
+ break;
+ case 'b':
+ pbotflag = 1;
+ break;
+ case 'v': /* extension to allow setting version */
+ version = optarg;
+ break;
+ case '0':
+ hdr->hw_ver = 0;
+ break;
+ case '1':
+ hdr->hw_ver = 1;
+ break;
+ case '2': /* new 54G v2.2 and 54GS v1.1 flags */
+ hdr->hw_ver = 1;
+ hdr->flags[0] |= SUPPORT_4712_CHIP;
+ hdr->flags[0] |= SUPPORT_INTEL_FLASH;
+ hdr->flags[0] |= SUPPORT_5325E_SWITCH;
+ break;
+ case '4':
+ /* V4 firmware sets the flags to 0x1f */
+ hdr->hw_ver = 0;
+ hdr->flags[0] = 0x1f;
+ break;
+ case '5':
+ /* V5 is appended to trxV2 image */
+ hdr->stable[0] = 0x73; // force image to be stable
+ hdr->stable[1] = 0x00;
+ hdr->try1[0] = 0x74; // force try1 to be set
+ hdr->try1[1] = 0x00;
+ hdr->try2[0] = hdr->try2[1] = 0xFF;
+ hdr->try3[0] = hdr->try3[1] = 0xFF;
+ break;
+ case 'r':
+ hdr->hw_ver = (char)(atof(optarg)*10)+0x30;
+ break;
+ case 'B':
+ board_id = optarg;
+ break;
+
+ case 'h':
+ default:
+ usage();
+ }
+ }
+
+ if (optind != argc || optind == 1) {
+ fprintf(stderr, "illegal arg \"%s\"\n", argv[optind]);
+ usage();
+ }
+
+ if (board_id) {
+ board = find_board(board_id);
+ if (board == NULL) {
+ fprintf(stderr, "unknown board \"%s\"\n", board_id);
+ usage();
+ }
+ pattern = board->pattern;
+ hdr->hw_ver = board->hw_ver;
+ hdr->sn = board->sn;
+ hdr->flags[0] = board->flags[0];
+ hdr->flags[1] = board->flags[1];
+ }
+
+ if (strlen(pattern) != 4) {
+ fprintf(stderr, "illegal pattern \"%s\": length != 4\n", pattern);
+ usage();
+ }
+
+ if (ifn && !(in = fopen(ifn, "r"))) {
+ fprintf(stderr, "can not open \"%s\" for reading\n", ifn);
+ usage();
+ }
+
+ if (ofn && !(out = fopen(ofn, "w"))) {
+ fprintf(stderr, "can not open \"%s\" for writing\n", ofn);
+ usage();
+ }
+
+ if (time(&t) == (time_t)(-1)) {
+ fprintf(stderr, "time call failed\n");
+ return EXIT_FAILURE;
+ }
+
+ ptm = localtime(&t);
+
+ if (3 != sscanf(version, "v%d.%d.%d", &v0, &v1, &v2)) {
+ fprintf(stderr, "bad version string \"%s\"\n", version);
+ return EXIT_FAILURE;
+ }
+
+ memcpy(&hdr->magic, pattern, 4);
+ if (pbotflag)
+ memcpy(&hdr->res1, pbotpat, 4);
+ hdr->fwdate[0] = ptm->tm_year % 100;
+ hdr->fwdate[1] = ptm->tm_mon + 1;
+ hdr->fwdate[2] = ptm->tm_mday;
+ hdr->fwvern[0] = v0;
+ hdr->fwvern[1] = v1;
+ hdr->fwvern[2] = v2;
+ memcpy(&hdr->id, CODE_ID, strlen(CODE_ID));
+
+ off = sizeof(struct code_header);
+
+ fprintf(stderr, "writing firmware v%d.%d.%d on %d/%d/%d (y/m/d)\n",
+ v0, v1, v2,
+ hdr->fwdate[0], hdr->fwdate[1], hdr->fwdate[2]);
+
+
+ while ((n = fread(buf + off, 1, sizeof(buf)-off, in) + off) > 0) {
+ off = 0;
+ if (n < sizeof(buf)) {
+ if (ferror(in)) {
+ FREAD_ERROR:
+ fprintf(stderr, "fread error\n");
+ return EXIT_FAILURE;
+ }
+ if (gflag) {
+ gflag = sizeof(buf) - n;
+ memset(buf + n, 0xff, gflag);
+ fprintf(stderr, "adding %d bytes of garbage\n", gflag);
+ n = sizeof(buf);
+ }
+ }
+ if (!fwrite(buf, n, 1, out)) {
+ FWRITE_ERROR:
+ fprintf(stderr, "fwrite error\n");
+ return EXIT_FAILURE;
+ }
+ }
+
+ if (ferror(in)) {
+ goto FREAD_ERROR;
+ }
+
+ if (fflush(out)) {
+ goto FWRITE_ERROR;
+ }
+
+ fclose(in);
+ fclose(out);
+
+ return EXIT_SUCCESS;
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/airlink.c.svn-base b/tools/firmware-utils/src/.svn/text-base/airlink.c.svn-base
new file mode 100644
index 0000000..560a58d
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/airlink.c.svn-base
@@ -0,0 +1,332 @@
+/*
+ * Thanks to Vassily Galinsky for this tool
+*****************************************************************************
+AIRLINK AR525W firmware image structure
+ -8:-5 Extended (httpd) header checksum - sum2
+ -4:-1 Extended (httpd) header magic - "ARRN" - 0x4e525241
+ 0: 3 Standard (tftpd) header magic - "GMTK" - 0x4b544d47
+ 4: 7 Standard (tftpd) header checksum - sum1
+ 8: b 0
+ c: f Size of compressed linux kernel
+ 10:13 Size of firmware image file with standard header
+ 14:17 Product code - 0x5
+ 18:1b Bootloader checksum - sum0
+ 1c:1f 0
+ 20: Compressed linux kernel
+ - Squashfs or jffs2 file system - kernel dependent - either 32 bytes or sector aligned
+*****************************************************************************/
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+typedef unsigned char uchar;
+
+uint32_t crctab[257] = {
+ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
+ 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
+ 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
+ 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
+ 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
+ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
+ 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
+ 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
+ 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
+ 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
+ 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
+ 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
+ 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
+ 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
+ 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
+ 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
+ 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
+ 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
+ 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
+ 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
+ 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
+ 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
+ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
+ 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
+ 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
+ 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
+ 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
+ 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
+ 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
+ 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
+ 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
+ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
+ 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
+ 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
+ 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
+ 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
+ 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
+ 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
+ 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
+ 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
+ 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
+ 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
+ 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
+ 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
+ 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
+ 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
+ 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
+ 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
+ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
+ 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
+ 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
+ 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
+ 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
+ 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
+ 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
+ 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,
+ 0
+};
+
+uint32_t header[] = {
+ 0x00000000, 0x4e525241,
+ 0x4b544d47, 0x00000000, 0x00000000, 0x000afd4a,
+ 0x00000000, 0x00000005, 0x00000000, 0x00000000
+};
+
+static int JFFS2 = 0;
+
+int generate_image(char *kname, char *fsname, char *fname, int EHDR)
+{
+ int i;
+ uint32_t lenk, lens;
+ uchar *bk, *bs;
+ int fkd, ffd, fsd;
+ fkd = open(kname, O_RDONLY);
+ ffd = creat(fname, 0644);
+ if ((fkd < 0) || (ffd < 0))
+ return -1;
+ if (fsname) {
+ fsd = open(fsname, O_RDONLY);
+ if (fsd < 0)
+ return -1;
+ }
+ lenk = lseek(fkd, 0, SEEK_END);
+ header[5] = lenk;
+ bk = (uchar *) mmap(NULL, lenk, PROT_READ, MAP_SHARED, fkd, 0);
+ if (bk == MAP_FAILED)
+ return -1;
+ if (fsname) {
+ lens = lseek(fsd, 0, SEEK_END);
+ bs = (uchar *) mmap(NULL, lens, PROT_READ, MAP_SHARED, fsd,
+ 0);
+ if (bs == MAP_FAILED)
+ return -1;
+ }
+ if (EHDR)
+ write(ffd, header, 0x28);
+ else
+ write(ffd, header + 2, 0x20);
+ write(ffd, bk, lenk);
+ lenk += 0x20;
+ if (!JFFS2) JFFS2 = 0x20;
+ printf("Padding header+kernel - 0x%x + 0x%x = 0x%x\n",
+ lenk, ((lenk - 1 + JFFS2) / JFFS2) * JFFS2 - lenk,
+ ((lenk - 1 + JFFS2) / JFFS2) * JFFS2);
+ for (i = 0; i < ((lenk - 1 + JFFS2) / JFFS2) * JFFS2 - lenk; i++)
+ write(ffd, header, 1);
+ if (fsname) {
+ write(ffd, bs, lens);
+ close(fsd);
+ }
+ close(ffd);
+ close(fkd);
+ return 0;
+}
+
+uint32_t crc32(uchar * buf, uint32_t len)
+{
+ register int i;
+ uint32_t sum;
+ register uint32_t s0;
+ s0 = ~0;
+ for (i = 0; i < len; i++) {
+ s0 = (s0 >> 8) ^ crctab[(uchar) (s0 & 0xFF) ^ buf[i]];
+ }
+ sum = ~s0;
+ return sum;
+}
+
+void usage(char *prog)
+{
+ printf("Usage: %s [-b 0/1] image_filename \n", prog);
+ printf(" update checksums for firmware file\n");
+ printf
+ ("Usage: %s [-b 0/1] [-j erasesize_in_kibytes] [-e] kernel filesystem image_filename \n",
+ prog);
+ printf(" generate firmware file and update checksums\n");
+ printf("--------------------------------------------------\n");
+ printf(" -e - generate header for web upload\n");
+ printf(" -b 0/1 - clear/update bootloader checksum\n");
+ printf(" -j erasesize_in_kibytes - generate header for jffs2 filesystem\n");
+}
+
+int main(int argc, char **argv)
+{
+ uchar b[0x400];
+ char EHDR = 0;
+ char BHDR = 0;
+ int c, fd;
+ extern char *optarg;
+ extern int optind, optopt;
+
+ while ((c = getopt(argc, argv, "b:ej:")) != -1) {
+ switch (c) {
+ case 'b':
+ if (optarg[0] == '1')
+ BHDR = 1;
+ break;
+ case 'e':
+ EHDR = 1;
+ break;
+ case 'j':
+ sscanf(optarg, "%i", &JFFS2);
+ JFFS2 *= 1024;
+ break;
+ case '?':
+ fprintf(stderr, "\nError: unknown arg %c\n\n\n",
+ optopt);
+ usage(argv[0]);
+ exit(-1);
+ }
+ }
+ if (((argc - optind) < 1) && ((argc - optind) > 3)) {
+ usage(argv[0]);
+ exit(-1);
+ }
+ if ((argc - optind) == 3)
+ if (generate_image
+ (argv[optind], argv[optind + 1], argv[optind + 2],
+ EHDR)) {
+ fprintf(stderr,
+ "\nError generating image file %s\n\n\n",
+ argv[argc - 1]);
+ usage(argv[0]);
+ exit(-1);
+ }
+ if ((argc - optind) == 2)
+ if (generate_image
+ (argv[optind], NULL, argv[optind + 1], EHDR)) {
+ fprintf(stderr,
+ "\nError generating image file %s\n\n\n",
+ argv[argc - 1]);
+ usage(argv[0]);
+ exit(-1);
+ }
+
+ fd = open(argv[argc - 1], O_RDWR);
+ if (fd < 0) {
+ fprintf(stderr, "\nImage file not found %s\n\n\n",
+ argv[argc - 1]);
+ usage(argv[0]);
+ exit(-1);
+ }
+ long i, len = lseek(fd, 0, SEEK_END);
+ lseek(fd, 0, SEEK_SET);
+ uchar *buf = malloc(len);
+ read(fd, buf, len);
+ uint32_t sum, l0;
+ uint32_t MagicS = 0x474d544b;
+ uint32_t MagicE = 0x4152524e;
+ if (ntohl(*((uint32_t *) buf)) == MagicS) {
+ fprintf(stderr,
+ "Image without extra 8 bytes - Standard header\n");
+ buf[0x10] = len & 0xff;
+ buf[0x11] = (len >> 8) & 0xff;
+ buf[0x12] = (len >> 16) & 0xff;
+ buf[0x13] = (len >> 24) & 0xff;
+ lseek(fd, 0x10, SEEK_SET);
+ write(fd, buf + 0x10, 0x4);
+ EHDR = 0;
+ } else if ((ntohl(*((uint32_t *) (buf + 0x8))) == MagicS)
+ && ((ntohl(*((uint32_t *) (buf + 0x4))) == MagicE))) {
+ fprintf(stderr,
+ "Image with extra 8 bytes - Extended header\n");
+ *((uint32_t *) (buf + 0x18)) = len - 8;
+ buf[0x18] = (len - 8) & 0xff;
+ buf[0x19] = ((len - 8) >> 8) & 0xff;
+ buf[0x1a] = ((len - 8) >> 16) & 0xff;
+ buf[0x1b] = ((len - 8) >> 24) & 0xff;
+ lseek(fd, 0x18, SEEK_SET);
+ write(fd, buf + 0x18, 0x4);
+ buf += 8;
+ EHDR = 1;
+ } else if (len == buf[0x10] | ((uint32_t)buf[0x11] << 8) | ((uint32_t)buf[0x12] << 16) | ((uint32_t)buf[0x13] << 24)) {
+ fprintf(stderr,
+ "Image without extra 8 bytes - Standard header\n");
+ EHDR = 0;
+ } else if (len == (buf[0x18] | ((uint32_t)buf[0x19] << 8) | ((uint32_t)buf[0x1a] << 16) | ((uint32_t)buf[0x1b] << 24)) + 8) {
+ fprintf(stderr,
+ "Image with extra 8 bytes - Extended header\n");
+ buf += 8;
+ EHDR = 1;
+ } else {
+ fprintf(stderr, "ERROR: Wrong image size\n");
+ exit(-1);
+ }
+ l0 = buf[0x10] | ((uint32_t)buf[0x11] << 8) | ((uint32_t)buf[0x12] << 16) | ((uint32_t)buf[0x13] << 24);
+ if (!BHDR)
+ *((uint32_t *) & buf[0x18]) = 0;
+ unsigned long sum0 = buf[0x18] | ((uint32_t)buf[0x19] << 8) | ((uint32_t)buf[0x1a] << 16) | ((uint32_t)buf[0x1b] << 24);
+ unsigned long sum1 = buf[0x4] | ((uint32_t)buf[0x5] << 8) | ((uint32_t)buf[0x6] << 16) | ((uint32_t)buf[0x7] << 24);
+ *((uint32_t *) & buf[0x4]) = 0x0L;
+ memcpy(b, buf, 0x100);
+ memcpy(b + 0x100, buf + ((l0 >> 1) - ((l0 & 0x6) >> 1)), 0x100);
+ memcpy(b + 0x200, buf + (l0 - 0x200), 0x200);
+ *((uint32_t *) & b[0x18]) = 0x0L;
+
+ sum = crc32(b, 0x400);
+ printf("CRC32 sum0 - (%x, %x, %x)\n", sum, sum0, 0x400);
+ if (EHDR)
+ lseek(fd, 0x20, SEEK_SET);
+ else
+ lseek(fd, 0x18, SEEK_SET);
+ buf[0x18] = (BHDR ? sum : sum0) & 0xff;
+ buf[0x19] = ((BHDR ? sum : sum0) >> 8) & 0xff;
+ buf[0x1a] = ((BHDR ? sum : sum0) >> 16) & 0xff;
+ buf[0x1b] = ((BHDR ? sum : sum0) >> 24) & 0xff;
+ write(fd, &buf[0x18], 0x4);
+
+ sum = crc32(buf, l0);
+ printf("CRC32 sum1 - (%x, %x, %x)\n", sum, sum1, l0);
+ if (EHDR)
+ lseek(fd, 0xC, SEEK_SET);
+ else
+ lseek(fd, 0x4, SEEK_SET);
+ buf[0x4] = sum & 0xff;
+ buf[0x5] = (sum >> 8) & 0xff;
+ buf[0x6] = (sum >> 16) & 0xff;
+ buf[0x7] = (sum >> 24) & 0xff;
+ write(fd, &buf[0x4], 0x4);
+ if (EHDR) {
+ unsigned long sum2 = buf[-0x8] | ((uint32_t)buf[-0x7] << 8) | ((uint32_t)buf[-0x6] << 16) | ((uint32_t)buf[-0x5] << 24);
+ *((uint32_t *) & buf[-0x8]) = 0L;
+ sum = crc32(buf - 0x4, len - 0x4);
+ printf("CRC32 sum2 - (%x, %x, %x)\n", sum, sum2,
+ len - 0x4);
+ lseek(fd, 0, SEEK_SET);
+ *((uint32_t *) & buf[-0x8]) = htonl(sum);
+ write(fd, &buf[-0x8], 0x4);
+ buf -= 8;
+ }
+ close(fd);
+ free(buf);
+ return 0;
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/bcm_tag.h.svn-base b/tools/firmware-utils/src/.svn/text-base/bcm_tag.h.svn-base
new file mode 100644
index 0000000..2730edc
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/bcm_tag.h.svn-base
@@ -0,0 +1,70 @@
+#ifndef __BCM63XX_TAG_H
+#define __BCM63XX_TAG_H
+
+#define TAGVER_LEN 4 /* Length of Tag Version */
+#define TAGLAYOUT_LEN 4 /* Length of FlashLayoutVer */
+#define SIG1_LEN 20 /* Company Signature 1 Length */
+#define SIG2_LEN 14 /* Company Signature 2 Lenght */
+#define BOARDID_LEN 16 /* Length of BoardId */
+#define ENDIANFLAG_LEN 2 /* Endian Flag Length */
+#define CHIPID_LEN 6 /* Chip Id Length */
+#define IMAGE_LEN 10 /* Length of Length Field */
+#define ADDRESS_LEN 12 /* Length of Address field */
+#define DUALFLAG_LEN 2 /* Dual Image flag Length */
+#define INACTIVEFLAG_LEN 2 /* Inactie Flag Length */
+#define RSASIG_LEN 20 /* Length of RSA Signature in tag */
+#define TAGINFO1_LEN 30 /* Length of vendor information field1 in tag */
+#define FLASHLAYOUTVER_LEN 4 /* Length of Flash Layout Version String tag */
+#define TAGINFO2_LEN 16 /* Length of vendor information field2 in tag */
+#define CRC_LEN 4 /* Length of CRC in bytes */
+#define ALTTAGINFO_LEN 54 /* Alternate length for vendor information; Pirelli */
+
+#define NUM_PIRELLI 2
+#define IMAGETAG_CRC_START 0xFFFFFFFF
+
+#define PIRELLI_BOARDS { \
+ "AGPF-S0", \
+ "DWV-S0", \
+}
+
+/*
+ * The broadcom firmware assumes the rootfs starts the image,
+ * therefore uses the rootfs start (flashImageAddress)
+ * to determine where to flash the image. Since we have the kernel first
+ * we have to give it the kernel address, but the crc uses the length
+ * associated with this address (rootLength), which is added to the kernel
+ * length (kernelLength) to determine the length of image to flash and thus
+ * needs to be rootfs + deadcode (jffs2 EOF marker)
+*/
+
+struct bcm_tag {
+ char tagVersion[TAGVER_LEN]; // 0-3: Version of the image tag
+ char sig_1[SIG1_LEN]; // 4-23: Company Line 1
+ char sig_2[SIG2_LEN]; // 24-37: Company Line 2
+ char chipid[CHIPID_LEN]; // 38-43: Chip this image is for
+ char boardid[BOARDID_LEN]; // 44-59: Board name
+ char big_endian[ENDIANFLAG_LEN]; // 60-61: Map endianness -- 1 BE 0 LE
+ char totalLength[IMAGE_LEN]; // 62-71: Total length of image
+ char cfeAddress[ADDRESS_LEN]; // 72-83: Address in memory of CFE
+ char cfeLength[IMAGE_LEN]; // 84-93: Size of CFE
+ char flashImageStart[ADDRESS_LEN]; // 94-105: Address in memory of image start (kernel for OpenWRT, rootfs for stock firmware)
+ char flashRootLength[IMAGE_LEN]; // 106-115: Size of rootfs for flashing
+ char kernelAddress[ADDRESS_LEN]; // 116-127: Address in memory of kernel
+ char kernelLength[IMAGE_LEN]; // 128-137: Size of kernel
+ char dualImage[DUALFLAG_LEN]; // 138-139: Unused at present
+ char inactiveFlag[INACTIVEFLAG_LEN]; // 140-141: Unused at present
+ char rsa_signature[RSASIG_LEN]; // 142-161: RSA Signature (unused at present; some vendors may use this)
+ char information1[TAGINFO1_LEN]; // 162-191: Compilation and related information (not generated/used by OpenWRT)
+ char flashLayoutVer[FLASHLAYOUTVER_LEN];// 192-195: Version flash layout
+ char fskernelCRC[CRC_LEN]; // 196-199: kernel+rootfs CRC32
+ char information2[TAGINFO2_LEN]; // 200-215: Unused at present except Alice Gate where is is information
+ char imageCRC[CRC_LEN]; // 216-219: CRC32 of image less imagetag (kernel for Alice Gate)
+ char rootfsCRC[CRC_LEN]; // 220-223: CRC32 of rootfs partition
+ char kernelCRC[CRC_LEN]; // 224-227: CRC32 of kernel partition
+ char imageSequence[4]; // 228-231: Image sequence number
+ char rootLength[4]; // 232-235: steal from reserved1 to keep the real root length so we can use in the flash map even after we have change the rootLength to 0 to satisfy devices that check CRC on every boot
+ char headerCRC[CRC_LEN]; // 236-239: CRC32 of header excluding tagVersion
+ char reserved2[16]; // 240-255: Unused at present
+};
+
+#endif /* __BCM63XX_TAG_H */
diff --git a/tools/firmware-utils/src/.svn/text-base/buffalo-enc.c.svn-base b/tools/firmware-utils/src/.svn/text-base/buffalo-enc.c.svn-base
new file mode 100644
index 0000000..13d270b
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/buffalo-enc.c.svn-base
@@ -0,0 +1,298 @@
+/*
+ * Copyright (C) 2009-2011 Gabor Juhos
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include /* for getopt() */
+#include
+
+#include "buffalo-lib.h"
+
+#define ERR(fmt, args...) do { \
+ fflush(0); \
+ fprintf(stderr, "[%s] *** error: " fmt "\n", \
+ progname, ## args ); \
+} while (0)
+
+static char *progname;
+static char *ifname;
+static char *ofname;
+static char *crypt_key = "Buffalo";
+static char *magic = "start";
+static int longstate;
+static unsigned char seed = 'O';
+
+static char *product;
+static char *version;
+static int do_decrypt;
+
+void usage(int status)
+{
+ FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
+
+ fprintf(stream, "Usage: %s [OPTIONS...]\n", progname);
+ fprintf(stream,
+"\n"
+"Options:\n"
+" -d decrypt instead of encrypt\n"
+" -i read input from the file \n"
+" -o write output to the file \n"
+" -l use longstate {en,de}cryption method\n"
+" -k use for encryption (default: Buffalo)\n"
+" -m set magic to \n"
+" -p set product name to \n"
+" -v set version to \n"
+" -h show this screen\n"
+ );
+
+ exit(status);
+}
+
+static int decrypt_file(void)
+{
+ struct enc_param ep;
+ ssize_t src_len;
+ unsigned char *buf = NULL;
+ int err;
+ int ret = -1;
+
+ src_len = get_file_size(ifname);
+ if (src_len < 0) {
+ ERR("unable to get size of '%s'", ifname);
+ goto out;
+ }
+
+ buf = malloc(src_len);
+ if (buf == NULL) {
+ ERR("no memory for the buffer");
+ goto out;
+ }
+
+ err = read_file_to_buf(ifname, buf, src_len);
+ if (err) {
+ ERR("unable to read from file '%s'", ifname);
+ goto out;
+ }
+
+ memset(&ep, '\0', sizeof(ep));
+ ep.key = (unsigned char *) crypt_key;
+
+ err = decrypt_buf(&ep, buf, src_len);
+ if (err) {
+ ERR("unable to decrypt '%s'", ifname);
+ goto out;
+ }
+
+ printf("Magic\t\t: '%s'\n", ep.magic);
+ printf("Seed\t\t: 0x%02x\n", ep.seed);
+ printf("Product\t\t: '%s'\n", ep.product);
+ printf("Version\t\t: '%s'\n", ep.version);
+ printf("Data len\t: %u\n", ep.datalen);
+ printf("Checksum\t: 0x%08x\n", ep.csum);
+
+ err = write_buf_to_file(ofname, buf, ep.datalen);
+ if (err) {
+ ERR("unable to write to file '%s'", ofname);
+ goto out;
+ }
+
+ ret = 0;
+
+out:
+ free(buf);
+ return ret;
+}
+
+static int encrypt_file(void)
+{
+ struct enc_param ep;
+ ssize_t src_len;
+ unsigned char *buf;
+ uint32_t hdrlen;
+ ssize_t totlen = 0;
+ int err;
+ int ret = -1;
+
+ src_len = get_file_size(ifname);
+ if (src_len < 0) {
+ ERR("unable to get size of '%s'", ifname);
+ goto out;
+ }
+
+ totlen = enc_compute_buf_len(product, version, src_len);
+ hdrlen = enc_compute_header_len(product, version);
+
+ buf = malloc(totlen);
+ if (buf == NULL) {
+ ERR("no memory for the buffer");
+ goto out;
+ }
+
+ err = read_file_to_buf(ifname, &buf[hdrlen], src_len);
+ if (err) {
+ ERR("unable to read from file '%s'", ofname);
+ goto free_buf;
+ }
+
+ memset(&ep, '\0', sizeof(ep));
+ ep.key = (unsigned char *) crypt_key;
+ ep.seed = seed;
+ ep.longstate = longstate;
+ ep.csum = buffalo_csum(src_len, &buf[hdrlen], src_len);
+ ep.datalen = src_len;
+ strcpy((char *) ep.magic, magic);
+ strcpy((char *) ep.product, product);
+ strcpy((char *) ep.version, version);
+
+ err = encrypt_buf(&ep, buf, &buf[hdrlen]);
+ if (err) {
+ ERR("invalid input file");
+ goto free_buf;
+ }
+
+ err = write_buf_to_file(ofname, buf, totlen);
+ if (err) {
+ ERR("unable to write to file '%s'", ofname);
+ goto free_buf;
+ }
+
+ ret = 0;
+
+free_buf:
+ free(buf);
+out:
+ return ret;
+}
+
+static int check_params(void)
+{
+ int ret = -1;
+
+ if (ifname == NULL) {
+ ERR("no input file specified");
+ goto out;
+ }
+
+ if (ofname == NULL) {
+ ERR("no output file specified");
+ goto out;
+ }
+
+ if (crypt_key == NULL) {
+ ERR("no key specified");
+ goto out;
+ } else if (strlen(crypt_key) > BCRYPT_MAX_KEYLEN) {
+ ERR("key '%s' is too long", crypt_key);
+ goto out;
+ }
+
+ if (strlen(magic) != (ENC_MAGIC_LEN - 1)) {
+ ERR("length of magic must be %d", ENC_MAGIC_LEN - 1);
+ goto out;
+ }
+
+ if (!do_decrypt) {
+ if (product == NULL) {
+ ERR("no product specified");
+ goto out;
+ }
+
+ if (version == NULL) {
+ ERR("no version specified");
+ goto out;
+ }
+
+ if (strlen(product) > (ENC_PRODUCT_LEN - 1)) {
+ ERR("product name '%s' is too long", product);
+ goto out;
+ }
+
+ if (strlen(version) > (ENC_VERSION_LEN - 1)) {
+ ERR("version '%s' is too long", version);
+ goto out;
+ }
+ }
+
+ ret = 0;
+
+out:
+ return ret;
+}
+
+int main(int argc, char *argv[])
+{
+ int res = EXIT_FAILURE;
+ int err;
+
+ progname = basename(argv[0]);
+
+ while ( 1 ) {
+ int c;
+
+ c = getopt(argc, argv, "adi:m:o:hp:v:k:r:s:");
+ if (c == -1)
+ break;
+
+ switch (c) {
+ case 'd':
+ do_decrypt = 1;
+ break;
+ case 'i':
+ ifname = optarg;
+ break;
+ case 'l':
+ longstate = 1;
+ break;
+ case 'm':
+ magic = optarg;
+ break;
+ case 'o':
+ ofname = optarg;
+ break;
+ case 'p':
+ product = optarg;
+ break;
+ case 'v':
+ version = optarg;
+ break;
+ case 'k':
+ crypt_key = optarg;
+ break;
+ case 's':
+ seed = strtoul(optarg, NULL, 16);
+ break;
+ case 'h':
+ usage(EXIT_SUCCESS);
+ break;
+ default:
+ usage(EXIT_FAILURE);
+ break;
+ }
+ }
+
+ err = check_params();
+ if (err)
+ goto out;
+
+ if (do_decrypt)
+ err = decrypt_file();
+ else
+ err = encrypt_file();
+
+ if (err)
+ goto out;
+
+ res = EXIT_SUCCESS;
+
+out:
+ return res;
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/buffalo-lib.c.svn-base b/tools/firmware-utils/src/.svn/text-base/buffalo-lib.c.svn-base
new file mode 100644
index 0000000..29aee9f
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/buffalo-lib.c.svn-base
@@ -0,0 +1,480 @@
+/*
+ * Copyright (C) 2009-2011 Gabor Juhos
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "buffalo-lib.h"
+
+static uint32_t crc32_table[256] =
+{
+ 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
+ 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
+ 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
+ 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
+ 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
+ 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
+ 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011,
+ 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
+ 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
+ 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
+ 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81,
+ 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
+ 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49,
+ 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
+ 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
+ 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
+ 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae,
+ 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
+ 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
+ 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
+ 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
+ 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
+ 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066,
+ 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
+ 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e,
+ 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
+ 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
+ 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
+ 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
+ 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
+ 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686,
+ 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
+ 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
+ 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
+ 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f,
+ 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
+ 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47,
+ 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
+ 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
+ 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
+ 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7,
+ 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
+ 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f,
+ 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
+ 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
+ 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
+ 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f,
+ 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
+ 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
+ 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
+ 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
+ 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
+ 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30,
+ 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
+ 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088,
+ 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
+ 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
+ 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
+ 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
+ 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
+ 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0,
+ 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
+ 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
+ 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
+};
+
+int bcrypt_init(struct bcrypt_ctx *ctx, void *key, int keylen,
+ unsigned long state_len)
+{
+ unsigned char *state;
+ unsigned char *p = key;
+ unsigned long i, j;
+ unsigned long k = 0;
+
+ state = malloc(state_len);
+ if (state == NULL)
+ return -1;
+
+ ctx->i = 0;
+ ctx->j = 0;
+ ctx->state = state;
+ ctx->state_len = state_len;
+
+ for (i = 0; i < state_len; i++)
+ state[i] = i;
+
+ for(i = 0, j = 0; i < state_len; i++, j = (j + 1) % keylen) {
+ unsigned char t;
+
+ t = state[i];
+ k = (k + p[j] + t) % state_len;
+ state[i] = state[k];
+ state[k] = t;
+ }
+
+ return 0;
+}
+
+int bcrypt_process(struct bcrypt_ctx *ctx, unsigned char *src,
+ unsigned char *dst, unsigned long len)
+{
+ unsigned char *state = ctx->state;
+ unsigned long state_len = ctx->state_len;
+ unsigned char i, j;
+ unsigned long k;
+
+ i = ctx->i;
+ j = ctx->j;
+
+ for (k = 0; k < len; k++) {
+ unsigned char t;
+
+ i = (i + 1) % state_len;
+ j = (j + state[i]) % state_len;
+ t = state[j];
+ state[j] = state[i];
+ state[i] = t;
+
+ dst[k] = src[k] ^ state[(state[i] + state[j]) % state_len];
+ }
+
+ ctx->i = i;
+ ctx->j = j;
+
+ return len;
+}
+
+void bcrypt_finish(struct bcrypt_ctx *ctx)
+{
+ if (ctx->state)
+ free(ctx->state);
+}
+
+int bcrypt_buf(unsigned char seed, unsigned char *key, unsigned char *src,
+ unsigned char *dst, unsigned long len, int longstate)
+{
+ unsigned char bckey[BCRYPT_MAX_KEYLEN + 1];
+ unsigned int keylen;
+ struct bcrypt_ctx ctx;
+ int ret;
+
+ /* setup decryption key */
+ keylen = strlen((char *) key);
+ bckey[0] = seed;
+ memcpy(&bckey[1], key, keylen);
+
+ keylen++;
+
+ ret = bcrypt_init(&ctx, bckey, keylen,
+ (longstate) ? len : BCRYPT_DEFAULT_STATE_LEN);
+ if (ret)
+ return ret;
+
+ bcrypt_process(&ctx, src, dst, len);
+ bcrypt_finish(&ctx);
+
+ return 0;
+}
+
+uint32_t buffalo_csum(uint32_t csum, void *buf, unsigned long len)
+{
+ char *p = buf;
+
+ while (len--) {
+ int i;
+
+ csum ^= *p++;
+ for (i = 0; i < 8; i++)
+ csum = (csum >> 1) ^ ((csum & 1) ? 0xedb88320ul : 0);
+ }
+
+ return csum;
+}
+
+uint32_t buffalo_crc(void *buf, unsigned long len)
+{
+ unsigned char *p = buf;
+ unsigned long t = len;
+ uint32_t crc = 0;
+
+ while (len--)
+ crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ *p++) & 0xFF];
+
+ while (t) {
+ crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ t) & 0xFF];
+ t >>= 8;
+ }
+
+ return ~crc;
+}
+
+unsigned long enc_compute_header_len(char *product, char *version)
+{
+ return ENC_MAGIC_LEN + 1 + strlen(product) + 1 +
+ strlen(version) + 1 + 3 * sizeof(uint32_t);
+}
+
+unsigned long enc_compute_buf_len(char *product, char *version,
+ unsigned long datalen)
+{
+ unsigned long ret;
+
+ ret = enc_compute_header_len(product, version);
+ ret += datalen + sizeof(uint32_t);
+ ret += (4 - ret % 4);
+
+ return ret;
+}
+
+static void put_be32(void *data, uint32_t val)
+{
+ unsigned char *p = data;
+
+ p[0] = (val >> 24) & 0xff;
+ p[1] = (val >> 16) & 0xff;
+ p[2] = (val >> 8) & 0xff;
+ p[3] = val & 0xff;
+}
+
+static uint32_t get_be32(void *data)
+{
+ unsigned char *p = data;
+
+ return (((uint32_t)p[0]) << 24) |
+ (((uint32_t)p[1]) << 16) |
+ (((uint32_t)p[2]) << 8) |
+ ((uint32_t)p[3]);
+}
+
+static int check_magic(void *magic)
+{
+ if (!memcmp("start", magic, ENC_MAGIC_LEN));
+ return 0;
+
+ if (!memcmp("asar1", magic, ENC_MAGIC_LEN));
+ return 0;
+
+ return -1;
+}
+
+int encrypt_buf(struct enc_param *ep, unsigned char *hdr,
+ unsigned char *data)
+{
+ unsigned char *p;
+ uint32_t len;
+ int err;
+ int ret = -1;
+ unsigned char s;
+
+ p = (unsigned char *) hdr;
+
+ /* setup magic */
+ len = strlen((char *) ep->magic) + 1;
+ memcpy(p, ep->magic, len);
+ p += len;
+
+ /* setup seed */
+ *p++ = ep->seed;
+
+ /* put product len */
+ len = strlen((char *) ep->product) + 1;
+ put_be32(p, len);
+ p += sizeof(uint32_t);
+
+ /* copy and crypt product name */
+ memcpy(p, ep->product, len);
+ err = bcrypt_buf(ep->seed, ep->key, p, p, len, ep->longstate);
+ if (err)
+ goto out;
+ s = *p;
+ p += len;
+
+ /* put version length */
+ len = strlen((char *) ep->version) + 1;
+ put_be32(p, len);
+ p += sizeof(uint32_t);
+
+ /* copy and crypt version */
+ memcpy(p, ep->version, len);
+ err = bcrypt_buf(s, ep->key, p, p, len, ep->longstate);
+ if (err)
+ goto out;
+ s = *p;
+ p += len;
+
+ /* put data length */
+ put_be32(p, ep->datalen);
+
+ /* encrypt data */
+ err = bcrypt_buf(s, ep->key, data, data, ep->datalen, ep->longstate);
+ if (err)
+ goto out;
+
+ /* put checksum */
+ put_be32(&data[ep->datalen], ep->csum);
+
+ ret = 0;
+
+out:
+ return ret;
+}
+
+int decrypt_buf(struct enc_param *ep, unsigned char *data,
+ unsigned long datalen)
+{
+ unsigned char *p;
+ uint32_t prod_len;
+ uint32_t ver_len;
+ uint32_t len;
+ uint32_t csum;
+ ssize_t remain;
+ int err;
+ int ret = -1;
+
+#define CHECKLEN(_l) do { \
+ len = (_l); \
+ if (remain < len) { \
+ goto out; \
+ } \
+} while (0)
+
+#define INCP() do { \
+ p += len; \
+ remain -= len; \
+} while (0)
+
+ remain = datalen;
+ p = data;
+
+ CHECKLEN(ENC_MAGIC_LEN);
+ err = check_magic(p);
+ if (err)
+ goto out;
+ memcpy(ep->magic, p, ENC_MAGIC_LEN);
+ INCP();
+
+ CHECKLEN(1);
+ ep->seed = *p;
+ INCP();
+
+ CHECKLEN(sizeof(uint32_t));
+ prod_len = get_be32(p);
+ if (prod_len > ENC_PRODUCT_LEN)
+ goto out;
+ INCP();
+
+ CHECKLEN(prod_len);
+ memcpy(ep->product, p, prod_len);
+ INCP();
+
+ CHECKLEN(sizeof(uint32_t));
+ ver_len = get_be32(p);
+ if (ver_len > ENC_VERSION_LEN)
+ goto out;
+ INCP();
+
+ CHECKLEN(ver_len);
+ memcpy(ep->version, p, ver_len);
+ INCP();
+
+ CHECKLEN(sizeof(uint32_t));
+ ep->datalen = get_be32(p);
+ INCP();
+
+ /* decrypt data */
+ CHECKLEN(ep->datalen);
+ err = bcrypt_buf(ep->version[0], ep->key, p, data, ep->datalen,
+ ep->longstate);
+ if (err)
+ goto out;
+ INCP();
+
+ CHECKLEN(sizeof(uint32_t));
+ ep->csum = get_be32(p);
+ INCP();
+
+ csum = buffalo_csum(ep->datalen, data, ep->datalen);
+ if (csum != ep->csum)
+ goto out;
+
+ /* decrypt product name */
+ err = bcrypt_buf(ep->product[0], ep->key, ep->version, ep->version,
+ ver_len, ep->longstate);
+ if (err)
+ goto out;
+
+ /* decrypt version */
+ err = bcrypt_buf(ep->seed, ep->key, ep->product, ep->product, prod_len,
+ ep->longstate);
+ if (err)
+ goto out;
+
+ ret = 0;
+out:
+ return ret;
+
+#undef CHECKLEN
+#undef INCP
+}
+
+ssize_t get_file_size(char *name)
+{
+ struct stat st;
+ int err;
+
+ err = stat(name, &st);
+ if (err)
+ return -1;
+
+ return st.st_size;
+}
+
+int read_file_to_buf(char *name, void *buf, ssize_t buflen)
+{
+ FILE *f;
+ size_t done;
+ int ret = -1;
+
+ f = fopen(name, "r");
+ if (f == NULL)
+ goto out;
+
+ errno = 0;
+ done = fread(buf, buflen, 1, f);
+ if (done != 1)
+ goto close;
+
+ ret = 0;
+
+close:
+ fclose(f);
+out:
+ return ret;
+}
+
+int write_buf_to_file(char *name, void *buf, ssize_t buflen)
+{
+ FILE *f;
+ size_t done;
+ int ret = -1;
+
+ f = fopen(name, "w");
+ if (f == NULL)
+ goto out;
+
+ errno = 0;
+ done = fwrite(buf, buflen, 1, f);
+ if (done != 1)
+ goto close;
+
+ ret = 0;
+
+close:
+ fflush(f);
+ fclose(f);
+ if (ret)
+ unlink(name);
+out:
+ return ret;
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/buffalo-lib.h.svn-base b/tools/firmware-utils/src/.svn/text-base/buffalo-lib.h.svn-base
new file mode 100644
index 0000000..ba8a508
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/buffalo-lib.h.svn-base
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2009-2011 Gabor Juhos
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ */
+
+#ifndef _BUFFALO_LIB_H
+#define _BUFFALO_LIB_H
+
+#include
+
+#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0]))
+#define BIT(_x) (1UL << (_x))
+
+#define TAG_BRAND_LEN 32
+#define TAG_PRODUCT_LEN 32
+#define TAG_VERSION_LEN 8
+#define TAG_REGION_LEN 2
+#define TAG_LANGUAGE_LEN 8
+#define TAG_PLATFORM_LEN 8
+#define TAG_HWVER_LEN 4
+#define TAG_HWVER_VAL_LEN 4
+
+struct buffalo_tag {
+ unsigned char product[TAG_PRODUCT_LEN];
+ unsigned char brand[TAG_BRAND_LEN];
+ unsigned char ver_major[TAG_VERSION_LEN];
+ unsigned char ver_minor[TAG_VERSION_LEN];
+ unsigned char region_code[2];
+ uint32_t region_mask;
+ unsigned char unknown0[2];
+ unsigned char language[TAG_LANGUAGE_LEN];
+ unsigned char platform[TAG_PLATFORM_LEN];
+ unsigned char hwv[TAG_HWVER_LEN];
+ unsigned char hwv_val[TAG_HWVER_VAL_LEN];
+ uint8_t unknown1[24];
+
+ uint32_t len;
+ uint32_t crc;
+ uint32_t base1;
+ uint32_t base2;
+ uint32_t data_len;
+ uint8_t flag;
+ uint8_t unknown2[3];
+} __attribute ((packed));
+
+struct buffalo_tag2 {
+ unsigned char product[TAG_PRODUCT_LEN];
+ unsigned char brand[TAG_BRAND_LEN];
+ unsigned char ver_major[TAG_VERSION_LEN];
+ unsigned char ver_minor[TAG_VERSION_LEN];
+ unsigned char region_code[2];
+ uint32_t region_mask;
+ unsigned char unknown0[2];
+ unsigned char language[TAG_LANGUAGE_LEN];
+ unsigned char platform[TAG_PLATFORM_LEN];
+ unsigned char hwv[TAG_HWVER_LEN];
+ unsigned char hwv_val[TAG_HWVER_VAL_LEN];
+ uint8_t unknown1[24];
+
+ uint32_t total_len;
+ uint32_t crc;
+ uint32_t len1;
+ uint32_t len2;
+ uint8_t flag;
+ uint8_t unknown2[3];
+} __attribute ((packed));
+
+#define ENC_PRODUCT_LEN 32
+#define ENC_VERSION_LEN 8
+#define ENC_MAGIC_LEN 6
+
+unsigned long enc_compute_header_len(char *product, char *version);
+unsigned long enc_compute_buf_len(char *product, char *version,
+ unsigned long datalen);
+
+struct enc_param {
+ unsigned char *key;
+ unsigned char magic[ENC_MAGIC_LEN];
+ unsigned char product[ENC_PRODUCT_LEN];
+ unsigned char version[ENC_VERSION_LEN];
+ unsigned char seed;
+ int longstate;
+ unsigned datalen;
+ uint32_t csum;
+};
+
+int encrypt_buf(struct enc_param *ep, unsigned char *hdr,
+ unsigned char *data);
+int decrypt_buf(struct enc_param *ep, unsigned char *data,
+ unsigned long datalen);
+
+#define BCRYPT_DEFAULT_STATE_LEN 256
+#define BCRYPT_MAX_KEYLEN 254
+
+struct bcrypt_ctx {
+ unsigned long i;
+ unsigned long j;
+ unsigned char *state;
+ unsigned long state_len;
+};
+
+int bcrypt_init(struct bcrypt_ctx *ctx, void *key, int keylen,
+ unsigned long state_len);
+int bcrypt_process(struct bcrypt_ctx *ctx, unsigned char *src,
+ unsigned char *dst, unsigned long len);
+void bcrypt_finish(struct bcrypt_ctx *ctx);
+int bcrypt_buf(unsigned char seed, unsigned char *key, unsigned char *src,
+ unsigned char *dst, unsigned long len, int longstate);
+
+uint32_t buffalo_csum(uint32_t csum, void *buf, unsigned long len);
+uint32_t buffalo_crc(void *buf, unsigned long len);
+
+ssize_t get_file_size(char *name);
+int read_file_to_buf(char *name, void *buf, ssize_t buflen);
+int write_buf_to_file(char *name, void *buf, ssize_t buflen);
+
+#endif /* _BUFFALO_LIB_H */
diff --git a/tools/firmware-utils/src/.svn/text-base/buffalo-tag.c.svn-base b/tools/firmware-utils/src/.svn/text-base/buffalo-tag.c.svn-base
new file mode 100644
index 0000000..b5db72e
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/buffalo-tag.c.svn-base
@@ -0,0 +1,374 @@
+/*
+ * Copyright (C) 2009-2011 Gabor Juhos
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include /* for getopt() */
+#include
+
+#include "buffalo-lib.h"
+
+#define ERR(fmt, ...) do { \
+ fflush(0); \
+ fprintf(stderr, "[%s] *** error: " fmt "\n", \
+ progname, ## __VA_ARGS__ ); \
+} while (0)
+
+static char *region_table[] = {
+ "JP", "US", "EU", "AP", "TW", "KR"
+};
+
+#define MAX_INPUT_FILES 2
+
+static char *progname;
+static char *ifname[MAX_INPUT_FILES];
+static ssize_t fsize[MAX_INPUT_FILES];
+static int num_files;
+static char *ofname;
+static char *product;
+static char *brand;
+static char *language;
+static char *hwver;
+static char *platform;
+static int flag;
+static char *major;
+static char *minor = "1.01";
+static int skipcrc;
+static uint32_t base1;
+static uint32_t base2;
+static char *region_code;
+static uint32_t region_mask;
+static int num_regions;
+
+void usage(int status)
+{
+ FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
+
+ fprintf(stream, "Usage: %s [OPTIONS...]\n", progname);
+ fprintf(stream,
+"\n"
+"Options:\n"
+" -a set platform to \n"
+" -b set brand to \n"
+" -c \n"
+" -d \n"
+" -f set flag to \n"
+" -i read input from the file \n"
+" -l set language to \n"
+" -m set minor version to \n"
+" -o write output to the file \n"
+" -p set product to \n"
+" -r set image region to \n"
+" valid regions: JP, US, EU, AP, TW, KR, M_\n"
+" -s skip CRC calculation\n"
+" -v set major version to \n"
+" -w set harwdware version to \n"
+" -h show this screen\n"
+ );
+
+ exit(status);
+}
+
+static int check_params(void)
+{
+
+#define CHECKSTR(_var, _name, _len) do { \
+ if ((_var) == NULL) { \
+ ERR("no %s specified", (_name)); \
+ return -1; \
+ } \
+ if ((_len) > 0 && \
+ strlen((_var)) > ((_len) - 1)) { \
+ ERR("%s is too long", (_name)); \
+ return -1; \
+ } \
+} while (0)
+
+ if (num_files == 0)
+ ERR("no input files specified");
+
+ CHECKSTR(ofname, "output file", 0);
+ CHECKSTR(brand, "brand", TAG_BRAND_LEN);
+ CHECKSTR(product, "product", TAG_PRODUCT_LEN);
+ CHECKSTR(platform, "platform", TAG_PLATFORM_LEN);
+ CHECKSTR(major, "major version", TAG_VERSION_LEN);
+ CHECKSTR(minor, "minor version", TAG_VERSION_LEN);
+ CHECKSTR(language, "language", TAG_LANGUAGE_LEN);
+
+ if (hwver)
+ CHECKSTR(hwver, "hardware version", 2);
+
+ if (num_regions == 0) {
+ ERR("no region code specified");
+ return -1;
+ }
+
+ return 0;
+
+#undef CHECKSTR
+}
+
+static int process_region(char *reg)
+{
+ int i;
+
+ if (strlen(reg) != 2) {
+ ERR("invalid region code '%s'", reg);
+ return -1;
+ }
+
+ if (strcmp(reg, "M_") == 0) {
+ region_code = reg;
+ region_mask |= ~0;
+ num_regions = 32;
+ return 0;
+ }
+
+ for (i = 0; i < ARRAY_SIZE(region_table); i++)
+ if (strcmp(reg, region_table[i]) == 0) {
+ region_code = reg;
+ region_mask |= 1 << i;
+ num_regions++;
+ return 0;
+ }
+
+ ERR("unknown region code '%s'", reg);
+ return -1;
+}
+
+static int process_ifname(char *name)
+{
+ if (num_files >= ARRAY_SIZE(ifname)) {
+ ERR("too many input files specified");
+ return -1;
+ }
+
+ ifname[num_files++] = name;
+ return 0;
+}
+
+static void fixup_tag(unsigned char *buf, ssize_t buflen)
+{
+ struct buffalo_tag *tag = (struct buffalo_tag *) buf;
+
+ memset(tag, '\0', sizeof(*tag));
+
+ memcpy(tag->brand, brand, strlen(brand));
+ memcpy(tag->product, product, strlen(product));
+ memcpy(tag->platform, platform, strlen(platform));
+ memcpy(tag->ver_major, major, strlen(major));
+ memcpy(tag->ver_minor, minor, strlen(minor));
+ memcpy(tag->language, language, strlen(language));
+
+ if (num_regions > 1) {
+ tag->region_code[0] = 'M';
+ tag->region_code[1] = '_';
+ tag->region_mask = htonl(region_mask);
+ } else {
+ memcpy(tag->region_code, region_code, 2);
+ }
+
+ tag->len = htonl(buflen);
+ tag->data_len = htonl(fsize[0]);
+ tag->base1 = htonl(base1);
+ tag->base2 = htonl(base2);
+ tag->flag = flag;
+
+ if (hwver) {
+ memcpy(tag->hwv, "hwv", 3);
+ memcpy(tag->hwv_val, hwver, strlen(hwver));
+ }
+
+ if (!skipcrc)
+ tag->crc = htonl(buffalo_crc(buf, buflen));
+}
+
+static void fixup_tag2(unsigned char *buf, ssize_t buflen)
+{
+ struct buffalo_tag2 *tag = (struct buffalo_tag2 *) buf;
+
+ memset(tag, '\0', sizeof(*tag));
+
+ memcpy(tag->brand, brand, strlen(brand));
+ memcpy(tag->product, product, strlen(product));
+ memcpy(tag->platform, platform, strlen(platform));
+ memcpy(tag->ver_major, major, strlen(major));
+ memcpy(tag->ver_minor, minor, strlen(minor));
+ memcpy(tag->language, language, strlen(language));
+
+ if (num_regions > 1) {
+ tag->region_code[0] = 'M';
+ tag->region_code[1] = '_';
+ tag->region_mask = htonl(region_mask);
+ } else {
+ memcpy(tag->region_code, region_code, 2);
+ }
+
+ tag->total_len = htonl(buflen);
+ tag->len1 = htonl(fsize[0]);
+ tag->len2 = htonl(fsize[1]);
+ tag->flag = flag;
+
+ if (hwver) {
+ memcpy(tag->hwv, "hwv", 3);
+ memcpy(tag->hwv_val, hwver, strlen(hwver));
+ }
+
+ if (!skipcrc)
+ tag->crc = htonl(buffalo_crc(buf, buflen));
+}
+
+static int tag_file(void)
+{
+ unsigned char *buf;
+ ssize_t offset;
+ ssize_t hdrlen;
+ ssize_t buflen;
+ int err;
+ int ret = -1;
+ int i;
+
+ if (num_files == 1)
+ hdrlen = sizeof(struct buffalo_tag);
+ else
+ hdrlen = sizeof(struct buffalo_tag2);
+
+ buflen = hdrlen;
+
+ for (i = 0; i < num_files; i++) {
+ fsize[i] = get_file_size(ifname[i]);
+ if (fsize[i] < 0) {
+ ERR("unable to get size of '%s'", ifname[i]);
+ goto out;
+ }
+ buflen += fsize[i];
+ }
+
+ buf = malloc(buflen);
+ if (!buf) {
+ ERR("no memory for buffer\n");
+ goto out;
+ }
+
+ offset = hdrlen;
+ for (i = 0; i < num_files; i++) {
+ err = read_file_to_buf(ifname[i], buf + offset, fsize[i]);
+ if (err) {
+ ERR("unable to read from file '%s'", ifname[i]);
+ goto free_buf;
+ }
+
+ offset += fsize[i];
+ }
+
+ if (num_files == 1)
+ fixup_tag(buf, buflen);
+ else
+ fixup_tag2(buf, buflen);
+
+ err = write_buf_to_file(ofname, buf, buflen);
+ if (err) {
+ ERR("unable to write to file '%s'", ofname);
+ goto free_buf;
+ }
+
+ ret = 0;
+
+free_buf:
+ free(buf);
+out:
+ return ret;
+}
+
+int main(int argc, char *argv[])
+{
+ int res = EXIT_FAILURE;
+ int err;
+
+ progname = basename(argv[0]);
+
+ while ( 1 ) {
+ int c;
+
+ c = getopt(argc, argv, "a:b:c:d:f:hi:l:m:o:p:r:sv:w:");
+ if (c == -1)
+ break;
+
+ switch (c) {
+ case 'a':
+ platform = optarg;
+ break;
+ case 'b':
+ brand = optarg;
+ break;
+ case 'c':
+ base1 = strtoul(optarg, NULL, 16);
+ break;
+ case 'd':
+ base2 = strtoul(optarg, NULL, 16);
+ break;
+ case 'f':
+ flag = strtoul(optarg, NULL, 2);
+ break;
+ case 'i':
+ err = process_ifname(optarg);
+ if (err)
+ goto out;
+ break;
+ case 'l':
+ language = optarg;
+ break;
+ case 'm':
+ minor = optarg;
+ break;
+ case 'o':
+ ofname = optarg;
+ break;
+ case 'p':
+ product = optarg;
+ break;
+ case 'r':
+ err = process_region(optarg);
+ if (err)
+ goto out;
+ break;
+ case 's':
+ skipcrc = 1;
+ break;
+ case 'v':
+ major = optarg;
+ break;
+ case 'w':
+ hwver = optarg;
+ break;
+ case 'h':
+ usage(EXIT_SUCCESS);
+ break;
+ default:
+ usage(EXIT_FAILURE);
+ break;
+ }
+ }
+
+ err = check_params();
+ if (err)
+ goto out;
+
+ err = tag_file();
+ if (err)
+ goto out;
+
+ res = EXIT_SUCCESS;
+
+out:
+ return res;
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/buffalo-tftp.c.svn-base b/tools/firmware-utils/src/.svn/text-base/buffalo-tftp.c.svn-base
new file mode 100644
index 0000000..1a2551a
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/buffalo-tftp.c.svn-base
@@ -0,0 +1,179 @@
+/*
+ * Copyright (C) 2009-2011 Gabor Juhos
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include /* for getopt() */
+#include
+
+#include "buffalo-lib.h"
+
+#define ERR(fmt, args...) do { \
+ fflush(0); \
+ fprintf(stderr, "[%s] *** error: " fmt "\n", \
+ progname, ## args ); \
+} while (0)
+
+static char *progname;
+static char *ifname;
+static char *ofname;
+static int do_decrypt;
+
+void usage(int status)
+{
+ FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
+
+ fprintf(stream, "Usage: %s [OPTIONS...]\n", progname);
+ fprintf(stream,
+"\n"
+"Options:\n"
+" -d decrypt instead of encrypt\n"
+" -i read input from the file \n"
+" -o write output to the file \n"
+" -h show this screen\n"
+ );
+
+ exit(status);
+}
+
+static const unsigned char *crypt_key1 = (unsigned char *)
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+static const unsigned char *crypt_key2 = (unsigned char *)
+ "XYZ0123hijklmnopqABCDEFGHrstuvabcdefgwxyzIJKLMSTUVW456789NOPQR";
+
+static void crypt_header(unsigned char *buf, ssize_t len,
+ const unsigned char *key1, const unsigned char *key2)
+{
+ ssize_t i;
+
+ for (i = 0; i < len; i++) {
+ unsigned int j;
+
+ for (j = 0; key1[j]; j++)
+ if (buf[i] == key1[j]) {
+ buf[i] = key2[j];
+ break;
+ }
+ }
+}
+
+static int crypt_file(void)
+{
+ unsigned char *buf = NULL;
+ ssize_t src_len;
+ ssize_t crypt_len;
+ int err;
+ int ret = -1;
+
+ src_len = get_file_size(ifname);
+ if (src_len < 0) {
+ ERR("unable to get size of '%s'", ifname);
+ goto out;
+ }
+
+ buf = malloc(src_len);
+ if (buf == NULL) {
+ ERR("no memory for the buffer");
+ goto out;
+ }
+
+ err = read_file_to_buf(ifname, buf, src_len);
+ if (err) {
+ ERR("unable to read from file '%s'", ifname);
+ goto out;
+ }
+
+ crypt_len = (src_len > 512) ? 512 : src_len;
+ if (do_decrypt)
+ crypt_header(buf, 512, crypt_key2, crypt_key1);
+ else
+ crypt_header(buf, 512, crypt_key1, crypt_key2);
+
+ err = write_buf_to_file(ofname, buf, src_len);
+ if (err) {
+ ERR("unable to write to file '%s'", ofname);
+ goto out;
+ }
+
+ ret = 0;
+
+out:
+ free(buf);
+ return ret;
+}
+
+static int check_params(void)
+{
+ int ret = -1;
+
+ if (ifname == NULL) {
+ ERR("no input file specified");
+ goto out;
+ }
+
+ if (ofname == NULL) {
+ ERR("no output file specified");
+ goto out;
+ }
+
+ ret = 0;
+
+out:
+ return ret;
+}
+
+int main(int argc, char *argv[])
+{
+ int res = EXIT_FAILURE;
+ int err;
+
+ progname = basename(argv[0]);
+
+ while ( 1 ) {
+ int c;
+
+ c = getopt(argc, argv, "di:o:h");
+ if (c == -1)
+ break;
+
+ switch (c) {
+ case 'd':
+ do_decrypt = 1;
+ break;
+ case 'i':
+ ifname = optarg;
+ break;
+ case 'o':
+ ofname = optarg;
+ break;
+ case 'h':
+ usage(EXIT_SUCCESS);
+ break;
+ default:
+ usage(EXIT_FAILURE);
+ break;
+ }
+ }
+
+ err = check_params();
+ if (err)
+ goto out;
+
+ err = crypt_file();
+ if (err)
+ goto out;
+
+ res = EXIT_SUCCESS;
+
+out:
+ return res;
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/csysimg.h.svn-base b/tools/firmware-utils/src/.svn/text-base/csysimg.h.svn-base
new file mode 100644
index 0000000..65ab062
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/csysimg.h.svn-base
@@ -0,0 +1,79 @@
+/*
+ *
+ * Copyright (C) 2007,2009 Gabor Juhos
+ *
+ * This program was based on the code found in various Linux
+ * source tarballs released by Edimax for it's devices.
+ * Original author: David Hsu
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#define SIG_LEN 4
+
+#define ADM_CODE_ADDR 0x80500000
+#define ADM_WEBP_ADDR 0x10000
+#define ADM_WEBP_SIZE 0x10000
+#define ADM_BOOT_SIZE 0x8000
+#define ADM_CONF_SIZE 0x8000
+#define ADM_BOOT_SIG "\x00\x60\x1A\x40"
+
+
+/*
+ * Generic signatures
+ */
+#define SIG_CSYS "CSYS"
+#define SIG_CONF "HS\x00\x00"
+#define SIG_BOOT_RTL "\x00\x00\x40\x21"
+
+/*
+ * Web page signatures
+ */
+#define SIG_BR6104K "WB4K"
+#define SIG_BR6104KP "WBKP"
+#define SIG_BR6104Wg "WBGW"
+#define SIG_BR6104IPC "WBIP"
+#define SIG_BR6114WG SIG_BR6104IPC
+#define SIG_BR6524K "2-K-"
+#define SIG_BR6524KP "2-KP" /* FIXME: valid? */
+#define SIG_BR6524N "WNRA"
+#define SIG_BR6524WG "2-WG" /* FIXME: valid? */
+#define SIG_BR6524WP "2-WP" /* FIXME: valid? */
+#define SIG_BR6541K "4--K"
+#define SIG_BR6541KP "4-KP" /* FIXME: valid? */
+#define SIG_BR6541WP "4-WP" /* FIXME: valid? */
+#define SIG_C54BSR4 SIG_BR6104IPC
+#define SIG_EW7207APg "EWAS"
+#define SIG_PS1205UWg "4000"
+#define SIG_PS3205U "5010"
+#define SIG_PS3205UWg "5011"
+#define SIG_RALINK "RNRA"
+#define SIG_5GXI "5GXI" /* fake signature */
+
+#define SIG_H2BR4 SIG_BR6524K
+#define SIG_H2WR54G SIG_BR6524WG
+
+#define SIG_XRT401D SIG_BR6104K
+#define SIG_XRT402D SIG_BR6524K
+
+/*
+ * CSYS image file header
+ */
+struct csys_header {
+ unsigned char sig[SIG_LEN];
+ uint32_t addr;
+ uint32_t size;
+};
diff --git a/tools/firmware-utils/src/.svn/text-base/cyg_crc.h.svn-base b/tools/firmware-utils/src/.svn/text-base/cyg_crc.h.svn-base
new file mode 100644
index 0000000..7b59803
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/cyg_crc.h.svn-base
@@ -0,0 +1,109 @@
+//==========================================================================
+//
+// crc.h
+//
+// Interface for the CRC algorithms.
+//
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 2002 Andrew Lunn
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s): Andrew Lunn
+// Contributors: Andrew Lunn
+// Date: 2002-08-06
+// Purpose:
+// Description:
+//
+// This code is part of eCos (tm).
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#ifndef _SERVICES_CRC_CRC_H_
+#define _SERVICES_CRC_CRC_H_
+
+#if 0
+#include
+#else
+#include
+typedef uint32_t cyg_uint32;
+typedef uint16_t cyg_uint16;
+#endif
+
+#ifndef __externC
+# ifdef __cplusplus
+# define __externC extern "C"
+# else
+# define __externC extern
+# endif
+#endif
+
+// Compute a CRC, using the POSIX 1003 definition
+
+__externC cyg_uint32
+cyg_posix_crc32(unsigned char *s, int len);
+
+// Gary S. Brown's 32 bit CRC
+
+__externC cyg_uint32
+cyg_crc32(unsigned char *s, int len);
+
+// Gary S. Brown's 32 bit CRC, but accumulate the result from a
+// previous CRC calculation
+
+__externC cyg_uint32
+cyg_crc32_accumulate(cyg_uint32 crc, unsigned char *s, int len);
+
+// Ethernet FCS Algorithm
+
+__externC cyg_uint32
+cyg_ether_crc32(unsigned char *s, int len);
+
+// Ethernet FCS algorithm, but accumulate the result from a previous
+// CRC calculation.
+
+__externC cyg_uint32
+cyg_ether_crc32_accumulate(cyg_uint32 crc, unsigned char *s, int len);
+
+// 16 bit CRC with polynomial x^16+x^12+x^5+1
+
+__externC cyg_uint16
+cyg_crc16(unsigned char *s, int len);
+
+#endif // _SERVICES_CRC_CRC_H_
+
+
+
diff --git a/tools/firmware-utils/src/.svn/text-base/cyg_crc16.c.svn-base b/tools/firmware-utils/src/.svn/text-base/cyg_crc16.c.svn-base
new file mode 100644
index 0000000..8b37352
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/cyg_crc16.c.svn-base
@@ -0,0 +1,110 @@
+//==========================================================================
+//
+// crc16.c
+//
+// 16 bit CRC with polynomial x^16+x^12+x^5+1
+//
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2002 Gary Thomas
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s): gthomas
+// Contributors: gthomas,asl
+// Date: 2001-01-31
+// Purpose:
+// Description:
+//
+// This code is part of eCos (tm).
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#if 0
+#include
+#else
+#include "cyg_crc.h"
+#endif
+
+// Table of CRC constants - implements x^16+x^12+x^5+1
+static const cyg_uint16 crc16_tab[] = {
+ 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
+ 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
+ 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
+ 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
+ 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
+ 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
+ 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
+ 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
+ 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
+ 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
+ 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
+ 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
+ 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
+ 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
+ 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
+ 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
+ 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
+ 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
+ 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
+ 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
+ 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
+ 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
+ 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
+ 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
+ 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
+ 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
+ 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
+ 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
+ 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
+ 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
+ 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
+ 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0,
+};
+
+cyg_uint16
+cyg_crc16(unsigned char *buf, int len)
+{
+ int i;
+ cyg_uint16 cksum;
+
+ cksum = 0;
+ for (i = 0; i < len; i++) {
+ cksum = crc16_tab[((cksum>>8) ^ *buf++) & 0xFF] ^ (cksum << 8);
+ }
+ return cksum;
+}
+
diff --git a/tools/firmware-utils/src/.svn/text-base/cyg_crc32.c.svn-base b/tools/firmware-utils/src/.svn/text-base/cyg_crc32.c.svn-base
new file mode 100644
index 0000000..9462598
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/cyg_crc32.c.svn-base
@@ -0,0 +1,172 @@
+//==========================================================================
+//
+// crc32.c
+//
+// Gary S. Brown's 32 bit CRC
+//
+//==========================================================================
+//####ECOSGPLCOPYRIGHTBEGIN####
+// -------------------------------------------
+// This file is part of eCos, the Embedded Configurable Operating System.
+// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+// Copyright (C) 2002 Gary Thomas
+//
+// eCos is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 2 or (at your option) any later version.
+//
+// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with eCos; if not, write to the Free Software Foundation, Inc.,
+// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+//
+// As a special exception, if other files instantiate templates or use macros
+// or inline functions from this file, or you compile this file and link it
+// with other works to produce a work based on this file, this file does not
+// by itself cause the resulting work to be covered by the GNU General Public
+// License. However the source code for this file must still be made available
+// in accordance with section (3) of the GNU General Public License.
+//
+// This exception does not invalidate any other reasons why a work based on
+// this file might be covered by the GNU General Public License.
+//
+// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
+// at http://sources.redhat.com/ecos/ecos-license/
+// -------------------------------------------
+//####ECOSGPLCOPYRIGHTEND####
+//==========================================================================
+//#####DESCRIPTIONBEGIN####
+//
+// Author(s): gthomas
+// Contributors: gthomas,asl
+// Date: 2001-01-31
+// Purpose:
+// Description:
+//
+// This code is part of eCos (tm).
+//
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#if 0
+#include
+#else
+#include "cyg_crc.h"
+#endif
+
+ /* ====================================================================== */
+ /* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or */
+ /* code or tables extracted from it, as desired without restriction. */
+ /* */
+ /* First, the polynomial itself and its table of feedback terms. The */
+ /* polynomial is */
+ /* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 */
+ /* */
+ /* ====================================================================== */
+
+static const cyg_uint32 crc32_tab[] = {
+ 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
+ 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
+ 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
+ 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
+ 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
+ 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
+ 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
+ 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
+ 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
+ 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
+ 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
+ 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
+ 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
+ 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
+ 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
+ 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
+ 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
+ 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
+ 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
+ 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
+ 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
+ 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
+ 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
+ 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
+ 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
+ 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
+ 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
+ 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
+ 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
+ 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
+ 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
+ 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
+ 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
+ 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
+ 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
+ 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
+ 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
+ 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
+ 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
+ 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
+ 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
+ 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
+ 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
+ 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
+ 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
+ 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
+ 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
+ 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
+ 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
+ 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
+ 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
+ 0x2d02ef8dL
+ };
+
+/* This is the standard Gary S. Brown's 32 bit CRC algorithm, but
+ accumulate the CRC into the result of a previous CRC. */
+cyg_uint32
+cyg_crc32_accumulate(cyg_uint32 crc32val, unsigned char *s, int len)
+{
+ int i;
+
+ for (i = 0; i < len; i++) {
+ crc32val = crc32_tab[(crc32val ^ s[i]) & 0xff] ^ (crc32val >> 8);
+ }
+ return crc32val;
+}
+
+/* This is the standard Gary S. Brown's 32 bit CRC algorithm */
+cyg_uint32
+cyg_crc32(unsigned char *s, int len)
+{
+ return (cyg_crc32_accumulate(0,s,len));
+}
+
+/* Return a 32-bit CRC of the contents of the buffer accumulating the
+ result from a previous CRC calculation. This uses the Ethernet FCS
+ algorithm.*/
+cyg_uint32
+cyg_ether_crc32_accumulate(cyg_uint32 crc32val, unsigned char *s, int len)
+{
+ int i;
+
+ if (s == 0) return 0L;
+
+ crc32val = crc32val ^ 0xffffffff;
+ for (i = 0; i < len; i++) {
+ crc32val = crc32_tab[(crc32val ^ s[i]) & 0xff] ^ (crc32val >> 8);
+ }
+ return crc32val ^ 0xffffffff;
+}
+
+/* Return a 32-bit CRC of the contents of the buffer, using the
+ Ethernet FCS algorithm. */
+cyg_uint32
+cyg_ether_crc32(unsigned char *s, int len)
+{
+ return cyg_ether_crc32_accumulate(0,s,len);
+}
+
+
diff --git a/tools/firmware-utils/src/.svn/text-base/dgfirmware.c.svn-base b/tools/firmware-utils/src/.svn/text-base/dgfirmware.c.svn-base
new file mode 100644
index 0000000..5ff3b69
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/dgfirmware.c.svn-base
@@ -0,0 +1,376 @@
+#include
+#include
+
+
+#define IMG_SIZE 0x3e0000
+
+#define KERNEL_START 0x020000
+#define KERNEL_SIZE 0x0b0000
+
+#define ROOTFS_START 0x0d0000
+#define ROOTFS_SIZE 0x30ffb2
+
+char* app_name;
+
+
+
+
+void print_usage(void)
+{
+ fprintf(stderr, "usage: dgfirmware [] \n");
+ fprintf(stderr, " firmware image filename\n");
+ fprintf(stderr, " -h print this message\n");
+ fprintf(stderr, " -f fix the checksum\n");
+ fprintf(stderr, " -x extract the rootfs file to \n");
+ fprintf(stderr, " -xk extract the kernel to \n");
+ fprintf(stderr, " -m merge in rootfs fil\e from \n");
+ fprintf(stderr, " -k merge in kernel from \n");
+ fprintf(stderr, " -w write back the modified firmware\n");
+}
+
+
+unsigned char* read_img(const char *fname)
+{
+ FILE *fp;
+ int size;
+ unsigned char *img;
+
+ fp = fopen(fname, "rb");
+ if (fp == NULL) {
+ perror(app_name);
+ exit(-1);
+ }
+
+ fseek(fp, 0, SEEK_END);
+ size = ftell(fp);
+
+ if (size != IMG_SIZE) {
+ fprintf(stderr, "%s: image file has wrong size\n", app_name);
+ fclose(fp);
+ exit(-1);
+ }
+
+ rewind(fp);
+
+ img = malloc(IMG_SIZE);
+ if (img == NULL) {
+ perror(app_name);
+ fclose(fp);
+ exit(-1);
+ }
+
+ if (fread(img, 1, IMG_SIZE, fp) != IMG_SIZE) {
+ fprintf(stderr, "%s: can't read image file\n", app_name);
+ fclose(fp);
+ exit(-1);
+ }
+
+ fclose(fp);
+ return img;
+}
+
+
+void write_img(unsigned char* img, const char *fname)
+{
+ FILE *fp;
+
+ fp = fopen(fname, "wb");
+ if (fp == NULL) {
+ perror(app_name);
+ exit(-1);
+ }
+
+ if (fwrite(img, 1, IMG_SIZE, fp) != IMG_SIZE) {
+ fprintf(stderr, "%s: can't write image file\n", app_name);
+ fclose(fp);
+ exit(-1);
+ }
+}
+
+
+void write_rootfs(unsigned char* img, const char *fname)
+{
+ FILE *fp;
+
+ fp = fopen(fname, "wb");
+ if (fp == NULL) {
+ perror(app_name);
+ exit(-1);
+ }
+
+ if (fwrite(img+ROOTFS_START, 1, ROOTFS_SIZE, fp) != ROOTFS_SIZE) {
+ fprintf(stderr, "%s: can't write image file\n", app_name);
+ fclose(fp);
+ exit(-1);
+ }
+}
+
+
+void write_kernel(unsigned char* img, const char *fname)
+{
+ FILE *fp;
+
+ fp = fopen(fname, "wb");
+ if (fp == NULL) {
+ perror(app_name);
+ exit(-1);
+ }
+
+ if (fwrite(img+KERNEL_START, 1, KERNEL_SIZE, fp) != KERNEL_SIZE) {
+ fprintf(stderr, "%s: can't write kernel file\n", app_name);
+ fclose(fp);
+ exit(-1);
+ }
+}
+
+
+unsigned char* read_rootfs(unsigned char* img, const char *fname)
+{
+ FILE *fp;
+ int size;
+ int i;
+
+ for (i=ROOTFS_START; i ROOTFS_SIZE) {
+ fprintf(stderr, "%s: rootfs image file is too big\n", app_name);
+ fclose(fp);
+ exit(-1);
+ }
+
+ rewind(fp);
+
+ if (fread(img+ROOTFS_START, 1, size, fp) != size) {
+ fprintf(stderr, "%s: can't read rootfs image file\n", app_name);
+ fclose(fp);
+ exit(-1);
+ }
+
+ fclose(fp);
+ return img;
+}
+
+
+unsigned char* read_kernel(unsigned char* img, const char *fname)
+{
+ FILE *fp;
+ int size;
+ int i;
+
+ for (i=KERNEL_START; i KERNEL_SIZE) {
+ fprintf(stderr, "%s: kernel binary file is too big\n", app_name);
+ fclose(fp);
+ exit(-1);
+ }
+
+ rewind(fp);
+
+ if (fread(img+KERNEL_START, 1, size, fp) != size) {
+ fprintf(stderr, "%s: can't read kernel file\n", app_name);
+ fclose(fp);
+ exit(-1);
+ }
+
+ fclose(fp);
+ return img;
+}
+
+
+int get_checksum(unsigned char* img)
+{
+ short unsigned s;
+
+ s = img[0x3dfffc] + (img[0x3dfffd]<<8);
+
+ return s;
+}
+
+
+void set_checksum(unsigned char*img, unsigned short sum)
+{
+ img[0x3dfffc] = sum & 0xff;
+ img[0x3dfffd] = (sum>>8) & 0xff;
+}
+
+
+int compute_checksum(unsigned char* img)
+{
+ int i;
+ short s=0;
+
+ for (i=0; i<0x3dfffc; i++)
+ s += img[i];
+
+ return s;
+}
+
+
+int main(int argc, char* argv[])
+{
+ char *img_fname = NULL;
+ char *rootfs_fname = NULL;
+ char *kernel_fname = NULL;
+ char *new_img_fname = NULL;
+
+ int do_fix_checksum = 0;
+ int do_write = 0;
+ int do_write_rootfs = 0;
+ int do_read_rootfs = 0;
+ int do_write_kernel = 0;
+ int do_read_kernel = 0;
+
+ int i;
+ unsigned char *img;
+ unsigned short img_checksum;
+ unsigned short real_checksum;
+
+ app_name = argv[0];
+
+ for (i=1; i= argc) {
+ fprintf(stderr, "%s: missing argument\n", app_name);
+ return -1;
+ }
+ do_write_rootfs = 1;
+ rootfs_fname = argv[i+1];
+ i++;
+ }
+ else if (!strcmp(argv[i], "-xk")) {
+ if (i+1 >= argc) {
+ fprintf(stderr, "%s: missing argument\n", app_name);
+ return -1;
+ }
+ do_write_kernel = 1;
+ kernel_fname = argv[i+1];
+ i++;
+ }
+ else if (!strcmp(argv[i], "-m")) {
+ if (i+1 >= argc) {
+ fprintf(stderr, "%s: missing argument\n", app_name);
+ return -1;
+ }
+ do_read_rootfs = 1;
+ rootfs_fname = argv[i+1];
+ i++;
+ }
+ else if (!strcmp(argv[i], "-k")) {
+ if (i+1 >= argc) {
+ fprintf(stderr, "%s: missing argument\n", app_name);
+ return -1;
+ }
+ do_read_kernel = 1;
+ kernel_fname = argv[i+1];
+ i++;
+ }
+ else if (!strcmp(argv[i], "-w")) {
+ if (i+1 >= argc) {
+ fprintf(stderr, "%s: missing argument\n", app_name);
+ return -1;
+ }
+ do_write = 1;
+ new_img_fname = argv[i+1];
+ i++;
+ }
+ else if (img_fname != 0) {
+ fprintf(stderr, "%s: too many arguments\n", app_name);
+ return -1;
+ }
+ else {
+ img_fname = argv[i];
+ }
+ }
+
+ if (img_fname == NULL) {
+ fprintf(stderr, "%s: missing argument\n", app_name);
+ return -1;
+ }
+
+ if ((do_read_rootfs && do_write_rootfs) ||
+ (do_read_kernel && do_write_kernel)) {
+ fprintf(stderr, "%s: conflictuous options\n", app_name);
+ return -1;
+ }
+
+ printf ("** Read firmware file\n");
+ img = read_img(img_fname);
+
+ printf ("Firmware product: %s\n", img+0x3dffbd);
+ printf ("Firmware version: 1.%02d.%02d\n", (img[0x3dffeb] & 0x7f), img[0x3dffec]);
+
+ if (do_write_rootfs) {
+ printf ("** Write rootfs file\n");
+ write_rootfs(img, rootfs_fname);
+ }
+
+ if (do_write_kernel) {
+ printf ("** Write kernel file\n");
+ write_kernel(img, kernel_fname);
+ }
+
+ if (do_read_rootfs) {
+ printf ("** Read rootfs file\n");
+ read_rootfs(img, rootfs_fname);
+ do_fix_checksum = 1;
+ }
+
+ if (do_read_kernel) {
+ printf ("** Read kernel file\n");
+ read_kernel(img, kernel_fname);
+ do_fix_checksum = 1;
+ }
+
+ img_checksum = get_checksum(img);
+ real_checksum = compute_checksum(img);
+
+ printf ("image checksum = %04x\n", img_checksum);
+ printf ("real checksum = %04x\n", real_checksum);
+
+ if (do_fix_checksum) {
+ if (img_checksum != real_checksum) {
+ printf ("** Bad Checksum, fix it\n");
+ set_checksum(img, real_checksum);
+ }
+ else {
+ printf ("** Checksum is correct, good\n");
+ }
+ }
+
+ if (do_write) {
+ printf ("** Write image file\n");
+ write_img(img, new_img_fname);
+ }
+
+ free(img);
+ return 0;
+}
+
diff --git a/tools/firmware-utils/src/.svn/text-base/encode_crc.c.svn-base b/tools/firmware-utils/src/.svn/text-base/encode_crc.c.svn-base
new file mode 100644
index 0000000..647fb92
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/encode_crc.c.svn-base
@@ -0,0 +1,151 @@
+/* **************************************************************************
+
+ This program creates a CRC checksum and encodes the file that is named
+ in the command line.
+
+ Compile with: gcc encode_crc.c -Wall -o encode_crc
+
+ Author: Michael Margraf (michael.margraf@freecom.com)
+ Copyright: Freecom Technology GmbH, Berlin, 2004
+ www.freecom.com
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ ************************************************************************* */
+
+
+#include
+#include
+#include
+#include
+
+// *******************************************************************
+// CCITT polynom G(x)=x^16+x^12+x^5+1
+#define POLYNOM 0x1021
+
+// CRC algorithm with MSB first
+int make_crc16(int crc, char new)
+{
+ int i;
+ crc = crc ^ (((int)new) << 8);
+
+ for(i=0; i<8; i++) { // work on 8 bits in "new"
+ crc <<= 1; // MSBs first
+ if(crc & 0x10000) crc ^= POLYNOM;
+ }
+ return crc & 0xFFFF;
+}
+
+// *******************************************************************
+// Reads the file "filename" into memory and returns pointer to the buffer.
+static char *readfile(char *filename, int *size)
+{
+ FILE *fp;
+ char *buffer;
+ struct stat info;
+
+ if (stat(filename,&info)!=0)
+ return NULL;
+
+ if ((fp=fopen(filename,"r"))==NULL)
+ return NULL;
+
+ buffer=NULL;
+ for (;;)
+ {
+ if ((buffer=(char *)malloc(info.st_size+1))==NULL)
+ break;
+
+ if (fread(buffer,1,info.st_size,fp)!=info.st_size)
+ {
+ free(buffer);
+ buffer=NULL;
+ break;
+ }
+
+ buffer[info.st_size]='\0';
+ if(size) *size = info.st_size;
+
+ break;
+ }
+
+ (void)fclose(fp);
+
+ return buffer;
+}
+
+
+// *******************************************************************
+int main(int argc, char** argv)
+{
+ if(argc < 3) {
+ printf("ERROR: Argument missing!\n\n");
+ return 1;
+ }
+
+ int count; // size of file in bytes
+ char *p, *master = readfile(argv[1], &count);
+ if(!master) {
+ printf("ERROR: File not found!\n");
+ return 1;
+ }
+
+ int crc = 0xFFFF, z;
+
+ p = master;
+ for(z=0; z 2) { // with flag for device recognition ?
+ p = argv[2];
+ for(z=strlen(p); z>0; z--) {
+ crc ^= (int)(*p);
+ *(p++) = (char)crc; // encode device flag
+ }
+ }
+ */
+
+ p = master;
+ for(z=0; z 3) { // add flag for device recognition ?
+ fwrite(argv[3], strlen(argv[3]), sizeof(char), fp);
+ }
+ else {
+ // Device is an FSG, so byte swap (IXP4xx is big endian)
+ crc16 = ((crc16 >> 8) & 0xFF) | ((crc16 << 8) & 0xFF00);
+ }
+
+ fwrite(&crc16, 1, sizeof(short), fp); // first write CRC
+
+ fwrite(master, count, sizeof(char), fp); // write content
+ fclose(fp);
+
+ free(master);
+ return 0;
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/fix-u-media-header.c.svn-base b/tools/firmware-utils/src/.svn/text-base/fix-u-media-header.c.svn-base
new file mode 100644
index 0000000..21f184e
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/fix-u-media-header.c.svn-base
@@ -0,0 +1,354 @@
+/*
+ * Copyright (C) 2012 Gabor Juhos
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ */
+#include
+#include
+#include
+#include
+#include /* for unlink() */
+#include
+#include /* for getopt() */
+#include
+#include
+#include
+
+#include "cyg_crc.h"
+
+#include
+#include
+
+#define IH_MAGIC 0x27051956 /* Image Magic Number */
+#define IH_NMLEN 32 /* Image Name Length */
+
+#define UM_MAGIC 0x55525F46
+#define UM_HEADER_LEN 12
+
+/*
+ * all data in network byte order (aka natural aka bigendian)
+ */
+struct u_media_header {
+ uint32_t ih_magic; /* Image Header Magic Number */
+ uint32_t ih_hcrc; /* Image Header CRC Checksum */
+ uint32_t ih_time; /* Image Creation Timestamp */
+ uint32_t ih_size; /* Image Data Size */
+ uint32_t ih_load; /* Data Load Address */
+ uint32_t ih_ep; /* Entry Point Address */
+ uint32_t ih_dcrc; /* Image Data CRC Checksum */
+ uint8_t ih_os; /* Operating System */
+ uint8_t ih_arch; /* CPU architecture */
+ uint8_t ih_type; /* Image Type */
+ uint8_t ih_comp; /* Compression Type */
+ uint8_t ih_name[IH_NMLEN - UM_HEADER_LEN]; /* Image Name */
+
+ uint32_t ih_UMedia_magic; /* U-Media magic number */
+ uint32_t ih_UMedia_boardID; /* U-Media board ID */
+ uint8_t ih_UMedia_imageType; /* U-Media image type */
+ uint8_t ih_UMedia_LoadDefault; /* U-Media load to factory default setting */
+ uint8_t ih_UMedia_temp1; /* U-Media didn't use this tag */
+ uint8_t ih_UMedia_temp2; /* U-Media didn't use this tag */
+} __attribute__ ((packed));
+
+struct if_info {
+ char *file_name; /* name of the file */
+ uint32_t file_size; /* length of the file */
+};
+
+static char *progname;
+static char *ofname;
+static struct if_info if_info;
+static int factory_defaults;
+static uint32_t board_id;
+static uint8_t image_type;
+
+/*
+ * Message macros
+ */
+#define ERR(fmt, ...) do { \
+ fflush(0); \
+ fprintf(stderr, "[%s] *** error: " fmt "\n", \
+ progname, ## __VA_ARGS__ ); \
+} while (0)
+
+#define ERRS(fmt, ...) do { \
+ int save = errno; \
+ fflush(0); \
+ fprintf(stderr, "[%s] *** error: " fmt " (%s)\n", \
+ progname, ## __VA_ARGS__, strerror(save)); \
+} while (0)
+
+#define DBG(fmt, ...) do { \
+ fprintf(stderr, "[%s] " fmt "\n", progname, ## __VA_ARGS__ ); \
+} while (0)
+
+static void usage(int status)
+{
+ FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
+
+ fprintf(stream, "Usage: %s [OPTIONS...]\n", progname);
+ fprintf(stream,
+"\n"
+"Options:\n"
+" -B set board ID to \n"
+" -i read input from the file \n"
+" -F load factory defaults\n"
+" -o write output to the file \n"
+" -T set image type to \n"
+" -h show this screen\n"
+ );
+
+ exit(status);
+}
+
+static int str2u32(char *arg, uint32_t *val)
+{
+ char *err = NULL;
+ uint32_t t;
+
+ errno=0;
+ t = strtoul(arg, &err, 0);
+ if (errno || (err==arg) || ((err != NULL) && *err)) {
+ return -1;
+ }
+
+ *val = t;
+ return 0;
+}
+
+static int str2u8(char *arg, uint8_t *val)
+{
+ char *err = NULL;
+ uint32_t t;
+
+ errno=0;
+ t = strtoul(arg, &err, 0);
+ if (errno || (err==arg) || ((err != NULL) && *err)) {
+ return -1;
+ }
+
+ if (t > 255)
+ return -1;
+
+ *val = t;
+ return 0;
+}
+
+static int get_file_stat(struct if_info *fdata)
+{
+ struct stat st;
+ int res;
+
+ if (fdata->file_name == NULL)
+ return 0;
+
+ res = stat(fdata->file_name, &st);
+ if (res){
+ ERRS("stat failed on %s", fdata->file_name);
+ return res;
+ }
+
+ fdata->file_size = st.st_size;
+ return 0;
+}
+
+static int read_to_buf(struct if_info *fdata, char *buf)
+{
+ FILE *f;
+ int ret = EXIT_FAILURE;
+
+ f = fopen(fdata->file_name, "r");
+ if (f == NULL) {
+ ERRS("could not open \"%s\" for reading", fdata->file_name);
+ goto out;
+ }
+
+ errno = 0;
+ fread(buf, fdata->file_size, 1, f);
+ if (errno != 0) {
+ ERRS("unable to read from file \"%s\"", fdata->file_name);
+ goto out_close;
+ }
+
+ ret = EXIT_SUCCESS;
+
+out_close:
+ fclose(f);
+out:
+ return ret;
+}
+
+static int check_options(void)
+{
+ int ret;
+
+ if (ofname == NULL) {
+ ERR("no %s specified", "output file");
+ return -1;
+ }
+
+ if (if_info.file_name == NULL) {
+ ERR("no %s specified", "input file");
+ return -1;
+ }
+
+ ret = get_file_stat(&if_info);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+static int write_fw(char *data, int len)
+{
+ FILE *f;
+ int ret = EXIT_FAILURE;
+
+ f = fopen(ofname, "w");
+ if (f == NULL) {
+ ERRS("could not open \"%s\" for writing", ofname);
+ goto out;
+ }
+
+ errno = 0;
+ fwrite(data, len, 1, f);
+ if (errno) {
+ ERRS("unable to write output file");
+ goto out_flush;
+ }
+
+ ret = EXIT_SUCCESS;
+
+out_flush:
+ fflush(f);
+ fclose(f);
+ if (ret != EXIT_SUCCESS) {
+ unlink(ofname);
+ }
+out:
+ return ret;
+}
+
+static int fix_header(void)
+{
+ int buflen;
+ char *buf;
+ uint32_t crc, crc_orig;
+ struct u_media_header *hdr;
+ int ret = EXIT_FAILURE;
+
+ buflen = if_info.file_size;
+ if (buflen < sizeof(*hdr)) {
+ ERR("invalid input file\n");
+ return ret;
+ }
+
+ buf = malloc(buflen);
+ if (!buf) {
+ ERR("no memory for buffer\n");
+ goto out;
+ }
+
+ ret = read_to_buf(&if_info, buf);
+ if (ret)
+ goto out_free_buf;
+
+ hdr = (struct u_media_header *) buf;
+ if (ntohl(hdr->ih_magic) != IH_MAGIC) {
+ ERR("invalid input file, bad magic\n");
+ goto out_free_buf;
+ }
+
+ /* verify header CRC */
+ crc_orig = ntohl(hdr->ih_hcrc);
+ hdr->ih_hcrc = 0;
+ crc = cyg_ether_crc32((unsigned char *)hdr, sizeof(*hdr));
+ if (crc != crc_orig) {
+ ERR("invalid input file, bad header CRC\n");
+ goto out_free_buf;
+ }
+
+ hdr->ih_name[IH_NMLEN - UM_HEADER_LEN - 1] = '\0';
+
+ /* set U-Media specific fields */
+ hdr->ih_UMedia_magic = htonl(UM_MAGIC);
+ hdr->ih_UMedia_boardID = htonl(board_id);
+ hdr->ih_UMedia_imageType = image_type;
+ hdr->ih_UMedia_LoadDefault = (factory_defaults) ? 1 : 0;
+
+ /* update header CRC */
+ crc = cyg_ether_crc32((unsigned char *)hdr, sizeof(*hdr));
+ hdr->ih_hcrc = htonl(crc);
+
+ ret = write_fw(buf, buflen);
+ if (ret)
+ goto out_free_buf;
+
+ DBG("U-Media header fixed in \"%s\"", ofname);
+
+ ret = EXIT_SUCCESS;
+
+out_free_buf:
+ free(buf);
+out:
+ return ret;
+}
+
+int main(int argc, char *argv[])
+{
+ int ret = EXIT_FAILURE;
+
+ progname = basename(argv[0]);
+
+ while (1) {
+ int c;
+
+ c = getopt(argc, argv, "B:Fi:o:T:h");
+ if (c == -1)
+ break;
+
+ switch (c) {
+ case 'B':
+ if (str2u32(optarg, &board_id)) {
+ ERR("%s is invalid '%s'",
+ "board ID", optarg);
+ goto out;
+ }
+ break;
+ case 'T':
+ if (str2u8(optarg, &image_type)) {
+ ERR("%s is invalid '%s'",
+ "image type", optarg);
+ goto out;
+ }
+ break;
+ case 'F':
+ factory_defaults = 1;
+ break;
+ case 'i':
+ if_info.file_name = optarg;
+ break;
+ case 'o':
+ ofname = optarg;
+ break;
+ case 'h':
+ usage(EXIT_SUCCESS);
+ break;
+ default:
+ usage(EXIT_FAILURE);
+ break;
+ }
+ }
+
+ ret = check_options();
+ if (ret)
+ goto out;
+
+ ret = fix_header();
+
+out:
+ return ret;
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/fw.h.svn-base b/tools/firmware-utils/src/.svn/text-base/fw.h.svn-base
new file mode 100644
index 0000000..e37859c
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/fw.h.svn-base
@@ -0,0 +1,70 @@
+/*
+ * * Copyright (C) 2007 Ubiquiti Networks, Inc.
+ * *
+ * * This program is free software; you can redistribute it and/or
+ * * modify it under the terms of the GNU General Public License as
+ * * published by the Free Software Foundation; either version 2 of the
+ * * License, or (at your option) any later version.
+ * *
+ * * This program is distributed in the hope that it will be useful, but
+ * * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * * General Public License for more details.
+ * *
+ * * You should have received a copy of the GNU General Public License
+ * * along with this program; if not, write to the Free Software
+ * * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * */
+
+#ifndef FW_INCLUDED
+#define FW_INCLUDED
+
+#include
+
+#define MAGIC_HEADER "OPEN"
+#define MAGIC_PART "PART"
+#define MAGIC_END "END."
+
+#define MAGIC_LENGTH 4
+
+typedef struct header {
+ char magic[MAGIC_LENGTH];
+ char version[256];
+ u_int32_t crc;
+ u_int32_t pad;
+} __attribute__ ((packed)) header_t;
+
+typedef struct part {
+ char magic[MAGIC_LENGTH];
+ char name[16];
+ char pad[12];
+ u_int32_t memaddr;
+ u_int32_t index;
+ u_int32_t baseaddr;
+ u_int32_t entryaddr;
+ u_int32_t data_size;
+ u_int32_t part_size;
+} __attribute__ ((packed)) part_t;
+
+typedef struct part_crc {
+ u_int32_t crc;
+ u_int32_t pad;
+} __attribute__ ((packed)) part_crc_t;
+
+typedef struct signature {
+ char magic[MAGIC_LENGTH];
+ u_int32_t crc;
+ u_int32_t pad;
+} __attribute__ ((packed)) signature_t;
+
+#define VERSION "1.2"
+
+#define INFO(...) fprintf(stdout, __VA_ARGS__)
+#define ERROR(...) fprintf(stderr, "ERROR: "__VA_ARGS__)
+#define WARN(...) fprintf(stderr, "WARN: "__VA_ARGS__)
+#define DEBUG(...) do {\
+ if (debug) \
+ fprintf(stdout, "DEBUG: "__VA_ARGS__); \
+} while (0);
+
+#endif
diff --git a/tools/firmware-utils/src/.svn/text-base/imagetag.c.svn-base b/tools/firmware-utils/src/.svn/text-base/imagetag.c.svn-base
new file mode 100644
index 0000000..166ce9a
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/imagetag.c.svn-base
@@ -0,0 +1,524 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2008 Axel Gembe
+ * Copyright (C) 2009-2010 Daniel Dickinson
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "bcm_tag.h"
+#include "imagetag_cmdline.h"
+
+#define DEADCODE 0xDEADC0DE
+
+/* Kernel header */
+struct kernelhdr {
+ uint32_t loadaddr; /* Kernel load address */
+ uint32_t entry; /* Kernel entry point address */
+ uint32_t lzmalen; /* Compressed length of the LZMA data that follows */
+};
+
+static char pirellitab[NUM_PIRELLI][BOARDID_LEN] = PIRELLI_BOARDS;
+
+static uint32_t crc32tab[256] = {
+ 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
+ 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
+ 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
+ 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
+ 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
+ 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
+ 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
+ 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
+ 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
+ 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
+ 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
+ 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
+ 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
+ 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
+ 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
+ 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
+ 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
+ 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
+ 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
+ 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
+ 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
+ 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
+ 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
+ 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
+ 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
+ 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
+ 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
+ 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
+ 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
+ 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
+ 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
+ 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
+};
+
+void int2tag(char *tag, uint32_t value) {
+ uint32_t network = htonl(value);
+ memcpy(tag, (char *)(&network), 4);
+}
+
+uint32_t crc32(uint32_t crc, uint8_t *data, size_t len)
+{
+ while (len--)
+ crc = (crc >> 8) ^ crc32tab[(crc ^ *data++) & 0xFF];
+
+ return crc;
+}
+
+uint32_t compute_crc32(uint32_t crc, FILE *binfile, size_t compute_start, size_t compute_len)
+{
+ uint8_t readbuf[1024];
+ size_t read;
+
+ fseek(binfile, compute_start, SEEK_SET);
+
+ /* read block of 1024 bytes */
+ while (binfile && !feof(binfile) && !ferror(binfile) && (compute_len >= sizeof(readbuf))) {
+ read = fread(readbuf, sizeof(uint8_t), sizeof(readbuf), binfile);
+ crc = crc32(crc, readbuf, read);
+ compute_len = compute_len - read;
+ }
+
+ /* Less than 1024 bytes remains, read compute_len bytes */
+ if (binfile && !feof(binfile) && !ferror(binfile) && (compute_len > 0)) {
+ read = fread(readbuf, sizeof(uint8_t), compute_len, binfile);
+ crc = crc32(crc, readbuf, read);
+ }
+
+ return crc;
+}
+
+size_t getlen(FILE *fp)
+{
+ size_t retval, curpos;
+
+ if (!fp)
+ return 0;
+
+ curpos = ftell(fp);
+ fseek(fp, 0, SEEK_END);
+ retval = ftell(fp);
+ fseek(fp, curpos, SEEK_SET);
+
+ return retval;
+}
+
+int tagfile(const char *kernel, const char *rootfs, const char *bin, \
+ const struct gengetopt_args_info *args, \
+ uint32_t flash_start, uint32_t image_offset, \
+ uint32_t block_size, uint32_t load_address, uint32_t entry)
+{
+ struct bcm_tag tag;
+ struct kernelhdr khdr;
+ FILE *kernelfile = NULL, *rootfsfile = NULL, *binfile = NULL, *cfefile = NULL;
+ size_t cfeoff, cfelen, kerneloff, kernellen, rootfsoff, rootfslen, \
+ read, imagelen, rootfsoffpadlen = 0, kernelfslen, kerneloffpadlen = 0, oldrootfslen;
+ uint8_t readbuf[1024];
+ uint32_t imagecrc = IMAGETAG_CRC_START;
+ uint32_t kernelcrc = IMAGETAG_CRC_START;
+ uint32_t rootfscrc = IMAGETAG_CRC_START;
+ uint32_t kernelfscrc = IMAGETAG_CRC_START;
+ uint32_t fwaddr = 0;
+ uint8_t crc_val;
+ const uint32_t deadcode = htonl(DEADCODE);
+ int i;
+ int is_pirelli = 0;
+
+
+ memset(&tag, 0, sizeof(struct bcm_tag));
+
+ if (!kernel || !rootfs) {
+ fprintf(stderr, "imagetag can't create an image without both kernel and rootfs\n");
+ }
+
+ if (kernel && !(kernelfile = fopen(kernel, "rb"))) {
+ fprintf(stderr, "Unable to open kernel \"%s\"\n", kernel);
+ return 1;
+ }
+
+ if (rootfs && !(rootfsfile = fopen(rootfs, "rb"))) {
+ fprintf(stderr, "Unable to open rootfs \"%s\"\n", rootfs);
+ return 1;
+ }
+
+ if (!bin || !(binfile = fopen(bin, "wb+"))) {
+ fprintf(stderr, "Unable to open output file \"%s\"\n", bin);
+ return 1;
+ }
+
+ if ((args->cfe_given) && (args->cfe_arg)) {
+ if (!(cfefile = fopen(args->cfe_arg, "rb"))) {
+ fprintf(stderr, "Unable to open CFE file \"%s\"\n", args->cfe_arg);
+ }
+ }
+
+ fwaddr = flash_start + image_offset;
+ if (cfefile) {
+ cfeoff = flash_start;
+ cfelen = getlen(cfefile);
+ /* Seek to the start of the file after tag */
+ fseek(binfile, sizeof(tag), SEEK_SET);
+
+ /* Write the cfe */
+ while (cfefile && !feof(cfefile) && !ferror(cfefile)) {
+ read = fread(readbuf, sizeof(uint8_t), sizeof(readbuf), cfefile);
+ fwrite(readbuf, sizeof(uint8_t), read, binfile);
+ }
+
+ } else {
+ cfeoff = 0;
+ cfelen = 0;
+ }
+
+ if (!args->root_first_flag) {
+ /* Build the kernel address and length (doesn't need to be aligned, read only) */
+ kerneloff = fwaddr + sizeof(tag);
+
+ kernellen = getlen(kernelfile);
+
+ if (!args->kernel_file_has_header_flag) {
+ /* Build the kernel header */
+ khdr.loadaddr = htonl(load_address);
+ khdr.entry = htonl(entry);
+ khdr.lzmalen = htonl(kernellen);
+
+ /* Increase the kernel size by the header size */
+ kernellen += sizeof(khdr);
+ }
+
+ /* Build the rootfs address and length (start and end do need to be aligned on flash erase block boundaries */
+ rootfsoff = kerneloff + kernellen;
+ rootfsoff = (rootfsoff % block_size) > 0 ? (((rootfsoff / block_size) + 1) * block_size) : rootfsoff;
+ rootfslen = getlen(rootfsfile);
+ rootfslen = ( (rootfslen % block_size) > 0 ? (((rootfslen / block_size) + 1) * block_size) : rootfslen );
+ imagelen = rootfsoff + rootfslen - kerneloff + sizeof(deadcode);
+ rootfsoffpadlen = rootfsoff - (kerneloff + kernellen);
+
+ /* Seek to the start of the kernel */
+ fseek(binfile, kerneloff - fwaddr + cfelen, SEEK_SET);
+
+ /* Write the kernel header */
+ fwrite(&khdr, sizeof(khdr), 1, binfile);
+
+ /* Write the kernel */
+ while (kernelfile && !feof(kernelfile) && !ferror(kernelfile)) {
+ read = fread(readbuf, sizeof(uint8_t), sizeof(readbuf), kernelfile);
+ fwrite(readbuf, sizeof(uint8_t), read, binfile);
+ }
+
+ /* Write the RootFS */
+ fseek(binfile, rootfsoff - fwaddr + cfelen, SEEK_SET);
+ while (rootfsfile && !feof(rootfsfile) && !ferror(rootfsfile)) {
+ read = fread(readbuf, sizeof(uint8_t), sizeof(readbuf), rootfsfile);
+ fwrite(readbuf, sizeof(uint8_t), read, binfile);
+ }
+
+ /* Align image to specified erase block size and append deadc0de */
+ printf("Data alignment to %dk with 'deadc0de' appended\n", block_size/1024);
+ fseek(binfile, rootfsoff + rootfslen - fwaddr + cfelen, SEEK_SET);
+ fwrite(&deadcode, sizeof(uint32_t), 1, binfile);
+
+ oldrootfslen = rootfslen;
+ if (args->pad_given) {
+ uint32_t allfs = 0xffffffff;
+ uint32_t pad_size = args->pad_arg * 1024 * 1024;
+
+ printf("Padding image to %d bytes ...\n", pad_size);
+ while (imagelen < pad_size) {
+ fwrite(&allfs, sizeof(uint32_t), 1, binfile);
+ imagelen += 4;
+ rootfslen += 4;
+ }
+ }
+
+ /* Flush the binfile buffer so that when we read from file, it contains
+ * everything in the buffer
+ */
+ fflush(binfile);
+
+ /* Compute the crc32 of the entire image (deadC0de included) */
+ imagecrc = compute_crc32(imagecrc, binfile, kerneloff - fwaddr + cfelen, imagelen);
+ /* Compute the crc32 of the kernel and padding between kernel and rootfs) */
+ kernelcrc = compute_crc32(kernelcrc, binfile, kerneloff - fwaddr + cfelen, kernellen + rootfsoffpadlen);
+ /* Compute the crc32 of the kernel and padding between kernel and rootfs) */
+ kernelfscrc = compute_crc32(kernelfscrc, binfile, kerneloff - fwaddr + cfelen, kernellen + rootfsoffpadlen + rootfslen + sizeof(deadcode));
+ /* Compute the crc32 of the flashImageStart to rootLength.
+ * The broadcom firmware assumes the rootfs starts the image,
+ * therefore uses the rootfs start to determine where to flash
+ * the image. Since we have the kernel first we have to give
+ * it the kernel address, but the crc uses the length
+ * associated with this address, which is added to the kernel
+ * length to determine the length of image to flash and thus
+ * needs to be rootfs + deadcode
+ */
+ rootfscrc = compute_crc32(rootfscrc, binfile, kerneloff - fwaddr + cfelen, rootfslen + sizeof(deadcode));
+
+ } else {
+ /* Build the kernel address and length (doesn't need to be aligned, read only) */
+ rootfsoff = fwaddr + sizeof(tag);
+ oldrootfslen = getlen(rootfsfile);
+ rootfslen = oldrootfslen;
+ rootfslen = ( (rootfslen % block_size) > 0 ? (((rootfslen / block_size) + 1) * block_size) : rootfslen );
+ kerneloffpadlen = rootfslen - oldrootfslen;
+ oldrootfslen = rootfslen;
+
+ kerneloff = rootfsoff + rootfslen;
+ kernellen = getlen(kernelfile);
+
+ imagelen = cfelen + rootfslen + kernellen;
+
+ /* Seek to the start of the kernel */
+ fseek(binfile, kerneloff - fwaddr + cfelen, SEEK_SET);
+
+ if (!args->kernel_file_has_header_flag) {
+ /* Build the kernel header */
+ khdr.loadaddr = htonl(load_address);
+ khdr.entry = htonl(entry);
+ khdr.lzmalen = htonl(kernellen);
+
+ /* Write the kernel header */
+ fwrite(&khdr, sizeof(khdr), 1, binfile);
+
+ /* Increase the kernel size by the header size */
+ kernellen += sizeof(khdr);
+ }
+
+ /* Write the kernel */
+ while (kernelfile && !feof(kernelfile) && !ferror(kernelfile)) {
+ read = fread(readbuf, sizeof(uint8_t), sizeof(readbuf), kernelfile);
+ fwrite(readbuf, sizeof(uint8_t), read, binfile);
+ }
+
+ /* Write the RootFS */
+ fseek(binfile, rootfsoff - fwaddr + cfelen, SEEK_SET);
+ while (rootfsfile && !feof(rootfsfile) && !ferror(rootfsfile)) {
+ read = fread(readbuf, sizeof(uint8_t), sizeof(readbuf), rootfsfile);
+ fwrite(readbuf, sizeof(uint8_t), read, binfile);
+ }
+
+ /* Flush the binfile buffer so that when we read from file, it contains
+ * everything in the buffer
+ */
+ fflush(binfile);
+
+ /* Compute the crc32 of the entire image (deadC0de included) */
+ imagecrc = compute_crc32(imagecrc, binfile, sizeof(tag), imagelen);
+ /* Compute the crc32 of the kernel and padding between kernel and rootfs) */
+ kernelcrc = compute_crc32(kernelcrc, binfile, kerneloff - fwaddr + cfelen, kernellen + rootfsoffpadlen);
+ kernelfscrc = compute_crc32(kernelfscrc, binfile, rootfsoff - fwaddr + cfelen, kernellen + rootfslen);
+ rootfscrc = compute_crc32(rootfscrc, binfile, rootfsoff - fwaddr + cfelen, rootfslen);
+ }
+
+ /* Close the files */
+ if (cfefile) {
+ fclose(cfefile);
+ }
+ fclose(kernelfile);
+ fclose(rootfsfile);
+
+ /* Build the tag */
+ strncpy(tag.tagVersion, args->tag_version_arg, sizeof(tag.tagVersion) - 1);
+ strncpy(tag.sig_1, args->signature_arg, sizeof(tag.sig_1) - 1);
+ strncpy(tag.sig_2, args->signature2_arg, sizeof(tag.sig_2) - 1);
+ strncpy(tag.chipid, args->chipid_arg, sizeof(tag.chipid) - 1);
+ strncpy(tag.boardid, args->boardid_arg, sizeof(tag.boardid) - 1);
+ strcpy(tag.big_endian, "1");
+ sprintf(tag.totalLength, "%lu", imagelen);
+
+ if (args->cfe_given) {
+ sprintf(tag.cfeAddress, "%lu", flash_start);
+ sprintf(tag.cfeLength, "%lu", cfelen);
+ } else {
+ /* We don't include CFE */
+ strcpy(tag.cfeAddress, "0");
+ strcpy(tag.cfeLength, "0");
+ }
+
+ sprintf(tag.kernelAddress, "%lu", kerneloff);
+ sprintf(tag.kernelLength, "%lu", kernellen + rootfsoffpadlen);
+
+ if (args->root_first_flag) {
+ sprintf(tag.flashImageStart, "%lu", rootfsoff);
+ sprintf(tag.flashRootLength, "%lu", rootfslen);
+ } else {
+ sprintf(tag.flashImageStart, "%lu", kerneloff);
+ sprintf(tag.flashRootLength, "%lu", rootfslen + sizeof(deadcode));
+ }
+ int2tag(tag.rootLength, oldrootfslen + sizeof(deadcode));
+
+ if (args->rsa_signature_given) {
+ strncpy(tag.rsa_signature, args->rsa_signature_arg, RSASIG_LEN);
+ }
+
+ if (args->layoutver_given) {
+ strncpy(tag.flashLayoutVer, args->layoutver_arg, TAGLAYOUT_LEN);
+ }
+
+ if (args->info1_given) {
+ strncpy(tag.information1, args->info1_arg, TAGINFO1_LEN);
+ }
+
+ if (args->info2_given) {
+ strncpy(tag.information2, args->info2_arg, TAGINFO2_LEN);
+ }
+
+ if (args->reserved2_given) {
+ strncpy(tag.reserved2, args->reserved2_arg, 16);
+ }
+
+ if (args->altinfo_given) {
+ strncpy(&tag.information1[0], args->altinfo_arg, ALTTAGINFO_LEN);
+ }
+
+ if (args->second_image_flag_given) {
+ if (strncmp(args->second_image_flag_arg, "2", DUALFLAG_LEN) != 0) {
+ strncpy(tag.dualImage, args->second_image_flag_arg, DUALFLAG_LEN);
+ }
+ }
+
+ if (args->inactive_given) {
+ if (strncmp(args->inactive_arg, "2", INACTIVEFLAG_LEN) != 0) {
+ strncpy(tag.inactiveFlag, args->second_image_flag_arg, INACTIVEFLAG_LEN);
+ }
+ }
+
+ for (i = 0; i < NUM_PIRELLI; i++) {
+ if (strncmp(args->boardid_arg, pirellitab[i], BOARDID_LEN) == 0) {
+ is_pirelli = 1;
+ break;
+ }
+ }
+
+ if ( !is_pirelli ) {
+ int2tag(tag.imageCRC, kernelfscrc);
+ } else {
+ int2tag(tag.imageCRC, kernelcrc);
+ }
+
+ int2tag(&(tag.rootfsCRC[0]), rootfscrc);
+ int2tag(tag.kernelCRC, kernelcrc);
+ int2tag(tag.fskernelCRC, kernelfscrc);
+ int2tag(tag.headerCRC, crc32(IMAGETAG_CRC_START, (uint8_t*)&tag, sizeof(tag) - 20));
+
+ fseek(binfile, 0L, SEEK_SET);
+ fwrite(&tag, sizeof(uint8_t), sizeof(tag), binfile);
+
+ fflush(binfile);
+ fclose(binfile);
+
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ int c, i;
+ char *kernel, *rootfs, *bin;
+ uint32_t flash_start, image_offset, block_size, load_address, entry;
+ flash_start = image_offset = block_size = load_address = entry = 0;
+ struct gengetopt_args_info parsed_args;
+
+ kernel = rootfs = bin = NULL;
+
+ if (cmdline_parser(argc, argv, &parsed_args)) {
+ exit(1);
+ }
+
+ printf("Broadcom 63xx image tagger - v2.0.0\n");
+ printf("Copyright (C) 2008 Axel Gembe\n");
+ printf("Copyright (C) 2009-2010 Daniel Dickinson\n");
+ printf("Licensed under the terms of the Gnu General Public License\n");
+
+ kernel = parsed_args.kernel_arg;
+ rootfs = parsed_args.rootfs_arg;
+ bin = parsed_args.output_arg;
+ if (strlen(parsed_args.tag_version_arg) >= TAGVER_LEN) {
+ fprintf(stderr, "Error: Tag Version (tag_version,v) too long.\n");
+ exit(1);
+ }
+ if (strlen(parsed_args.boardid_arg) >= BOARDID_LEN) {
+ fprintf(stderr, "Error: Board ID (boardid,b) too long.\n");
+ exit(1);
+ }
+ if (strlen(parsed_args.chipid_arg) >= CHIPID_LEN) {
+ fprintf(stderr, "Error: Chip ID (chipid,c) too long.\n");
+ exit(1);
+ }
+ if (strlen(parsed_args.signature_arg) >= SIG1_LEN) {
+ fprintf(stderr, "Error: Magic string (signature,a) too long.\n");
+ exit(1);
+ }
+ if (strlen(parsed_args.signature2_arg) >= SIG2_LEN) {
+ fprintf(stderr, "Error: Second magic string (signature2,m) too long.\n");
+ exit(1);
+ }
+ if (parsed_args.layoutver_given) {
+ if (strlen(parsed_args.layoutver_arg) > FLASHLAYOUTVER_LEN) {
+ fprintf(stderr, "Error: Flash layout version (layoutver,y) too long.\n");
+ exit(1);
+ }
+ }
+ if (parsed_args.rsa_signature_given) {
+ if (strlen(parsed_args.rsa_signature_arg) > RSASIG_LEN) {
+ fprintf(stderr, "Error: RSA Signature (rsa_signature,r) too long.\n");
+ exit(1);
+ }
+ }
+
+ if (parsed_args.info1_given) {
+ if (strlen(parsed_args.info1_arg) >= TAGINFO1_LEN) {
+ fprintf(stderr, "Error: Vendor Information 1 (info1) too long.\n");
+ exit(1);
+ }
+ }
+
+ if (parsed_args.info2_given) {
+ if (strlen(parsed_args.info2_arg) >= TAGINFO2_LEN) {
+ fprintf(stderr, "Error: Vendor Information 2 (info2) too long.\n");
+ exit(1);
+ }
+ }
+
+ if (parsed_args.altinfo_given) {
+ if (strlen(parsed_args.altinfo_arg) >= ALTTAGINFO_LEN) {
+ fprintf(stderr, "Error: Vendor Information 1 (info1) too long.\n");
+ exit(1);
+ }
+ }
+
+ if (parsed_args.pad_given) {
+ if (parsed_args.pad_arg < 0) {
+ fprintf(stderr, "Error: pad size must be positive.\r");
+ exit(1);
+ }
+ }
+
+ flash_start = strtoul(parsed_args.flash_start_arg, NULL, 16);
+ image_offset = strtoul(parsed_args.image_offset_arg, NULL, 16);
+ block_size = strtoul(parsed_args.block_size_arg, NULL, 16);
+
+ if (!parsed_args.kernel_file_has_header_flag) {
+ load_address = strtoul(parsed_args.load_addr_arg, NULL, 16);
+ entry = strtoul(parsed_args.entry_arg, NULL, 16);
+ if (load_address == 0) {
+ fprintf(stderr, "Error: Invalid value for load address\n");
+ }
+ if (entry == 0) {
+ fprintf(stderr, "Error: Invalid value for entry\n");
+ }
+ }
+
+ return tagfile(kernel, rootfs, bin, &parsed_args, flash_start, image_offset, block_size, load_address, entry);
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/imagetag.ggo.svn-base b/tools/firmware-utils/src/.svn/text-base/imagetag.ggo.svn-base
new file mode 100644
index 0000000..7c9f943
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/imagetag.ggo.svn-base
@@ -0,0 +1,45 @@
+# Command line option parsing generator file for imagetag
+# Supplied-To: gengetopt
+#
+# Copyright 2010 Daniel Dickinson
+#
+# This file is subject to the terms and conditions of the GNU General Public
+# License. See the file "COPYING" in the main directory of this archive
+# for more details.
+#
+
+package "imagetag"
+version "2.0.0"
+purpose "Generate image with CFE imagetag for Broadcom 63xx routers."
+description "Copyright (C) 2008 Axel Gembe
+Copyright (C) 2009-2010 Daniel Dickinson
+Licensed unter the terms of the Gnu General Public License.
+
+Given a root filesystem, a linux kernel, and an optional CFE, generates an image with an imagetag for a Broadcom 63xx-based router. Additional parameters to be specified depend on the specfic brand and model of router."
+args "--file-name=imagetag_cmdline"
+
+option "kernel" i "File with LZMA compressed kernel to include in the image." string typestr="filename" required
+option "rootfs" f "File with RootFS to include in the image." string typestr="filename" required
+option "output" o "Name of output file." string typestr="filename" required
+option "cfe" - "File with CFE to include in the image." string typestr="filename" optional
+option "boardid" b "Board ID to set in the image (must match what router expects, e.g. \"96345GW2\")." string required
+option "chipid" c "Chip ID to set in the image (must match the actual hardware, e.g. \"6345\")." string required
+option "flash-start" s "Flash start address." string typestr="address" optional default="0xBFC00000"
+option "image-offset" n "Offset from start address for the first byte after the CFE (in memory)." string typestr="offset" default="0x10000" optional
+option "tag-version" v "Version number for imagetag format." string default="6" optional
+option "signature" a "Magic string (signature), for boards that need it." string default="Broadcom Corporatio" optional
+option "signature2" m "Second magic string (signature2)." string default="ver. 2.0" optional
+option "block-size" k "Flash erase block size." string optional default="0x10000"
+option "load-addr" l "Kernel load address." string typestr="address" required
+option "entry" e "Address where the kernel entry point will be for booting." string typestr="address" required
+option "layoutver" y "Flash layout version (version 2.2x of the Broadcom code requires this)." string optional
+option "info1" 1 "String for first vendor information section." string optional
+option "altinfo" - "String for vendor information section (alternate/pirelli)." string optional
+option "info2" 2 "String for second vendor information section." string optional
+option "root-first" - "Put the rootfs before the kernel (only for stock images, e.g. captured from the router's flash memory)." flag off
+option "rsa-signature" r "String for RSA Signature section." string optional
+option "second-image-flag" - "Dual Image Flag (2=not-specified)." values="0", "1", "2" default="2" typestr="flag-value" optional
+option "inactive" - "Inactive Flag (2=not-specified)." values="0", "1", "2" default="2" typestr="flag-value" optional
+option "reserved2" - "String for second reserved section." string optional
+option "kernel-file-has-header" - "Indicates that the kernel file includes the kernel header with correct load address and entry point, so no changes are needed" flag off
+option "pad" p "Pad the image to this size if smaller (in MiB)" int typestr="size (in MiB)" optional
diff --git a/tools/firmware-utils/src/.svn/text-base/imagetag_cmdline.c.svn-base b/tools/firmware-utils/src/.svn/text-base/imagetag_cmdline.c.svn-base
new file mode 100644
index 0000000..efb82ac
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/imagetag_cmdline.c.svn-base
@@ -0,0 +1,1174 @@
+/*
+ File autogenerated by gengetopt version 2.22.4
+ generated with the following command:
+ gengetopt --file-name=imagetag_cmdline --file-name=imagetag_cmdline
+
+ The developers of gengetopt consider the fixed text that goes in all
+ gengetopt output files to be in the public domain:
+ we make no copyright claims on it.
+*/
+
+/* If we use autoconf. */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include
+#include
+#include
+
+#ifndef FIX_UNUSED
+#define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
+#endif
+
+#include
+
+#include "imagetag_cmdline.h"
+
+const char *gengetopt_args_info_purpose = "Generate image with CFE imagetag for Broadcom 63xx routers.";
+
+const char *gengetopt_args_info_usage = "Usage: imagetag [OPTIONS]...";
+
+const char *gengetopt_args_info_description = "Copyright (C) 2008 Axel Gembe\nCopyright (C) 2009-2010 Daniel Dickinson\nLicensed unter the terms of the Gnu General Public License.\n\nGiven a root filesystem, a linux kernel, and an optional CFE, generates an \nimage with an imagetag for a Broadcom 63xx-based router. Additional parameters \nto be specified depend on the specfic brand and model of router.";
+
+const char *gengetopt_args_info_help[] = {
+ " -h, --help Print help and exit",
+ " -V, --version Print version and exit",
+ " -i, --kernel=filename File with LZMA compressed kernel to include in \n the image.",
+ " -f, --rootfs=filename File with RootFS to include in the image.",
+ " -o, --output=filename Name of output file.",
+ " --cfe=filename File with CFE to include in the image.",
+ " -b, --boardid=STRING Board ID to set in the image (must match what \n router expects, e.g. \"96345GW2\").",
+ " -c, --chipid=STRING Chip ID to set in the image (must match the \n actual hardware, e.g. \"6345\").",
+ " -s, --flash-start=address Flash start address. (default=`0xBFC00000')",
+ " -n, --image-offset=offset Offset from start address for the first byte \n after the CFE (in memory). \n (default=`0x10000')",
+ " -v, --tag-version=STRING Version number for imagetag format. \n (default=`6')",
+ " -a, --signature=STRING Magic string (signature), for boards that need \n it. (default=`Broadcom Corporatio')",
+ " -m, --signature2=STRING Second magic string (signature2). \n (default=`ver. 2.0')",
+ " -k, --block-size=STRING Flash erase block size. (default=`0x10000')",
+ " -l, --load-addr=address Kernel load address.",
+ " -e, --entry=address Address where the kernel entry point will be \n for booting.",
+ " -y, --layoutver=STRING Flash layout version (version 2.2x of the \n Broadcom code requires this).",
+ " -1, --info1=STRING String for first vendor information section.",
+ " --altinfo=STRING String for vendor information section \n (alternate/pirelli).",
+ " -2, --info2=STRING String for second vendor information section.",
+ " --root-first Put the rootfs before the kernel (only for \n stock images, e.g. captured from the router's \n flash memory). (default=off)",
+ " -r, --rsa-signature=STRING String for RSA Signature section.",
+ " --second-image-flag=flag-value\n Dual Image Flag (2=not-specified). (possible \n values=\"0\", \"1\", \"2\" default=`2')",
+ " --inactive=flag-value Inactive Flag (2=not-specified). (possible \n values=\"0\", \"1\", \"2\" default=`2')",
+ " --reserved2=STRING String for second reserved section.",
+ " --kernel-file-has-header Indicates that the kernel file includes the \n kernel header with correct load address and \n entry point, so no changes are needed \n (default=off)",
+ " -p, --pad=size (in MiB) Pad the image to this size if smaller (in MiB)",
+ 0
+};
+
+typedef enum {ARG_NO
+ , ARG_FLAG
+ , ARG_STRING
+ , ARG_INT
+} cmdline_parser_arg_type;
+
+static
+void clear_given (struct gengetopt_args_info *args_info);
+static
+void clear_args (struct gengetopt_args_info *args_info);
+
+static int
+cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info,
+ struct cmdline_parser_params *params, const char *additional_error);
+
+static int
+cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error);
+
+const char *cmdline_parser_second_image_flag_values[] = {"0", "1", "2", 0}; /*< Possible values for second-image-flag. */
+const char *cmdline_parser_inactive_values[] = {"0", "1", "2", 0}; /*< Possible values for inactive. */
+
+static char *
+gengetopt_strdup (const char *s);
+
+static
+void clear_given (struct gengetopt_args_info *args_info)
+{
+ args_info->help_given = 0 ;
+ args_info->version_given = 0 ;
+ args_info->kernel_given = 0 ;
+ args_info->rootfs_given = 0 ;
+ args_info->output_given = 0 ;
+ args_info->cfe_given = 0 ;
+ args_info->boardid_given = 0 ;
+ args_info->chipid_given = 0 ;
+ args_info->flash_start_given = 0 ;
+ args_info->image_offset_given = 0 ;
+ args_info->tag_version_given = 0 ;
+ args_info->signature_given = 0 ;
+ args_info->signature2_given = 0 ;
+ args_info->block_size_given = 0 ;
+ args_info->load_addr_given = 0 ;
+ args_info->entry_given = 0 ;
+ args_info->layoutver_given = 0 ;
+ args_info->info1_given = 0 ;
+ args_info->altinfo_given = 0 ;
+ args_info->info2_given = 0 ;
+ args_info->root_first_given = 0 ;
+ args_info->rsa_signature_given = 0 ;
+ args_info->second_image_flag_given = 0 ;
+ args_info->inactive_given = 0 ;
+ args_info->reserved2_given = 0 ;
+ args_info->kernel_file_has_header_given = 0 ;
+ args_info->pad_given = 0 ;
+}
+
+static
+void clear_args (struct gengetopt_args_info *args_info)
+{
+ FIX_UNUSED (args_info);
+ args_info->kernel_arg = NULL;
+ args_info->kernel_orig = NULL;
+ args_info->rootfs_arg = NULL;
+ args_info->rootfs_orig = NULL;
+ args_info->output_arg = NULL;
+ args_info->output_orig = NULL;
+ args_info->cfe_arg = NULL;
+ args_info->cfe_orig = NULL;
+ args_info->boardid_arg = NULL;
+ args_info->boardid_orig = NULL;
+ args_info->chipid_arg = NULL;
+ args_info->chipid_orig = NULL;
+ args_info->flash_start_arg = gengetopt_strdup ("0xBFC00000");
+ args_info->flash_start_orig = NULL;
+ args_info->image_offset_arg = gengetopt_strdup ("0x10000");
+ args_info->image_offset_orig = NULL;
+ args_info->tag_version_arg = gengetopt_strdup ("6");
+ args_info->tag_version_orig = NULL;
+ args_info->signature_arg = gengetopt_strdup ("Broadcom Corporatio");
+ args_info->signature_orig = NULL;
+ args_info->signature2_arg = gengetopt_strdup ("ver. 2.0");
+ args_info->signature2_orig = NULL;
+ args_info->block_size_arg = gengetopt_strdup ("0x10000");
+ args_info->block_size_orig = NULL;
+ args_info->load_addr_arg = NULL;
+ args_info->load_addr_orig = NULL;
+ args_info->entry_arg = NULL;
+ args_info->entry_orig = NULL;
+ args_info->layoutver_arg = NULL;
+ args_info->layoutver_orig = NULL;
+ args_info->info1_arg = NULL;
+ args_info->info1_orig = NULL;
+ args_info->altinfo_arg = NULL;
+ args_info->altinfo_orig = NULL;
+ args_info->info2_arg = NULL;
+ args_info->info2_orig = NULL;
+ args_info->root_first_flag = 0;
+ args_info->rsa_signature_arg = NULL;
+ args_info->rsa_signature_orig = NULL;
+ args_info->second_image_flag_arg = gengetopt_strdup ("2");
+ args_info->second_image_flag_orig = NULL;
+ args_info->inactive_arg = gengetopt_strdup ("2");
+ args_info->inactive_orig = NULL;
+ args_info->reserved2_arg = NULL;
+ args_info->reserved2_orig = NULL;
+ args_info->kernel_file_has_header_flag = 0;
+ args_info->pad_orig = NULL;
+
+}
+
+static
+void init_args_info(struct gengetopt_args_info *args_info)
+{
+
+
+ args_info->help_help = gengetopt_args_info_help[0] ;
+ args_info->version_help = gengetopt_args_info_help[1] ;
+ args_info->kernel_help = gengetopt_args_info_help[2] ;
+ args_info->rootfs_help = gengetopt_args_info_help[3] ;
+ args_info->output_help = gengetopt_args_info_help[4] ;
+ args_info->cfe_help = gengetopt_args_info_help[5] ;
+ args_info->boardid_help = gengetopt_args_info_help[6] ;
+ args_info->chipid_help = gengetopt_args_info_help[7] ;
+ args_info->flash_start_help = gengetopt_args_info_help[8] ;
+ args_info->image_offset_help = gengetopt_args_info_help[9] ;
+ args_info->tag_version_help = gengetopt_args_info_help[10] ;
+ args_info->signature_help = gengetopt_args_info_help[11] ;
+ args_info->signature2_help = gengetopt_args_info_help[12] ;
+ args_info->block_size_help = gengetopt_args_info_help[13] ;
+ args_info->load_addr_help = gengetopt_args_info_help[14] ;
+ args_info->entry_help = gengetopt_args_info_help[15] ;
+ args_info->layoutver_help = gengetopt_args_info_help[16] ;
+ args_info->info1_help = gengetopt_args_info_help[17] ;
+ args_info->altinfo_help = gengetopt_args_info_help[18] ;
+ args_info->info2_help = gengetopt_args_info_help[19] ;
+ args_info->root_first_help = gengetopt_args_info_help[20] ;
+ args_info->rsa_signature_help = gengetopt_args_info_help[21] ;
+ args_info->second_image_flag_help = gengetopt_args_info_help[22] ;
+ args_info->inactive_help = gengetopt_args_info_help[23] ;
+ args_info->reserved2_help = gengetopt_args_info_help[24] ;
+ args_info->kernel_file_has_header_help = gengetopt_args_info_help[25] ;
+ args_info->pad_help = gengetopt_args_info_help[26] ;
+
+}
+
+void
+cmdline_parser_print_version (void)
+{
+ printf ("%s %s\n",
+ (strlen(CMDLINE_PARSER_PACKAGE_NAME) ? CMDLINE_PARSER_PACKAGE_NAME : CMDLINE_PARSER_PACKAGE),
+ CMDLINE_PARSER_VERSION);
+}
+
+static void print_help_common(void) {
+ cmdline_parser_print_version ();
+
+ if (strlen(gengetopt_args_info_purpose) > 0)
+ printf("\n%s\n", gengetopt_args_info_purpose);
+
+ if (strlen(gengetopt_args_info_usage) > 0)
+ printf("\n%s\n", gengetopt_args_info_usage);
+
+ printf("\n");
+
+ if (strlen(gengetopt_args_info_description) > 0)
+ printf("%s\n\n", gengetopt_args_info_description);
+}
+
+void
+cmdline_parser_print_help (void)
+{
+ int i = 0;
+ print_help_common();
+ while (gengetopt_args_info_help[i])
+ printf("%s\n", gengetopt_args_info_help[i++]);
+}
+
+void
+cmdline_parser_init (struct gengetopt_args_info *args_info)
+{
+ clear_given (args_info);
+ clear_args (args_info);
+ init_args_info (args_info);
+}
+
+void
+cmdline_parser_params_init(struct cmdline_parser_params *params)
+{
+ if (params)
+ {
+ params->override = 0;
+ params->initialize = 1;
+ params->check_required = 1;
+ params->check_ambiguity = 0;
+ params->print_errors = 1;
+ }
+}
+
+struct cmdline_parser_params *
+cmdline_parser_params_create(void)
+{
+ struct cmdline_parser_params *params =
+ (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params));
+ cmdline_parser_params_init(params);
+ return params;
+}
+
+static void
+free_string_field (char **s)
+{
+ if (*s)
+ {
+ free (*s);
+ *s = 0;
+ }
+}
+
+
+static void
+cmdline_parser_release (struct gengetopt_args_info *args_info)
+{
+
+ free_string_field (&(args_info->kernel_arg));
+ free_string_field (&(args_info->kernel_orig));
+ free_string_field (&(args_info->rootfs_arg));
+ free_string_field (&(args_info->rootfs_orig));
+ free_string_field (&(args_info->output_arg));
+ free_string_field (&(args_info->output_orig));
+ free_string_field (&(args_info->cfe_arg));
+ free_string_field (&(args_info->cfe_orig));
+ free_string_field (&(args_info->boardid_arg));
+ free_string_field (&(args_info->boardid_orig));
+ free_string_field (&(args_info->chipid_arg));
+ free_string_field (&(args_info->chipid_orig));
+ free_string_field (&(args_info->flash_start_arg));
+ free_string_field (&(args_info->flash_start_orig));
+ free_string_field (&(args_info->image_offset_arg));
+ free_string_field (&(args_info->image_offset_orig));
+ free_string_field (&(args_info->tag_version_arg));
+ free_string_field (&(args_info->tag_version_orig));
+ free_string_field (&(args_info->signature_arg));
+ free_string_field (&(args_info->signature_orig));
+ free_string_field (&(args_info->signature2_arg));
+ free_string_field (&(args_info->signature2_orig));
+ free_string_field (&(args_info->block_size_arg));
+ free_string_field (&(args_info->block_size_orig));
+ free_string_field (&(args_info->load_addr_arg));
+ free_string_field (&(args_info->load_addr_orig));
+ free_string_field (&(args_info->entry_arg));
+ free_string_field (&(args_info->entry_orig));
+ free_string_field (&(args_info->layoutver_arg));
+ free_string_field (&(args_info->layoutver_orig));
+ free_string_field (&(args_info->info1_arg));
+ free_string_field (&(args_info->info1_orig));
+ free_string_field (&(args_info->altinfo_arg));
+ free_string_field (&(args_info->altinfo_orig));
+ free_string_field (&(args_info->info2_arg));
+ free_string_field (&(args_info->info2_orig));
+ free_string_field (&(args_info->rsa_signature_arg));
+ free_string_field (&(args_info->rsa_signature_orig));
+ free_string_field (&(args_info->second_image_flag_arg));
+ free_string_field (&(args_info->second_image_flag_orig));
+ free_string_field (&(args_info->inactive_arg));
+ free_string_field (&(args_info->inactive_orig));
+ free_string_field (&(args_info->reserved2_arg));
+ free_string_field (&(args_info->reserved2_orig));
+ free_string_field (&(args_info->pad_orig));
+
+
+
+ clear_given (args_info);
+}
+
+/**
+ * @param val the value to check
+ * @param values the possible values
+ * @return the index of the matched value:
+ * -1 if no value matched,
+ * -2 if more than one value has matched
+ */
+static int
+check_possible_values(const char *val, const char *values[])
+{
+ int i, found, last;
+ size_t len;
+
+ if (!val) /* otherwise strlen() crashes below */
+ return -1; /* -1 means no argument for the option */
+
+ found = last = 0;
+
+ for (i = 0, len = strlen(val); values[i]; ++i)
+ {
+ if (strncmp(val, values[i], len) == 0)
+ {
+ ++found;
+ last = i;
+ if (strlen(values[i]) == len)
+ return i; /* exact macth no need to check more */
+ }
+ }
+
+ if (found == 1) /* one match: OK */
+ return last;
+
+ return (found ? -2 : -1); /* return many values or none matched */
+}
+
+
+static void
+write_into_file(FILE *outfile, const char *opt, const char *arg, const char *values[])
+{
+ int found = -1;
+ if (arg) {
+ if (values) {
+ found = check_possible_values(arg, values);
+ }
+ if (found >= 0)
+ fprintf(outfile, "%s=\"%s\" # %s\n", opt, arg, values[found]);
+ else
+ fprintf(outfile, "%s=\"%s\"\n", opt, arg);
+ } else {
+ fprintf(outfile, "%s\n", opt);
+ }
+}
+
+
+int
+cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
+{
+ int i = 0;
+
+ if (!outfile)
+ {
+ fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE);
+ return EXIT_FAILURE;
+ }
+
+ if (args_info->help_given)
+ write_into_file(outfile, "help", 0, 0 );
+ if (args_info->version_given)
+ write_into_file(outfile, "version", 0, 0 );
+ if (args_info->kernel_given)
+ write_into_file(outfile, "kernel", args_info->kernel_orig, 0);
+ if (args_info->rootfs_given)
+ write_into_file(outfile, "rootfs", args_info->rootfs_orig, 0);
+ if (args_info->output_given)
+ write_into_file(outfile, "output", args_info->output_orig, 0);
+ if (args_info->cfe_given)
+ write_into_file(outfile, "cfe", args_info->cfe_orig, 0);
+ if (args_info->boardid_given)
+ write_into_file(outfile, "boardid", args_info->boardid_orig, 0);
+ if (args_info->chipid_given)
+ write_into_file(outfile, "chipid", args_info->chipid_orig, 0);
+ if (args_info->flash_start_given)
+ write_into_file(outfile, "flash-start", args_info->flash_start_orig, 0);
+ if (args_info->image_offset_given)
+ write_into_file(outfile, "image-offset", args_info->image_offset_orig, 0);
+ if (args_info->tag_version_given)
+ write_into_file(outfile, "tag-version", args_info->tag_version_orig, 0);
+ if (args_info->signature_given)
+ write_into_file(outfile, "signature", args_info->signature_orig, 0);
+ if (args_info->signature2_given)
+ write_into_file(outfile, "signature2", args_info->signature2_orig, 0);
+ if (args_info->block_size_given)
+ write_into_file(outfile, "block-size", args_info->block_size_orig, 0);
+ if (args_info->load_addr_given)
+ write_into_file(outfile, "load-addr", args_info->load_addr_orig, 0);
+ if (args_info->entry_given)
+ write_into_file(outfile, "entry", args_info->entry_orig, 0);
+ if (args_info->layoutver_given)
+ write_into_file(outfile, "layoutver", args_info->layoutver_orig, 0);
+ if (args_info->info1_given)
+ write_into_file(outfile, "info1", args_info->info1_orig, 0);
+ if (args_info->altinfo_given)
+ write_into_file(outfile, "altinfo", args_info->altinfo_orig, 0);
+ if (args_info->info2_given)
+ write_into_file(outfile, "info2", args_info->info2_orig, 0);
+ if (args_info->root_first_given)
+ write_into_file(outfile, "root-first", 0, 0 );
+ if (args_info->rsa_signature_given)
+ write_into_file(outfile, "rsa-signature", args_info->rsa_signature_orig, 0);
+ if (args_info->second_image_flag_given)
+ write_into_file(outfile, "second-image-flag", args_info->second_image_flag_orig, cmdline_parser_second_image_flag_values);
+ if (args_info->inactive_given)
+ write_into_file(outfile, "inactive", args_info->inactive_orig, cmdline_parser_inactive_values);
+ if (args_info->reserved2_given)
+ write_into_file(outfile, "reserved2", args_info->reserved2_orig, 0);
+ if (args_info->kernel_file_has_header_given)
+ write_into_file(outfile, "kernel-file-has-header", 0, 0 );
+ if (args_info->pad_given)
+ write_into_file(outfile, "pad", args_info->pad_orig, 0);
+
+
+ i = EXIT_SUCCESS;
+ return i;
+}
+
+int
+cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
+{
+ FILE *outfile;
+ int i = 0;
+
+ outfile = fopen(filename, "w");
+
+ if (!outfile)
+ {
+ fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename);
+ return EXIT_FAILURE;
+ }
+
+ i = cmdline_parser_dump(outfile, args_info);
+ fclose (outfile);
+
+ return i;
+}
+
+void
+cmdline_parser_free (struct gengetopt_args_info *args_info)
+{
+ cmdline_parser_release (args_info);
+}
+
+/** @brief replacement of strdup, which is not standard */
+char *
+gengetopt_strdup (const char *s)
+{
+ char *result = 0;
+ if (!s)
+ return result;
+
+ result = (char*)malloc(strlen(s) + 1);
+ if (result == (char*)0)
+ return (char*)0;
+ strcpy(result, s);
+ return result;
+}
+
+int
+cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
+{
+ return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
+}
+
+int
+cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info,
+ struct cmdline_parser_params *params)
+{
+ int result;
+ result = cmdline_parser_internal (argc, argv, args_info, params, 0);
+
+ if (result == EXIT_FAILURE)
+ {
+ cmdline_parser_free (args_info);
+ exit (EXIT_FAILURE);
+ }
+
+ return result;
+}
+
+int
+cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
+{
+ int result;
+ struct cmdline_parser_params params;
+
+ params.override = override;
+ params.initialize = initialize;
+ params.check_required = check_required;
+ params.check_ambiguity = 0;
+ params.print_errors = 1;
+
+ result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0);
+
+ if (result == EXIT_FAILURE)
+ {
+ cmdline_parser_free (args_info);
+ exit (EXIT_FAILURE);
+ }
+
+ return result;
+}
+
+int
+cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
+{
+ int result = EXIT_SUCCESS;
+
+ if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
+ result = EXIT_FAILURE;
+
+ if (result == EXIT_FAILURE)
+ {
+ cmdline_parser_free (args_info);
+ exit (EXIT_FAILURE);
+ }
+
+ return result;
+}
+
+int
+cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
+{
+ int error = 0;
+ FIX_UNUSED (additional_error);
+
+ /* checks for required options */
+ if (! args_info->kernel_given)
+ {
+ fprintf (stderr, "%s: '--kernel' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : ""));
+ error = 1;
+ }
+
+ if (! args_info->rootfs_given)
+ {
+ fprintf (stderr, "%s: '--rootfs' ('-f') option required%s\n", prog_name, (additional_error ? additional_error : ""));
+ error = 1;
+ }
+
+ if (! args_info->output_given)
+ {
+ fprintf (stderr, "%s: '--output' ('-o') option required%s\n", prog_name, (additional_error ? additional_error : ""));
+ error = 1;
+ }
+
+ if (! args_info->boardid_given)
+ {
+ fprintf (stderr, "%s: '--boardid' ('-b') option required%s\n", prog_name, (additional_error ? additional_error : ""));
+ error = 1;
+ }
+
+ if (! args_info->chipid_given)
+ {
+ fprintf (stderr, "%s: '--chipid' ('-c') option required%s\n", prog_name, (additional_error ? additional_error : ""));
+ error = 1;
+ }
+
+ if (! args_info->load_addr_given)
+ {
+ fprintf (stderr, "%s: '--load-addr' ('-l') option required%s\n", prog_name, (additional_error ? additional_error : ""));
+ error = 1;
+ }
+
+ if (! args_info->entry_given)
+ {
+ fprintf (stderr, "%s: '--entry' ('-e') option required%s\n", prog_name, (additional_error ? additional_error : ""));
+ error = 1;
+ }
+
+
+ /* checks for dependences among options */
+
+ return error;
+}
+
+
+static char *package_name = 0;
+
+/**
+ * @brief updates an option
+ * @param field the generic pointer to the field to update
+ * @param orig_field the pointer to the orig field
+ * @param field_given the pointer to the number of occurrence of this option
+ * @param prev_given the pointer to the number of occurrence already seen
+ * @param value the argument for this option (if null no arg was specified)
+ * @param possible_values the possible values for this option (if specified)
+ * @param default_value the default value (in case the option only accepts fixed values)
+ * @param arg_type the type of this option
+ * @param check_ambiguity @see cmdline_parser_params.check_ambiguity
+ * @param override @see cmdline_parser_params.override
+ * @param no_free whether to free a possible previous value
+ * @param multiple_option whether this is a multiple option
+ * @param long_opt the corresponding long option
+ * @param short_opt the corresponding short option (or '-' if none)
+ * @param additional_error possible further error specification
+ */
+static
+int update_arg(void *field, char **orig_field,
+ unsigned int *field_given, unsigned int *prev_given,
+ char *value, const char *possible_values[],
+ const char *default_value,
+ cmdline_parser_arg_type arg_type,
+ int check_ambiguity, int override,
+ int no_free, int multiple_option,
+ const char *long_opt, char short_opt,
+ const char *additional_error)
+{
+ char *stop_char = 0;
+ const char *val = value;
+ int found;
+ char **string_field;
+ FIX_UNUSED (field);
+
+ stop_char = 0;
+ found = 0;
+
+ if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given)))
+ {
+ if (short_opt != '-')
+ fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n",
+ package_name, long_opt, short_opt,
+ (additional_error ? additional_error : ""));
+ else
+ fprintf (stderr, "%s: `--%s' option given more than once%s\n",
+ package_name, long_opt,
+ (additional_error ? additional_error : ""));
+ return 1; /* failure */
+ }
+
+ if (possible_values && (found = check_possible_values((value ? value : default_value), possible_values)) < 0)
+ {
+ if (short_opt != '-')
+ fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s' (`-%c')%s\n",
+ package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt, short_opt,
+ (additional_error ? additional_error : ""));
+ else
+ fprintf (stderr, "%s: %s argument, \"%s\", for option `--%s'%s\n",
+ package_name, (found == -2) ? "ambiguous" : "invalid", value, long_opt,
+ (additional_error ? additional_error : ""));
+ return 1; /* failure */
+ }
+
+ if (field_given && *field_given && ! override)
+ return 0;
+ if (prev_given)
+ (*prev_given)++;
+ if (field_given)
+ (*field_given)++;
+ if (possible_values)
+ val = possible_values[found];
+
+ switch(arg_type) {
+ case ARG_FLAG:
+ *((int *)field) = !*((int *)field);
+ break;
+ case ARG_INT:
+ if (val) *((int *)field) = strtol (val, &stop_char, 0);
+ break;
+ case ARG_STRING:
+ if (val) {
+ string_field = (char **)field;
+ if (!no_free && *string_field)
+ free (*string_field); /* free previous string */
+ *string_field = gengetopt_strdup (val);
+ }
+ break;
+ default:
+ break;
+ };
+
+ /* check numeric conversion */
+ switch(arg_type) {
+ case ARG_INT:
+ if (val && !(stop_char && *stop_char == '\0')) {
+ fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val);
+ return 1; /* failure */
+ }
+ break;
+ default:
+ ;
+ };
+
+ /* store the original value */
+ switch(arg_type) {
+ case ARG_NO:
+ case ARG_FLAG:
+ break;
+ default:
+ if (value && orig_field) {
+ if (no_free) {
+ *orig_field = value;
+ } else {
+ if (*orig_field)
+ free (*orig_field); /* free previous string */
+ *orig_field = gengetopt_strdup (value);
+ }
+ }
+ };
+
+ return 0; /* OK */
+}
+
+
+int
+cmdline_parser_internal (
+ int argc, char **argv, struct gengetopt_args_info *args_info,
+ struct cmdline_parser_params *params, const char *additional_error)
+{
+ int c; /* Character of the parsed option. */
+
+ int error = 0;
+ struct gengetopt_args_info local_args_info;
+
+ int override;
+ int initialize;
+ int check_required;
+ int check_ambiguity;
+
+ package_name = argv[0];
+
+ override = params->override;
+ initialize = params->initialize;
+ check_required = params->check_required;
+ check_ambiguity = params->check_ambiguity;
+
+ if (initialize)
+ cmdline_parser_init (args_info);
+
+ cmdline_parser_init (&local_args_info);
+
+ optarg = 0;
+ optind = 0;
+ opterr = params->print_errors;
+ optopt = '?';
+
+ while (1)
+ {
+ int option_index = 0;
+
+ static struct option long_options[] = {
+ { "help", 0, NULL, 'h' },
+ { "version", 0, NULL, 'V' },
+ { "kernel", 1, NULL, 'i' },
+ { "rootfs", 1, NULL, 'f' },
+ { "output", 1, NULL, 'o' },
+ { "cfe", 1, NULL, 0 },
+ { "boardid", 1, NULL, 'b' },
+ { "chipid", 1, NULL, 'c' },
+ { "flash-start", 1, NULL, 's' },
+ { "image-offset", 1, NULL, 'n' },
+ { "tag-version", 1, NULL, 'v' },
+ { "signature", 1, NULL, 'a' },
+ { "signature2", 1, NULL, 'm' },
+ { "block-size", 1, NULL, 'k' },
+ { "load-addr", 1, NULL, 'l' },
+ { "entry", 1, NULL, 'e' },
+ { "layoutver", 1, NULL, 'y' },
+ { "info1", 1, NULL, '1' },
+ { "altinfo", 1, NULL, 0 },
+ { "info2", 1, NULL, '2' },
+ { "root-first", 0, NULL, 0 },
+ { "rsa-signature", 1, NULL, 'r' },
+ { "second-image-flag", 1, NULL, 0 },
+ { "inactive", 1, NULL, 0 },
+ { "reserved2", 1, NULL, 0 },
+ { "kernel-file-has-header", 0, NULL, 0 },
+ { "pad", 1, NULL, 'p' },
+ { 0, 0, 0, 0 }
+ };
+
+ c = getopt_long (argc, argv, "hVi:f:o:b:c:s:n:v:a:m:k:l:e:y:1:2:r:p:", long_options, &option_index);
+
+ if (c == -1) break; /* Exit from `while (1)' loop. */
+
+ switch (c)
+ {
+ case 'h': /* Print help and exit. */
+ cmdline_parser_print_help ();
+ cmdline_parser_free (&local_args_info);
+ exit (EXIT_SUCCESS);
+
+ case 'V': /* Print version and exit. */
+ cmdline_parser_print_version ();
+ cmdline_parser_free (&local_args_info);
+ exit (EXIT_SUCCESS);
+
+ case 'i': /* File with LZMA compressed kernel to include in the image.. */
+
+
+ if (update_arg( (void *)&(args_info->kernel_arg),
+ &(args_info->kernel_orig), &(args_info->kernel_given),
+ &(local_args_info.kernel_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "kernel", 'i',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'f': /* File with RootFS to include in the image.. */
+
+
+ if (update_arg( (void *)&(args_info->rootfs_arg),
+ &(args_info->rootfs_orig), &(args_info->rootfs_given),
+ &(local_args_info.rootfs_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "rootfs", 'f',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'o': /* Name of output file.. */
+
+
+ if (update_arg( (void *)&(args_info->output_arg),
+ &(args_info->output_orig), &(args_info->output_given),
+ &(local_args_info.output_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "output", 'o',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'b': /* Board ID to set in the image (must match what router expects, e.g. \"96345GW2\").. */
+
+
+ if (update_arg( (void *)&(args_info->boardid_arg),
+ &(args_info->boardid_orig), &(args_info->boardid_given),
+ &(local_args_info.boardid_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "boardid", 'b',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'c': /* Chip ID to set in the image (must match the actual hardware, e.g. \"6345\").. */
+
+
+ if (update_arg( (void *)&(args_info->chipid_arg),
+ &(args_info->chipid_orig), &(args_info->chipid_given),
+ &(local_args_info.chipid_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "chipid", 'c',
+ additional_error))
+ goto failure;
+
+ break;
+ case 's': /* Flash start address.. */
+
+
+ if (update_arg( (void *)&(args_info->flash_start_arg),
+ &(args_info->flash_start_orig), &(args_info->flash_start_given),
+ &(local_args_info.flash_start_given), optarg, 0, "0xBFC00000", ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "flash-start", 's',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'n': /* Offset from start address for the first byte after the CFE (in memory).. */
+
+
+ if (update_arg( (void *)&(args_info->image_offset_arg),
+ &(args_info->image_offset_orig), &(args_info->image_offset_given),
+ &(local_args_info.image_offset_given), optarg, 0, "0x10000", ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "image-offset", 'n',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'v': /* Version number for imagetag format.. */
+
+
+ if (update_arg( (void *)&(args_info->tag_version_arg),
+ &(args_info->tag_version_orig), &(args_info->tag_version_given),
+ &(local_args_info.tag_version_given), optarg, 0, "6", ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "tag-version", 'v',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'a': /* Magic string (signature), for boards that need it.. */
+
+
+ if (update_arg( (void *)&(args_info->signature_arg),
+ &(args_info->signature_orig), &(args_info->signature_given),
+ &(local_args_info.signature_given), optarg, 0, "Broadcom Corporatio", ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "signature", 'a',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'm': /* Second magic string (signature2).. */
+
+
+ if (update_arg( (void *)&(args_info->signature2_arg),
+ &(args_info->signature2_orig), &(args_info->signature2_given),
+ &(local_args_info.signature2_given), optarg, 0, "ver. 2.0", ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "signature2", 'm',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'k': /* Flash erase block size.. */
+
+
+ if (update_arg( (void *)&(args_info->block_size_arg),
+ &(args_info->block_size_orig), &(args_info->block_size_given),
+ &(local_args_info.block_size_given), optarg, 0, "0x10000", ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "block-size", 'k',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'l': /* Kernel load address.. */
+
+
+ if (update_arg( (void *)&(args_info->load_addr_arg),
+ &(args_info->load_addr_orig), &(args_info->load_addr_given),
+ &(local_args_info.load_addr_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "load-addr", 'l',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'e': /* Address where the kernel entry point will be for booting.. */
+
+
+ if (update_arg( (void *)&(args_info->entry_arg),
+ &(args_info->entry_orig), &(args_info->entry_given),
+ &(local_args_info.entry_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "entry", 'e',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'y': /* Flash layout version (version 2.2x of the Broadcom code requires this).. */
+
+
+ if (update_arg( (void *)&(args_info->layoutver_arg),
+ &(args_info->layoutver_orig), &(args_info->layoutver_given),
+ &(local_args_info.layoutver_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "layoutver", 'y',
+ additional_error))
+ goto failure;
+
+ break;
+ case '1': /* String for first vendor information section.. */
+
+
+ if (update_arg( (void *)&(args_info->info1_arg),
+ &(args_info->info1_orig), &(args_info->info1_given),
+ &(local_args_info.info1_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "info1", '1',
+ additional_error))
+ goto failure;
+
+ break;
+ case '2': /* String for second vendor information section.. */
+
+
+ if (update_arg( (void *)&(args_info->info2_arg),
+ &(args_info->info2_orig), &(args_info->info2_given),
+ &(local_args_info.info2_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "info2", '2',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'r': /* String for RSA Signature section.. */
+
+
+ if (update_arg( (void *)&(args_info->rsa_signature_arg),
+ &(args_info->rsa_signature_orig), &(args_info->rsa_signature_given),
+ &(local_args_info.rsa_signature_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "rsa-signature", 'r',
+ additional_error))
+ goto failure;
+
+ break;
+ case 'p': /* Pad the image to this size if smaller (in MiB). */
+
+
+ if (update_arg( (void *)&(args_info->pad_arg),
+ &(args_info->pad_orig), &(args_info->pad_given),
+ &(local_args_info.pad_given), optarg, 0, 0, ARG_INT,
+ check_ambiguity, override, 0, 0,
+ "pad", 'p',
+ additional_error))
+ goto failure;
+
+ break;
+
+ case 0: /* Long option with no short option */
+ /* File with CFE to include in the image.. */
+ if (strcmp (long_options[option_index].name, "cfe") == 0)
+ {
+
+
+ if (update_arg( (void *)&(args_info->cfe_arg),
+ &(args_info->cfe_orig), &(args_info->cfe_given),
+ &(local_args_info.cfe_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "cfe", '-',
+ additional_error))
+ goto failure;
+
+ }
+ /* String for vendor information section (alternate/pirelli).. */
+ else if (strcmp (long_options[option_index].name, "altinfo") == 0)
+ {
+
+
+ if (update_arg( (void *)&(args_info->altinfo_arg),
+ &(args_info->altinfo_orig), &(args_info->altinfo_given),
+ &(local_args_info.altinfo_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "altinfo", '-',
+ additional_error))
+ goto failure;
+
+ }
+ /* Put the rootfs before the kernel (only for stock images, e.g. captured from the router's flash memory).. */
+ else if (strcmp (long_options[option_index].name, "root-first") == 0)
+ {
+
+
+ if (update_arg((void *)&(args_info->root_first_flag), 0, &(args_info->root_first_given),
+ &(local_args_info.root_first_given), optarg, 0, 0, ARG_FLAG,
+ check_ambiguity, override, 1, 0, "root-first", '-',
+ additional_error))
+ goto failure;
+
+ }
+ /* Dual Image Flag (2=not-specified).. */
+ else if (strcmp (long_options[option_index].name, "second-image-flag") == 0)
+ {
+
+
+ if (update_arg( (void *)&(args_info->second_image_flag_arg),
+ &(args_info->second_image_flag_orig), &(args_info->second_image_flag_given),
+ &(local_args_info.second_image_flag_given), optarg, cmdline_parser_second_image_flag_values, "2", ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "second-image-flag", '-',
+ additional_error))
+ goto failure;
+
+ }
+ /* Inactive Flag (2=not-specified).. */
+ else if (strcmp (long_options[option_index].name, "inactive") == 0)
+ {
+
+
+ if (update_arg( (void *)&(args_info->inactive_arg),
+ &(args_info->inactive_orig), &(args_info->inactive_given),
+ &(local_args_info.inactive_given), optarg, cmdline_parser_inactive_values, "2", ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "inactive", '-',
+ additional_error))
+ goto failure;
+
+ }
+ /* String for second reserved section.. */
+ else if (strcmp (long_options[option_index].name, "reserved2") == 0)
+ {
+
+
+ if (update_arg( (void *)&(args_info->reserved2_arg),
+ &(args_info->reserved2_orig), &(args_info->reserved2_given),
+ &(local_args_info.reserved2_given), optarg, 0, 0, ARG_STRING,
+ check_ambiguity, override, 0, 0,
+ "reserved2", '-',
+ additional_error))
+ goto failure;
+
+ }
+ /* Indicates that the kernel file includes the kernel header with correct load address and entry point, so no changes are needed. */
+ else if (strcmp (long_options[option_index].name, "kernel-file-has-header") == 0)
+ {
+
+
+ if (update_arg((void *)&(args_info->kernel_file_has_header_flag), 0, &(args_info->kernel_file_has_header_given),
+ &(local_args_info.kernel_file_has_header_given), optarg, 0, 0, ARG_FLAG,
+ check_ambiguity, override, 1, 0, "kernel-file-has-header", '-',
+ additional_error))
+ goto failure;
+
+ }
+
+ break;
+ case '?': /* Invalid option. */
+ /* `getopt_long' already printed an error message. */
+ goto failure;
+
+ default: /* bug: option not considered. */
+ fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : ""));
+ abort ();
+ } /* switch */
+ } /* while */
+
+
+
+ if (check_required)
+ {
+ error += cmdline_parser_required2 (args_info, argv[0], additional_error);
+ }
+
+ cmdline_parser_release (&local_args_info);
+
+ if ( error )
+ return (EXIT_FAILURE);
+
+ return 0;
+
+failure:
+
+ cmdline_parser_release (&local_args_info);
+ return (EXIT_FAILURE);
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/imagetag_cmdline.h.svn-base b/tools/firmware-utils/src/.svn/text-base/imagetag_cmdline.h.svn-base
new file mode 100644
index 0000000..a6fd389
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/imagetag_cmdline.h.svn-base
@@ -0,0 +1,272 @@
+/** @file imagetag_cmdline.h
+ * @brief The header file for the command line option parser
+ * generated by GNU Gengetopt version 2.22.4
+ * http://www.gnu.org/software/gengetopt.
+ * DO NOT modify this file, since it can be overwritten
+ * @author GNU Gengetopt by Lorenzo Bettini */
+
+#ifndef IMAGETAG_CMDLINE_H
+#define IMAGETAG_CMDLINE_H
+
+/* If we use autoconf. */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include /* for FILE */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#ifndef CMDLINE_PARSER_PACKAGE
+/** @brief the program name (used for printing errors) */
+#define CMDLINE_PARSER_PACKAGE "imagetag"
+#endif
+
+#ifndef CMDLINE_PARSER_PACKAGE_NAME
+/** @brief the complete program name (used for help and version) */
+#define CMDLINE_PARSER_PACKAGE_NAME "imagetag"
+#endif
+
+#ifndef CMDLINE_PARSER_VERSION
+/** @brief the program version */
+#define CMDLINE_PARSER_VERSION "2.0.0"
+#endif
+
+/** @brief Where the command line options are stored */
+struct gengetopt_args_info
+{
+ const char *help_help; /**< @brief Print help and exit help description. */
+ const char *version_help; /**< @brief Print version and exit help description. */
+ char * kernel_arg; /**< @brief File with LZMA compressed kernel to include in the image.. */
+ char * kernel_orig; /**< @brief File with LZMA compressed kernel to include in the image. original value given at command line. */
+ const char *kernel_help; /**< @brief File with LZMA compressed kernel to include in the image. help description. */
+ char * rootfs_arg; /**< @brief File with RootFS to include in the image.. */
+ char * rootfs_orig; /**< @brief File with RootFS to include in the image. original value given at command line. */
+ const char *rootfs_help; /**< @brief File with RootFS to include in the image. help description. */
+ char * output_arg; /**< @brief Name of output file.. */
+ char * output_orig; /**< @brief Name of output file. original value given at command line. */
+ const char *output_help; /**< @brief Name of output file. help description. */
+ char * cfe_arg; /**< @brief File with CFE to include in the image.. */
+ char * cfe_orig; /**< @brief File with CFE to include in the image. original value given at command line. */
+ const char *cfe_help; /**< @brief File with CFE to include in the image. help description. */
+ char * boardid_arg; /**< @brief Board ID to set in the image (must match what router expects, e.g. \"96345GW2\").. */
+ char * boardid_orig; /**< @brief Board ID to set in the image (must match what router expects, e.g. \"96345GW2\"). original value given at command line. */
+ const char *boardid_help; /**< @brief Board ID to set in the image (must match what router expects, e.g. \"96345GW2\"). help description. */
+ char * chipid_arg; /**< @brief Chip ID to set in the image (must match the actual hardware, e.g. \"6345\").. */
+ char * chipid_orig; /**< @brief Chip ID to set in the image (must match the actual hardware, e.g. \"6345\"). original value given at command line. */
+ const char *chipid_help; /**< @brief Chip ID to set in the image (must match the actual hardware, e.g. \"6345\"). help description. */
+ char * flash_start_arg; /**< @brief Flash start address. (default='0xBFC00000'). */
+ char * flash_start_orig; /**< @brief Flash start address. original value given at command line. */
+ const char *flash_start_help; /**< @brief Flash start address. help description. */
+ char * image_offset_arg; /**< @brief Offset from start address for the first byte after the CFE (in memory). (default='0x10000'). */
+ char * image_offset_orig; /**< @brief Offset from start address for the first byte after the CFE (in memory). original value given at command line. */
+ const char *image_offset_help; /**< @brief Offset from start address for the first byte after the CFE (in memory). help description. */
+ char * tag_version_arg; /**< @brief Version number for imagetag format. (default='6'). */
+ char * tag_version_orig; /**< @brief Version number for imagetag format. original value given at command line. */
+ const char *tag_version_help; /**< @brief Version number for imagetag format. help description. */
+ char * signature_arg; /**< @brief Magic string (signature), for boards that need it. (default='Broadcom Corporatio'). */
+ char * signature_orig; /**< @brief Magic string (signature), for boards that need it. original value given at command line. */
+ const char *signature_help; /**< @brief Magic string (signature), for boards that need it. help description. */
+ char * signature2_arg; /**< @brief Second magic string (signature2). (default='ver. 2.0'). */
+ char * signature2_orig; /**< @brief Second magic string (signature2). original value given at command line. */
+ const char *signature2_help; /**< @brief Second magic string (signature2). help description. */
+ char * block_size_arg; /**< @brief Flash erase block size. (default='0x10000'). */
+ char * block_size_orig; /**< @brief Flash erase block size. original value given at command line. */
+ const char *block_size_help; /**< @brief Flash erase block size. help description. */
+ char * load_addr_arg; /**< @brief Kernel load address.. */
+ char * load_addr_orig; /**< @brief Kernel load address. original value given at command line. */
+ const char *load_addr_help; /**< @brief Kernel load address. help description. */
+ char * entry_arg; /**< @brief Address where the kernel entry point will be for booting.. */
+ char * entry_orig; /**< @brief Address where the kernel entry point will be for booting. original value given at command line. */
+ const char *entry_help; /**< @brief Address where the kernel entry point will be for booting. help description. */
+ char * layoutver_arg; /**< @brief Flash layout version (version 2.2x of the Broadcom code requires this).. */
+ char * layoutver_orig; /**< @brief Flash layout version (version 2.2x of the Broadcom code requires this). original value given at command line. */
+ const char *layoutver_help; /**< @brief Flash layout version (version 2.2x of the Broadcom code requires this). help description. */
+ char * info1_arg; /**< @brief String for first vendor information section.. */
+ char * info1_orig; /**< @brief String for first vendor information section. original value given at command line. */
+ const char *info1_help; /**< @brief String for first vendor information section. help description. */
+ char * altinfo_arg; /**< @brief String for vendor information section (alternate/pirelli).. */
+ char * altinfo_orig; /**< @brief String for vendor information section (alternate/pirelli). original value given at command line. */
+ const char *altinfo_help; /**< @brief String for vendor information section (alternate/pirelli). help description. */
+ char * info2_arg; /**< @brief String for second vendor information section.. */
+ char * info2_orig; /**< @brief String for second vendor information section. original value given at command line. */
+ const char *info2_help; /**< @brief String for second vendor information section. help description. */
+ int root_first_flag; /**< @brief Put the rootfs before the kernel (only for stock images, e.g. captured from the router's flash memory). (default=off). */
+ const char *root_first_help; /**< @brief Put the rootfs before the kernel (only for stock images, e.g. captured from the router's flash memory). help description. */
+ char * rsa_signature_arg; /**< @brief String for RSA Signature section.. */
+ char * rsa_signature_orig; /**< @brief String for RSA Signature section. original value given at command line. */
+ const char *rsa_signature_help; /**< @brief String for RSA Signature section. help description. */
+ char * second_image_flag_arg; /**< @brief Dual Image Flag (2=not-specified). (default='2'). */
+ char * second_image_flag_orig; /**< @brief Dual Image Flag (2=not-specified). original value given at command line. */
+ const char *second_image_flag_help; /**< @brief Dual Image Flag (2=not-specified). help description. */
+ char * inactive_arg; /**< @brief Inactive Flag (2=not-specified). (default='2'). */
+ char * inactive_orig; /**< @brief Inactive Flag (2=not-specified). original value given at command line. */
+ const char *inactive_help; /**< @brief Inactive Flag (2=not-specified). help description. */
+ char * reserved2_arg; /**< @brief String for second reserved section.. */
+ char * reserved2_orig; /**< @brief String for second reserved section. original value given at command line. */
+ const char *reserved2_help; /**< @brief String for second reserved section. help description. */
+ int kernel_file_has_header_flag; /**< @brief Indicates that the kernel file includes the kernel header with correct load address and entry point, so no changes are needed (default=off). */
+ const char *kernel_file_has_header_help; /**< @brief Indicates that the kernel file includes the kernel header with correct load address and entry point, so no changes are needed help description. */
+ int pad_arg; /**< @brief Pad the image to this size if smaller (in MiB). */
+ char * pad_orig; /**< @brief Pad the image to this size if smaller (in MiB) original value given at command line. */
+ const char *pad_help; /**< @brief Pad the image to this size if smaller (in MiB) help description. */
+
+ unsigned int help_given ; /**< @brief Whether help was given. */
+ unsigned int version_given ; /**< @brief Whether version was given. */
+ unsigned int kernel_given ; /**< @brief Whether kernel was given. */
+ unsigned int rootfs_given ; /**< @brief Whether rootfs was given. */
+ unsigned int output_given ; /**< @brief Whether output was given. */
+ unsigned int cfe_given ; /**< @brief Whether cfe was given. */
+ unsigned int boardid_given ; /**< @brief Whether boardid was given. */
+ unsigned int chipid_given ; /**< @brief Whether chipid was given. */
+ unsigned int flash_start_given ; /**< @brief Whether flash-start was given. */
+ unsigned int image_offset_given ; /**< @brief Whether image-offset was given. */
+ unsigned int tag_version_given ; /**< @brief Whether tag-version was given. */
+ unsigned int signature_given ; /**< @brief Whether signature was given. */
+ unsigned int signature2_given ; /**< @brief Whether signature2 was given. */
+ unsigned int block_size_given ; /**< @brief Whether block-size was given. */
+ unsigned int load_addr_given ; /**< @brief Whether load-addr was given. */
+ unsigned int entry_given ; /**< @brief Whether entry was given. */
+ unsigned int layoutver_given ; /**< @brief Whether layoutver was given. */
+ unsigned int info1_given ; /**< @brief Whether info1 was given. */
+ unsigned int altinfo_given ; /**< @brief Whether altinfo was given. */
+ unsigned int info2_given ; /**< @brief Whether info2 was given. */
+ unsigned int root_first_given ; /**< @brief Whether root-first was given. */
+ unsigned int rsa_signature_given ; /**< @brief Whether rsa-signature was given. */
+ unsigned int second_image_flag_given ; /**< @brief Whether second-image-flag was given. */
+ unsigned int inactive_given ; /**< @brief Whether inactive was given. */
+ unsigned int reserved2_given ; /**< @brief Whether reserved2 was given. */
+ unsigned int kernel_file_has_header_given ; /**< @brief Whether kernel-file-has-header was given. */
+ unsigned int pad_given ; /**< @brief Whether pad was given. */
+
+} ;
+
+/** @brief The additional parameters to pass to parser functions */
+struct cmdline_parser_params
+{
+ int override; /**< @brief whether to override possibly already present options (default 0) */
+ int initialize; /**< @brief whether to initialize the option structure gengetopt_args_info (default 1) */
+ int check_required; /**< @brief whether to check that all required options were provided (default 1) */
+ int check_ambiguity; /**< @brief whether to check for options already specified in the option structure gengetopt_args_info (default 0) */
+ int print_errors; /**< @brief whether getopt_long should print an error message for a bad option (default 1) */
+} ;
+
+/** @brief the purpose string of the program */
+extern const char *gengetopt_args_info_purpose;
+/** @brief the usage string of the program */
+extern const char *gengetopt_args_info_usage;
+/** @brief all the lines making the help output */
+extern const char *gengetopt_args_info_help[];
+
+/**
+ * The command line parser
+ * @param argc the number of command line options
+ * @param argv the command line options
+ * @param args_info the structure where option information will be stored
+ * @return 0 if everything went fine, NON 0 if an error took place
+ */
+int cmdline_parser (int argc, char **argv,
+ struct gengetopt_args_info *args_info);
+
+/**
+ * The command line parser (version with additional parameters - deprecated)
+ * @param argc the number of command line options
+ * @param argv the command line options
+ * @param args_info the structure where option information will be stored
+ * @param override whether to override possibly already present options
+ * @param initialize whether to initialize the option structure my_args_info
+ * @param check_required whether to check that all required options were provided
+ * @return 0 if everything went fine, NON 0 if an error took place
+ * @deprecated use cmdline_parser_ext() instead
+ */
+int cmdline_parser2 (int argc, char **argv,
+ struct gengetopt_args_info *args_info,
+ int override, int initialize, int check_required);
+
+/**
+ * The command line parser (version with additional parameters)
+ * @param argc the number of command line options
+ * @param argv the command line options
+ * @param args_info the structure where option information will be stored
+ * @param params additional parameters for the parser
+ * @return 0 if everything went fine, NON 0 if an error took place
+ */
+int cmdline_parser_ext (int argc, char **argv,
+ struct gengetopt_args_info *args_info,
+ struct cmdline_parser_params *params);
+
+/**
+ * Save the contents of the option struct into an already open FILE stream.
+ * @param outfile the stream where to dump options
+ * @param args_info the option struct to dump
+ * @return 0 if everything went fine, NON 0 if an error took place
+ */
+int cmdline_parser_dump(FILE *outfile,
+ struct gengetopt_args_info *args_info);
+
+/**
+ * Save the contents of the option struct into a (text) file.
+ * This file can be read by the config file parser (if generated by gengetopt)
+ * @param filename the file where to save
+ * @param args_info the option struct to save
+ * @return 0 if everything went fine, NON 0 if an error took place
+ */
+int cmdline_parser_file_save(const char *filename,
+ struct gengetopt_args_info *args_info);
+
+/**
+ * Print the help
+ */
+void cmdline_parser_print_help(void);
+/**
+ * Print the version
+ */
+void cmdline_parser_print_version(void);
+
+/**
+ * Initializes all the fields a cmdline_parser_params structure
+ * to their default values
+ * @param params the structure to initialize
+ */
+void cmdline_parser_params_init(struct cmdline_parser_params *params);
+
+/**
+ * Allocates dynamically a cmdline_parser_params structure and initializes
+ * all its fields to their default values
+ * @return the created and initialized cmdline_parser_params structure
+ */
+struct cmdline_parser_params *cmdline_parser_params_create(void);
+
+/**
+ * Initializes the passed gengetopt_args_info structure's fields
+ * (also set default values for options that have a default)
+ * @param args_info the structure to initialize
+ */
+void cmdline_parser_init (struct gengetopt_args_info *args_info);
+/**
+ * Deallocates the string fields of the gengetopt_args_info structure
+ * (but does not deallocate the structure itself)
+ * @param args_info the structure to deallocate
+ */
+void cmdline_parser_free (struct gengetopt_args_info *args_info);
+
+/**
+ * Checks that all the required options were specified
+ * @param args_info the structure to check
+ * @param prog_name the name of the program that will be used to print
+ * possible errors
+ * @return
+ */
+int cmdline_parser_required (struct gengetopt_args_info *args_info,
+ const char *prog_name);
+
+extern const char *cmdline_parser_second_image_flag_values[]; /**< @brief Possible values for second-image-flag. */
+extern const char *cmdline_parser_inactive_values[]; /**< @brief Possible values for inactive. */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* IMAGETAG_CMDLINE_H */
diff --git a/tools/firmware-utils/src/.svn/text-base/lzma2eva.c.svn-base b/tools/firmware-utils/src/.svn/text-base/lzma2eva.c.svn-base
new file mode 100644
index 0000000..0bc13fa
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/lzma2eva.c.svn-base
@@ -0,0 +1,190 @@
+/*
+ lzma2eva - convert lzma-compressed file to AVM EVA bootloader format
+ Copyright (C) 2007 Enrik Berkhan
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include
+#include
+#include
+#include /* crc32 */
+
+#define checksum_add32(csum, data) \
+ csum += ((uint8_t *)&data)[0]; \
+ csum += ((uint8_t *)&data)[1]; \
+ csum += ((uint8_t *)&data)[2]; \
+ csum += ((uint8_t *)&data)[3];
+
+void
+usage(void)
+{
+ fprintf(stderr, "usage: lzma2eva \n");
+ exit(1);
+}
+
+void
+pexit(const char *msg)
+{
+ perror(msg);
+ exit(1);
+}
+
+int
+main(int argc, char *argv[])
+{
+
+ const char *infile, *outfile;
+ FILE *in, *out;
+ static const uint8_t buf[4096];
+ size_t elems;
+
+ uint8_t properties;
+ uint32_t dictsize;
+ uint64_t datasize;
+
+ uint32_t magic = 0xfeed1281L;
+ uint32_t reclength = 0;
+ fpos_t reclengthpos;
+ uint32_t loadaddress = 0;
+ uint32_t type = 0x075a0201L; /* might be 7Z 2.1? */
+ uint32_t checksum = 0;
+
+ uint32_t compsize = 0;
+ fpos_t compsizepos;
+ uint32_t datasize32 = 0;
+ uint32_t datacrc32 = crc32(0, 0, 0);
+
+ uint32_t zero = 0;
+ uint32_t entry = 0;
+
+ if (argc != 5)
+ usage();
+
+ /* "parse" command line */
+ loadaddress = strtoul(argv[1], 0, 0);
+ entry = strtoul(argv[2], 0, 0);
+ infile = argv[3];
+ outfile = argv[4];
+
+ in = fopen(infile, "rb");
+ if (!in)
+ pexit("fopen");
+ out = fopen(outfile, "w+b");
+ if (!out)
+ pexit("fopen");
+
+ /* read LZMA header */
+ if (1 != fread(&properties, sizeof properties, 1, in))
+ pexit("fread");
+ if (1 != fread(&dictsize, sizeof dictsize, 1, in))
+ pexit("fread");
+ if (1 != fread(&datasize, sizeof datasize, 1, in))
+ pexit("fread");
+
+ /* write EVA header */
+ if (1 != fwrite(&magic, sizeof magic, 1, out))
+ pexit("fwrite");
+ if (fgetpos(out, &reclengthpos))
+ pexit("fgetpos");
+ if (1 != fwrite(&reclength, sizeof reclength, 1, out))
+ pexit("fwrite");
+ if (1 != fwrite(&loadaddress, sizeof loadaddress, 1, out))
+ pexit("fwrite");
+ if (1 != fwrite(&type, sizeof type, 1, out))
+ pexit("fwrite");
+
+ /* write EVA LZMA header */
+ if (fgetpos(out, &compsizepos))
+ pexit("fgetpos");
+ if (1 != fwrite(&compsize, sizeof compsize, 1, out))
+ pexit("fwrite");
+ /* XXX check length */
+ datasize32 = (uint32_t)datasize;
+ if (1 != fwrite(&datasize32, sizeof datasize32, 1, out))
+ pexit("fwrite");
+ if (1 != fwrite(&datacrc32, sizeof datacrc32, 1, out))
+ pexit("fwrite");
+
+ /* write modified LZMA header */
+ if (1 != fwrite(&properties, sizeof properties, 1, out))
+ pexit("fwrite");
+ if (1 != fwrite(&dictsize, sizeof dictsize, 1, out))
+ pexit("fwrite");
+ if (1 != fwrite(&zero, 3, 1, out))
+ pexit("fwrite");
+
+ /* copy compressed data, calculate crc32 */
+ while (0 < (elems = fread(&buf, sizeof buf[0], sizeof buf, in))) {
+ compsize += elems;
+ if (elems != fwrite(&buf, sizeof buf[0], elems, out))
+ pexit("fwrite");
+ datacrc32 = crc32(datacrc32, buf, elems);
+ }
+ if (ferror(in))
+ pexit("fread");
+ fclose(in);
+
+ /* re-write record length */
+ reclength = compsize + 24;
+ if (fsetpos(out, &reclengthpos))
+ pexit("fsetpos");
+ if (1 != fwrite(&reclength, sizeof reclength, 1, out))
+ pexit("fwrite");
+
+ /* re-write EVA LZMA header including size and data crc */
+ if (fsetpos(out, &compsizepos))
+ pexit("fsetpos");
+ if (1 != fwrite(&compsize, sizeof compsize, 1, out))
+ pexit("fwrite");
+ if (1 != fwrite(&datasize32, sizeof datasize32, 1, out))
+ pexit("fwrite");
+ if (1 != fwrite(&datacrc32, sizeof datacrc32, 1, out))
+ pexit("fwrite");
+
+ /* calculate record checksum */
+ checksum += reclength;
+ checksum += loadaddress;
+ checksum_add32(checksum, type);
+ checksum_add32(checksum, compsize);
+ checksum_add32(checksum, datasize32);
+ checksum_add32(checksum, datacrc32);
+ if (fseek(out, 0, SEEK_CUR))
+ pexit("fseek");
+ while (0 < (elems = fread(&buf, sizeof buf[0], sizeof buf, out))) {
+ size_t i;
+ for (i = 0; i < elems; ++i)
+ checksum += buf[i];
+ }
+ if (ferror(out))
+ pexit("fread");
+ if (fseek(out, 0, SEEK_CUR))
+ pexit("fseek");
+
+ checksum = ~checksum + 1;
+ if (1 != fwrite(&checksum, sizeof checksum, 1, out))
+ pexit("fwrite");
+
+ /* write entry record */
+ if (1 != fwrite(&zero, sizeof zero, 1, out))
+ pexit("fwrite");
+ if (1 != fwrite(&entry, sizeof entry, 1, out))
+ pexit("fwrite");
+
+ if (fclose(out))
+ pexit("fclose");
+
+ return 0;
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/makeamitbin.c.svn-base b/tools/firmware-utils/src/.svn/text-base/makeamitbin.c.svn-base
new file mode 100644
index 0000000..5c33442
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/makeamitbin.c.svn-base
@@ -0,0 +1,316 @@
+/*
+ * makeamitbin - create firmware binaries for MGB100
+ *
+ * Copyright (C) 2007 Volker Weiss
+ * Christian Welzel
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+
+
+#include
+#include
+#include
+
+
+/* defaults: Level One WAP-0007 */
+static char *ascii1 = "DDC_RUS001";
+static char *ascii2 = "Queen";
+
+static struct hdrinfo {
+ char *name;
+ unsigned long unknown; /* can probably be any number, maybe version number */
+ int topalign;
+ unsigned int addr;
+ unsigned int size;
+} hdrinfo[] = {
+ { "bios", 0xc76be111, 1, 0x3fa000, 0x006000 }, /* BIOS */
+ { "recovery", 0xc76be222, 0, 0x3f0000, 0x004000 }, /* Recovery Loader */
+ { "linux", 0xc76bee9d, 0, 0x000000, 0x100000 }, /* Linux */
+ { "ramdisk", 0xc76bee9d, 0, 0x100000, 0x280000 }, /* ramdisk */
+ { "amitconfig", 0xc76bee8b, 0, 0x380000, 0x060000 }, /* AMIT config */
+ { "redboot", 0x00000000, 1, 0x3d0000, 0x030000 }, /* Redboot 128kB image */
+ { "redbootlow", 0, 0, 0x3e0000, 0x18000 }, /* Redboot 1. part */
+ { "redboothigh", 0, 0, 0x3fa000, 0x6000 }, /* Redboot 2. part */
+ { "linux3g", 0xcb5f06b5, 0, 0x000000, 0x100000 }, /* Linux */
+ { "ramdisk3g", 0xcb5f06b5, 0, 0x100000, 0x280000 }, /* ramdisk */
+ { NULL }
+};
+
+/*
+CHD2WLANU_R400b7
+
+11e1 6bc7
+22e2 6bc7
+5dc3 47c8
+5cc3 47c8
+21c3 47c8
+*/
+
+/*
+20060106_DDC_WAP-0007_R400b4
+
+11e1 6bc7
+22e2 6bc7
+9dee 6bc7
+9dee 6bc7
+8bee 6bc7
+*/
+
+/*
+WMU-6000FS_R400b6
+
+11e1 6bc7
+22e2 6bc7
+6d2d 0fc8
+6c2d 0fc8
+542d 0fc8
+*/
+
+/*
+WAP-0007(R4.00b8)_2006-10-02
+
+9979 5fc8
+22e2 6bc7
+c46e cec8
+c36e cec8
+a76e cec8
+*/
+
+
+
+#define HDRSIZE 80
+
+#define COPY_SHORT(d, o, v) d[o+0] = (unsigned char)((v) & 0xff); \
+ d[o+1] = (unsigned char)(((v) >> 8) & 0xff)
+#define COPY_LONG(d, o, v) d[o+0] = (unsigned char)((v) & 0xff); \
+ d[o+1] = (unsigned char)(((v) >> 8) & 0xff); \
+ d[o+2] = (unsigned char)(((v) >> 16) & 0xff); \
+ d[o+3] = (unsigned char)(((v) >> 24) & 0xff)
+#define READ_SHORT(d, o) ((unsigned short)(d[o+0]) + \
+ (((unsigned short)(d[o+1])) << 8))
+
+/*
+00..0d ASCII product ID
+0e..0f checksum of payload
+10..1b ASCII Queen
+1c..1f AMIT BIOS: 11e1 6bc7, Recovery Tool: 22e2 6bc7
+ Linux: 5dc3 47c8, ramdisk: 5cc3 47c8
+ AMIT FS: 21c3 47c8 VERSION NUMBER??????
+20..23 offset in flash aligned to segment boundary
+24..27 length in flash aligned to segment boundary
+28..2b offset in flash (payload)
+2c..2f length (payload)
+30..3f always 0
+40..47 always 4248 0101 5000 0001 (last maybe .....0501)
+48..4b same as 20..23
+4c..4d always 0b00
+4e..4f inverted checksum of header
+*/
+
+unsigned short checksum(unsigned char *data, long size)
+{
+ long n;
+ unsigned short d, cs = 0;
+ for (n = 0; n < size; n += 2)
+ {
+ d = READ_SHORT(data, n);
+ cs += d;
+ if (cs < d)
+ cs++;
+ }
+ if (size & 1)
+ {
+ d = data[n];
+ cs += d;
+ if (cs < d)
+ cs++;
+ }
+ return cs;
+}
+
+void showhdr(unsigned char *hdr)
+{
+ int i, j;
+ for (j = 0; j < 5; j++)
+ {
+ for (i = 0; i < 16; i++)
+ {
+ printf("%02x ", (unsigned int)(hdr[j * 16 + i]));
+ }
+ printf(" ");
+ for (i = 0; i < 16; i++)
+ {
+ unsigned char d = hdr[j * 16 + i];
+ printf("%c", (d >= ' ' && d < 127) ? d : '.');
+ }
+ printf("\n");
+ }
+}
+
+void makehdr(unsigned char *hdr, struct hdrinfo *info,
+ unsigned char *data, long size, int last)
+{
+ unsigned int offset = info->addr + 0x10;
+ memset(hdr, 0, HDRSIZE);
+ if (info->topalign)
+ offset = info->addr + info->size - size; /* top align */
+ strncpy((char *)hdr + 0x00, ascii1, 14);
+ strncpy((char *)hdr + 0x10, ascii2, 12);
+ COPY_LONG(hdr, 0x1c, info->unknown);
+ COPY_LONG(hdr, 0x20, info->addr);
+ COPY_LONG(hdr, 0x24, info->size);
+ COPY_LONG(hdr, 0x28, offset);
+ COPY_LONG(hdr, 0x2c, size);
+ COPY_LONG(hdr, 0x40, 0x01014842);
+ COPY_LONG(hdr, 0x44, last ? 0x01050050 : 0x01000050);
+ COPY_LONG(hdr, 0x48, info->addr);
+ COPY_SHORT(hdr, 0x4c, info->unknown == 0xcb5f06b5 ? 0x0016 : 0x000b);
+ COPY_SHORT(hdr, 0x0e, checksum(data, size));
+ COPY_SHORT(hdr, 0x4e, ~checksum(hdr, HDRSIZE));
+}
+
+unsigned char *read_file(const char *name, long *size)
+{
+ FILE *f;
+ unsigned char *data = NULL;
+ *size = 0;
+ f = fopen(name, "r");
+ if (f != NULL)
+ {
+ if (fseek(f, 0, SEEK_END) == 0)
+ {
+ *size = ftell(f);
+ if (*size != -1)
+ {
+ if (fseek(f, 0, SEEK_SET) == 0)
+ {
+ data = (unsigned char *)malloc(*size);
+ if (data != NULL)
+ {
+ if (fread(data, sizeof(char), *size, f) != *size)
+ {
+ free(data);
+ data = NULL;
+ }
+ }
+ }
+ }
+ }
+ fclose(f);
+ }
+ return data;
+}
+
+struct hdrinfo *find_hdrinfo(const char *name)
+{
+ int n;
+ for (n = 0; hdrinfo[n].name != NULL; n++)
+ {
+ if (strcmp(name, hdrinfo[n].name) == 0)
+ return &hdrinfo[n];
+ }
+ return NULL;
+}
+
+void oferror(FILE *f)
+{
+ printf("file error\n");
+ exit(2);
+}
+
+void showhelp(void)
+{
+ printf("Syntax: makeamitbin [options]\n");
+ printf("Options:\n");
+ printf(" -1 ID1\tFirmware identifier 1, e.g. 'DDC_RUS001' for manufacturer LevelOne\n");
+ printf(" -2 ID2\tFirmware identifier 2, 'Queen' in all known cases\n");
+ printf(" -o FILE\tOutput file\n");
+ printf(" -ids\t\tShow a list of known firmware identifiers.\n");
+ exit(1);
+}
+
+void show_fwids(void)
+{
+ printf("List of known firmware identifiers:\n");
+ printf("Manufacturer\t\tProduct\t\tIdentifier\n");
+ printf("=====================================================\n");
+ printf("Conceptronic\t\tCHD2WLANU\tLLM_RUS001\n");
+ printf("Pearl\t\t\tPE6643\t\tQueen\n");
+ printf("Micronica\t\tMGB100\t\tQueen\n");
+ printf("LevelOne\t\tWAP-0007\tDDC_RUS001\n");
+ printf("SMC\t\t\tWAPS-G\t\tSMC_RUS001\n");
+ printf("OvisLink (AirLive)\tWMU-6\t\tOVS_RUS001\n");
+ printf("SafeCom SWSAPUR-5\tFMW\t\tSafeco_RPS001\n");
+ exit(1);
+}
+
+int main(int argc, char *argv[])
+{
+ unsigned char hdr[HDRSIZE];
+ unsigned char *data;
+ FILE *of;
+ char *outfile = NULL;
+ char *type;
+ struct hdrinfo *info;
+ long size;
+ int last = 0;
+ int n;
+ for (n = 1; n < argc; n++)
+ {
+ if (strcmp(argv[n], "-1") == 0)
+ ascii1 = argv[n+1];
+ if (strcmp(argv[n], "-2") == 0)
+ ascii2 = argv[n+1];
+ if (strcmp(argv[n], "-o") == 0)
+ outfile = argv[n+1];
+ if (strcmp(argv[n], "-ids") == 0)
+ show_fwids();
+ }
+ if (ascii1 == NULL || ascii2 == NULL || outfile == NULL)
+ showhelp();
+ of = fopen(outfile, "w");
+ if (of == NULL)
+ oferror(of);
+ for (n = 1; n < argc; n++)
+ {
+ if (strncmp(argv[n], "-", 1) != 0)
+ {
+ type = argv[n++];
+ if (n >= argc)
+ showhelp();
+ last = ((n + 1) >= argc); /* dirty, options first! */
+ info = find_hdrinfo(type);
+ if (info == NULL)
+ showhelp();
+ data = read_file(argv[n], &size);
+ if (data == NULL)
+ showhelp();
+ makehdr(hdr, info, data, size, last);
+ /* showhdr(hdr); */
+ if (fwrite(hdr, HDRSIZE, 1, of) != 1)
+ oferror(of);
+ if (fwrite(data, size, 1, of) != 1)
+ oferror(of);
+ free(data);
+ }
+ else
+ n++;
+ }
+ if (fclose(of) != 0)
+ oferror(NULL);
+ return 0;
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/md5.c.svn-base b/tools/firmware-utils/src/.svn/text-base/md5.c.svn-base
new file mode 100644
index 0000000..2039760
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/md5.c.svn-base
@@ -0,0 +1,307 @@
+
+
+/*
+ ***********************************************************************
+ ** md5.c -- the source code for MD5 routines **
+ ** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
+ ** Created: 2/17/90 RLR **
+ ** Revised: 1/91 SRD,AJ,BSK,JT Reference C ver., 7/10 constant corr. **
+ ***********************************************************************
+ */
+
+/*
+ ***********************************************************************
+ ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **
+ ** **
+ ** License to copy and use this software is granted provided that **
+ ** it is identified as the "RSA Data Security, Inc. MD5 Message- **
+ ** Digest Algorithm" in all material mentioning or referencing this **
+ ** software or this function. **
+ ** **
+ ** License is also granted to make and use derivative works **
+ ** provided that such works are identified as "derived from the RSA **
+ ** Data Security, Inc. MD5 Message-Digest Algorithm" in all **
+ ** material mentioning or referencing the derived work. **
+ ** **
+ ** RSA Data Security, Inc. makes no representations concerning **
+ ** either the merchantability of this software or the suitability **
+ ** of this software for any particular purpose. It is provided "as **
+ ** is" without express or implied warranty of any kind. **
+ ** **
+ ** These notices must be retained in any copies of any part of this **
+ ** documentation and/or software. **
+ ***********************************************************************
+ */
+
+#include
+#include "md5.h"
+
+/*
+ ***********************************************************************
+ ** Message-digest routines: **
+ ** To form the message digest for a message M **
+ ** (1) Initialize a context buffer mdContext using MD5_Init **
+ ** (2) Call MD5_Update on mdContext and M **
+ ** (3) Call MD5_Final on mdContext **
+ ** The message digest is now in mdContext->digest[0...15] **
+ ***********************************************************************
+ */
+
+/* forward declaration */
+static void Transform ();
+
+static unsigned char PADDING[64] = {
+ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+/* F, G, H and I are basic MD5 functions */
+#define F(x, y, z) (((x) & (y)) | ((~x) & (z)))
+#define G(x, y, z) (((x) & (z)) | ((y) & (~z)))
+#define H(x, y, z) ((x) ^ (y) ^ (z))
+#define I(x, y, z) ((y) ^ ((x) | (~z)))
+
+/* ROTATE_LEFT rotates x left n bits */
+#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n))))
+
+/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */
+/* Rotation is separate from addition to prevent recomputation */
+#define FF(a, b, c, d, x, s, ac) \
+ {(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+ }
+#define GG(a, b, c, d, x, s, ac) \
+ {(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+ }
+#define HH(a, b, c, d, x, s, ac) \
+ {(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+ }
+#define II(a, b, c, d, x, s, ac) \
+ {(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+ }
+
+#ifdef __STDC__
+#define UL(x) x##U
+#else
+#define UL(x) x
+#endif
+
+/* The routine MD5_Init initializes the message-digest context
+ mdContext. All fields are set to zero.
+ */
+void MD5_Init (mdContext)
+MD5_CTX *mdContext;
+{
+ mdContext->i[0] = mdContext->i[1] = (UINT4)0;
+
+ /* Load magic initialization constants.
+ */
+ mdContext->buf[0] = (UINT4)0x67452301;
+ mdContext->buf[1] = (UINT4)0xefcdab89;
+ mdContext->buf[2] = (UINT4)0x98badcfe;
+ mdContext->buf[3] = (UINT4)0x10325476;
+}
+
+/* The routine MD5Update updates the message-digest context to
+ account for the presence of each of the characters inBuf[0..inLen-1]
+ in the message whose digest is being computed.
+ */
+void MD5_Update (mdContext, inBuf, inLen)
+MD5_CTX *mdContext;
+unsigned char *inBuf;
+unsigned int inLen;
+{
+ UINT4 in[16];
+ int mdi;
+ unsigned int i, ii;
+
+ /* compute number of bytes mod 64 */
+ mdi = (int)((mdContext->i[0] >> 3) & 0x3F);
+
+ /* update number of bits */
+ if ((mdContext->i[0] + ((UINT4)inLen << 3)) < mdContext->i[0])
+ mdContext->i[1]++;
+ mdContext->i[0] += ((UINT4)inLen << 3);
+ mdContext->i[1] += ((UINT4)inLen >> 29);
+
+ while (inLen--) {
+ /* add new character to buffer, increment mdi */
+ mdContext->in[mdi++] = *inBuf++;
+
+ /* transform if necessary */
+ if (mdi == 0x40) {
+ for (i = 0, ii = 0; i < 16; i++, ii += 4)
+ in[i] = (((UINT4)mdContext->in[ii+3]) << 24) |
+ (((UINT4)mdContext->in[ii+2]) << 16) |
+ (((UINT4)mdContext->in[ii+1]) << 8) |
+ ((UINT4)mdContext->in[ii]);
+ Transform (mdContext->buf, in);
+ mdi = 0;
+ }
+ }
+}
+
+/* The routine MD5Final terminates the message-digest computation and
+ ends with the desired message digest in mdContext->digest[0...15].
+ */
+void MD5_Final (hash, mdContext)
+unsigned char hash[];
+MD5_CTX *mdContext;
+{
+ UINT4 in[16];
+ int mdi;
+ unsigned int i, ii;
+ unsigned int padLen;
+
+ /* save number of bits */
+ in[14] = mdContext->i[0];
+ in[15] = mdContext->i[1];
+
+ /* compute number of bytes mod 64 */
+ mdi = (int)((mdContext->i[0] >> 3) & 0x3F);
+
+ /* pad out to 56 mod 64 */
+ padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi);
+ MD5_Update (mdContext, PADDING, padLen);
+
+ /* append length in bits and transform */
+ for (i = 0, ii = 0; i < 14; i++, ii += 4)
+ in[i] = (((UINT4)mdContext->in[ii+3]) << 24) |
+ (((UINT4)mdContext->in[ii+2]) << 16) |
+ (((UINT4)mdContext->in[ii+1]) << 8) |
+ ((UINT4)mdContext->in[ii]);
+ Transform (mdContext->buf, in);
+
+ /* store buffer in digest */
+ for (i = 0, ii = 0; i < 4; i++, ii += 4) {
+ mdContext->digest[ii] = (unsigned char)(mdContext->buf[i] & 0xFF);
+ mdContext->digest[ii+1] =
+ (unsigned char)((mdContext->buf[i] >> 8) & 0xFF);
+ mdContext->digest[ii+2] =
+ (unsigned char)((mdContext->buf[i] >> 16) & 0xFF);
+ mdContext->digest[ii+3] =
+ (unsigned char)((mdContext->buf[i] >> 24) & 0xFF);
+ }
+ memcpy(hash, mdContext->digest, 16);
+}
+
+/* Basic MD5 step. Transforms buf based on in.
+ */
+static void Transform (buf, in)
+UINT4 *buf;
+UINT4 *in;
+{
+ UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3];
+
+ /* Round 1 */
+#define S11 7
+#define S12 12
+#define S13 17
+#define S14 22
+ FF ( a, b, c, d, in[ 0], S11, UL(3614090360)); /* 1 */
+ FF ( d, a, b, c, in[ 1], S12, UL(3905402710)); /* 2 */
+ FF ( c, d, a, b, in[ 2], S13, UL( 606105819)); /* 3 */
+ FF ( b, c, d, a, in[ 3], S14, UL(3250441966)); /* 4 */
+ FF ( a, b, c, d, in[ 4], S11, UL(4118548399)); /* 5 */
+ FF ( d, a, b, c, in[ 5], S12, UL(1200080426)); /* 6 */
+ FF ( c, d, a, b, in[ 6], S13, UL(2821735955)); /* 7 */
+ FF ( b, c, d, a, in[ 7], S14, UL(4249261313)); /* 8 */
+ FF ( a, b, c, d, in[ 8], S11, UL(1770035416)); /* 9 */
+ FF ( d, a, b, c, in[ 9], S12, UL(2336552879)); /* 10 */
+ FF ( c, d, a, b, in[10], S13, UL(4294925233)); /* 11 */
+ FF ( b, c, d, a, in[11], S14, UL(2304563134)); /* 12 */
+ FF ( a, b, c, d, in[12], S11, UL(1804603682)); /* 13 */
+ FF ( d, a, b, c, in[13], S12, UL(4254626195)); /* 14 */
+ FF ( c, d, a, b, in[14], S13, UL(2792965006)); /* 15 */
+ FF ( b, c, d, a, in[15], S14, UL(1236535329)); /* 16 */
+
+ /* Round 2 */
+#define S21 5
+#define S22 9
+#define S23 14
+#define S24 20
+ GG ( a, b, c, d, in[ 1], S21, UL(4129170786)); /* 17 */
+ GG ( d, a, b, c, in[ 6], S22, UL(3225465664)); /* 18 */
+ GG ( c, d, a, b, in[11], S23, UL( 643717713)); /* 19 */
+ GG ( b, c, d, a, in[ 0], S24, UL(3921069994)); /* 20 */
+ GG ( a, b, c, d, in[ 5], S21, UL(3593408605)); /* 21 */
+ GG ( d, a, b, c, in[10], S22, UL( 38016083)); /* 22 */
+ GG ( c, d, a, b, in[15], S23, UL(3634488961)); /* 23 */
+ GG ( b, c, d, a, in[ 4], S24, UL(3889429448)); /* 24 */
+ GG ( a, b, c, d, in[ 9], S21, UL( 568446438)); /* 25 */
+ GG ( d, a, b, c, in[14], S22, UL(3275163606)); /* 26 */
+ GG ( c, d, a, b, in[ 3], S23, UL(4107603335)); /* 27 */
+ GG ( b, c, d, a, in[ 8], S24, UL(1163531501)); /* 28 */
+ GG ( a, b, c, d, in[13], S21, UL(2850285829)); /* 29 */
+ GG ( d, a, b, c, in[ 2], S22, UL(4243563512)); /* 30 */
+ GG ( c, d, a, b, in[ 7], S23, UL(1735328473)); /* 31 */
+ GG ( b, c, d, a, in[12], S24, UL(2368359562)); /* 32 */
+
+ /* Round 3 */
+#define S31 4
+#define S32 11
+#define S33 16
+#define S34 23
+ HH ( a, b, c, d, in[ 5], S31, UL(4294588738)); /* 33 */
+ HH ( d, a, b, c, in[ 8], S32, UL(2272392833)); /* 34 */
+ HH ( c, d, a, b, in[11], S33, UL(1839030562)); /* 35 */
+ HH ( b, c, d, a, in[14], S34, UL(4259657740)); /* 36 */
+ HH ( a, b, c, d, in[ 1], S31, UL(2763975236)); /* 37 */
+ HH ( d, a, b, c, in[ 4], S32, UL(1272893353)); /* 38 */
+ HH ( c, d, a, b, in[ 7], S33, UL(4139469664)); /* 39 */
+ HH ( b, c, d, a, in[10], S34, UL(3200236656)); /* 40 */
+ HH ( a, b, c, d, in[13], S31, UL( 681279174)); /* 41 */
+ HH ( d, a, b, c, in[ 0], S32, UL(3936430074)); /* 42 */
+ HH ( c, d, a, b, in[ 3], S33, UL(3572445317)); /* 43 */
+ HH ( b, c, d, a, in[ 6], S34, UL( 76029189)); /* 44 */
+ HH ( a, b, c, d, in[ 9], S31, UL(3654602809)); /* 45 */
+ HH ( d, a, b, c, in[12], S32, UL(3873151461)); /* 46 */
+ HH ( c, d, a, b, in[15], S33, UL( 530742520)); /* 47 */
+ HH ( b, c, d, a, in[ 2], S34, UL(3299628645)); /* 48 */
+
+ /* Round 4 */
+#define S41 6
+#define S42 10
+#define S43 15
+#define S44 21
+ II ( a, b, c, d, in[ 0], S41, UL(4096336452)); /* 49 */
+ II ( d, a, b, c, in[ 7], S42, UL(1126891415)); /* 50 */
+ II ( c, d, a, b, in[14], S43, UL(2878612391)); /* 51 */
+ II ( b, c, d, a, in[ 5], S44, UL(4237533241)); /* 52 */
+ II ( a, b, c, d, in[12], S41, UL(1700485571)); /* 53 */
+ II ( d, a, b, c, in[ 3], S42, UL(2399980690)); /* 54 */
+ II ( c, d, a, b, in[10], S43, UL(4293915773)); /* 55 */
+ II ( b, c, d, a, in[ 1], S44, UL(2240044497)); /* 56 */
+ II ( a, b, c, d, in[ 8], S41, UL(1873313359)); /* 57 */
+ II ( d, a, b, c, in[15], S42, UL(4264355552)); /* 58 */
+ II ( c, d, a, b, in[ 6], S43, UL(2734768916)); /* 59 */
+ II ( b, c, d, a, in[13], S44, UL(1309151649)); /* 60 */
+ II ( a, b, c, d, in[ 4], S41, UL(4149444226)); /* 61 */
+ II ( d, a, b, c, in[11], S42, UL(3174756917)); /* 62 */
+ II ( c, d, a, b, in[ 2], S43, UL( 718787259)); /* 63 */
+ II ( b, c, d, a, in[ 9], S44, UL(3951481745)); /* 64 */
+
+ buf[0] += a;
+ buf[1] += b;
+ buf[2] += c;
+ buf[3] += d;
+}
+
+/*
+ ***********************************************************************
+ ** End of md5.c **
+ ******************************** (cut) ********************************
+ */
diff --git a/tools/firmware-utils/src/.svn/text-base/md5.h.svn-base b/tools/firmware-utils/src/.svn/text-base/md5.h.svn-base
new file mode 100644
index 0000000..f7a0c96
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/md5.h.svn-base
@@ -0,0 +1,65 @@
+/*
+ ***********************************************************************
+ ** md5.h -- header file for implementation of MD5 **
+ ** RSA Data Security, Inc. MD5 Message-Digest Algorithm **
+ ** Created: 2/17/90 RLR **
+ ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version **
+ ** Revised (for MD5): RLR 4/27/91 **
+ ** -- G modified to have y&~z instead of y&z **
+ ** -- FF, GG, HH modified to add in last register done **
+ ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 **
+ ** -- distinct additive constant for each step **
+ ** -- round 4 added, working mod 7 **
+ ***********************************************************************
+ */
+
+/*
+ ***********************************************************************
+ ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. **
+ ** **
+ ** License to copy and use this software is granted provided that **
+ ** it is identified as the "RSA Data Security, Inc. MD5 Message- **
+ ** Digest Algorithm" in all material mentioning or referencing this **
+ ** software or this function. **
+ ** **
+ ** License is also granted to make and use derivative works **
+ ** provided that such works are identified as "derived from the RSA **
+ ** Data Security, Inc. MD5 Message-Digest Algorithm" in all **
+ ** material mentioning or referencing the derived work. **
+ ** **
+ ** RSA Data Security, Inc. makes no representations concerning **
+ ** either the merchantability of this software or the suitability **
+ ** of this software for any particular purpose. It is provided "as **
+ ** is" without express or implied warranty of any kind. **
+ ** **
+ ** These notices must be retained in any copies of any part of this **
+ ** documentation and/or software. **
+ ***********************************************************************
+ */
+
+#ifndef __MD5_INCLUDE__
+
+/* typedef a 32-bit type */
+#ifdef _LP64
+typedef unsigned int UINT4;
+typedef int INT4;
+#else
+typedef unsigned long UINT4;
+typedef long INT4;
+#endif
+#define _UINT4_T
+
+/* Data structure for MD5 (Message-Digest) computation */
+typedef struct {
+ UINT4 i[2]; /* number of _bits_ handled mod 2^64 */
+ UINT4 buf[4]; /* scratch buffer */
+ unsigned char in[64]; /* input buffer */
+ unsigned char digest[16]; /* actual digest after MD5Final call */
+} MD5_CTX;
+
+void MD5_Init ();
+void MD5_Update ();
+void MD5_Final ();
+
+#define __MD5_INCLUDE__
+#endif /* __MD5_INCLUDE__ */
diff --git a/tools/firmware-utils/src/.svn/text-base/mkbrncmdline.c.svn-base b/tools/firmware-utils/src/.svn/text-base/mkbrncmdline.c.svn-base
new file mode 100644
index 0000000..6eb4bfe
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/mkbrncmdline.c.svn-base
@@ -0,0 +1,168 @@
+/*
+ * mkbrncmdline.c - partially based on OpenWrt's wndr3700.c
+ *
+ * Copyright (C) 2011 Tobias Diedrich
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+static void usage(const char *) __attribute__ (( __noreturn__ ));
+
+static void usage(const char *mess)
+{
+ fprintf(stderr, "Error: %s\n", mess);
+ fprintf(stderr, "Usage: mkbrncmdline -i input_file -o output_file [-a loadaddress] arg1 [argx ...]\n");
+ fprintf(stderr, "\n");
+ exit(1);
+}
+
+static char *input_file = NULL;
+static char *output_file = NULL;
+static unsigned loadaddr = 0x80002000;
+
+static void parseopts(int *argc, char ***argv)
+{
+ char *endptr;
+ int res;
+
+ while ((res = getopt(*argc, *argv, "a:i:o:")) != -1) {
+ switch (res) {
+ default:
+ usage("Unknown option");
+ break;
+ case 'a':
+ loadaddr = strtoul(optarg, &endptr, 0);
+ if (endptr == optarg || *endptr != 0)
+ usage("loadaddress must be a decimal or hexadecimal 32-bit value");
+ break;
+ case 'i':
+ input_file = optarg;
+ break;
+ case 'o':
+ output_file = optarg;
+ break;
+ }
+ }
+ *argc -= optind;
+ *argv += optind;
+}
+
+static void emitload(int outfd, int reg, unsigned value)
+{
+ char buf[8] = {
+ 0x3c, 0x04 + reg,
+ value >> 24, value >> 16,
+ 0x34, 0x84 + reg + (reg << 5),
+ value >> 8, value,
+ };
+ if (write(outfd, buf, sizeof(buf)) != sizeof(buf)) {
+ fprintf(stderr, "write: %s\n", strerror(errno));
+ exit(1);
+ }
+}
+
+int main(int argc, char **argv)
+{
+ int outfd;
+ int i;
+ int fd;
+ size_t len, skip, buf_len;
+ unsigned cmdline_addr;
+ unsigned s_ofs;
+ char *buf;
+
+ parseopts(&argc, &argv);
+
+ if (argc < 1)
+ usage("must specify at least one kernel cmdline argument");
+
+ if (input_file == NULL || output_file == NULL)
+ usage("must specify input and output file");
+
+ if ((outfd = open(output_file, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1)
+ {
+ fprintf(stderr, "Error opening '%s' for writing: %s\n", output_file, strerror(errno));
+ exit(1);
+ }
+
+ // mmap input_file
+ if ((fd = open(input_file, O_RDONLY)) < 0
+ || (len = lseek(fd, 0, SEEK_END)) < 0
+ || (input_file = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0)) == (void *) (-1)
+ || close(fd) < 0)
+ {
+ fprintf(stderr, "Error mapping file '%s': %s\n", input_file, strerror(errno));
+ exit(1);
+ }
+
+ cmdline_addr = loadaddr + len;
+
+ // Kernel args are passed in registers a0,a1,a2 and a3
+ emitload(outfd, 0, 0); /* a0 = 0 */
+ emitload(outfd, 1, 0); /* a1 = 0 */
+ emitload(outfd, 2, cmdline_addr); /* a2 = &cmdline */
+ emitload(outfd, 3, 0); /* a3 = 0 */
+ skip = lseek(outfd, 0, SEEK_END);
+
+ // write the kernel
+ if (write(outfd, input_file + skip, len - skip) != len -skip) {
+ fprintf(stderr, "write: %s\n", strerror(errno));
+ exit(1);
+ }
+
+ // write cmdline structure
+ buf_len = (argc + 1) * 4;
+ for (i=0; i> 24;
+ buf[i * 4 + 1] = s_ptr >> 16;
+ buf[i * 4 + 2] = s_ptr >> 8;
+ buf[i * 4 + 3] = s_ptr >> 0;
+ memcpy(&buf[s_ofs], argv[i], strlen(argv[i]));
+ s_ofs += strlen(argv[i]) + 1;
+ }
+ if (write(outfd, buf, buf_len) != buf_len) {
+ fprintf(stderr, "write: %s\n", strerror(errno));
+ exit(1);
+ }
+
+
+ munmap(input_file, len);
+ close(outfd);
+ free(buf);
+
+ return 0;
+}
diff --git a/tools/firmware-utils/src/.svn/text-base/mkbrnimg.c.svn-base b/tools/firmware-utils/src/.svn/text-base/mkbrnimg.c.svn-base
new file mode 100644
index 0000000..fff92c4
--- /dev/null
+++ b/tools/firmware-utils/src/.svn/text-base/mkbrnimg.c.svn-base
@@ -0,0 +1,183 @@
+/*
+ * mkbrnimg.c - partially based on OpenWrt's wndr3700.c
+ *
+ * Copyright (C) 2011 Tobias Diedrich
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define BPB 8 /* bits/byte */
+
+static uint32_t crc32[1<> 1)) : (crc >> 1);
+ crc32[n] = crc;
+ }
+}
+
+static uint32_t crc32buf(unsigned char *buf, size_t len)
+{
+ uint32_t crc = 0xFFFFFFFF;
+
+ for (; len; len--, buf++)
+ crc = crc32[(uint8_t)crc ^ *buf] ^ (crc >> BPB);
+ return ~crc;
+}
+
+static void usage(const char *) __attribute__ (( __noreturn__ ));
+
+static void usage(const char *mess)
+{
+ fprintf(stderr, "Error: %s\n", mess);
+ fprintf(stderr, "Usage: mkbrnimg [-o output_file] [-m magic] [-s signature] kernel_file [additional files]\n");
+ fprintf(stderr, "\n");
+ exit(1);
+}
+
+static char *output_file = "default-brnImage";
+static uint32_t magic = 0x12345678;
+static char *signature = "BRNDTW502";
+
+static void parseopts(int *argc, char ***argv)
+{
+ char *endptr;
+ int res;
+
+ while ((res = getopt(*argc, *argv, "o:m:s:")) != -1) {
+ switch (res) {
+ default:
+ usage("Unknown option");
+ break;
+ case 'o':
+ output_file = optarg;
+ break;
+ case 'm':
+ magic = strtoul(optarg, &endptr, 0);
+ if (endptr == optarg || *endptr != 0)
+ usage("magic must be a decimal or hexadecimal 32-bit value");
+ break;
+ case 's':
+ signature = optarg;
+ break;
+ }
+ }
+ *argc -= optind;
+ *argv += optind;
+}
+
+static void appendfile(int outfd, char *path, int kernel) {
+ int fd;
+ size_t len, padded_len;
+ char *input_file;
+ uint32_t crc;
+ char padding[0x400];
+ char footer[12];
+
+ memset(padding, 0xff, sizeof(padding));
+
+ // mmap input_file
+ if ((fd = open(path, O_RDONLY)) < 0
+ || (len = lseek(fd, 0, SEEK_END)) < 0
+ || (input_file = mmap(0, len, PROT_READ, MAP_SHARED, fd, 0)) == (void *) (-1)
+ || close(fd) < 0)
+ {
+ fprintf(stderr, "Error mapping file '%s': %s\n", path, strerror(errno));
+ exit(1);
+ }
+
+ // kernel should be lzma compressed image, not uImage
+ if (kernel &&
+ (input_file[0] != (char)0x5d ||
+ input_file[1] != (char)0x00 ||
+ input_file[2] != (char)0x00 ||
+ input_file[3] != (char)0x80)) {
+ fprintf(stderr, "lzma signature not found on kernel image.\n");
+ exit(1);
+ }
+
+ init_crc32();
+ crc = crc32buf(input_file, len);
+ fprintf(stderr, "crc32 for '%s' is %08x.\n", path, crc);
+
+ // write the file
+ write(outfd, input_file, len);
+
+ // write padding
+ padded_len = ((len + sizeof(footer) + sizeof(padding) - 1) & ~(sizeof(padding) - 1)) - sizeof(footer);
+ fprintf(stderr, "len=%08x padded_len=%08x\n", len, padded_len);
+ write(outfd, padding, padded_len - len);
+
+ // write footer
+ footer[0] = (len >> 0) & 0xff;
+ footer[1] = (len >> 8) & 0xff;
+ footer[2] = (len >> 16) & 0xff;
+ footer[3] = (len >> 24) & 0xff;
+ footer[4] = (magic >> 0) & 0xff;
+ footer[5] = (magic >> 8) & 0xff;
+ footer[6] = (magic >> 16) & 0xff;
+ footer[7] = (magic >> 24) & 0xff;
+ footer[8] = (crc >> 0) & 0xff;
+ footer[9] = (crc >> 8) & 0xff;
+ footer[10] = (crc >> 16) & 0xff;
+ footer[11] = (crc >> 24) & 0xff;
+ write(outfd, footer, sizeof(footer));
+
+ munmap(input_file, len);
+}
+
+int main(int argc, char **argv)
+{
+ int outfd;
+ int i;
+
+ parseopts(&argc, &argv);
+
+ if (argc < 1)
+ usage("wrong number of arguments");
+
+ if ((outfd = open(output_file, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1)
+ {
+ fprintf(stderr, "Error opening '%s' for writing: %s\n", output_file, strerror(errno));
+ exit(1);
+ }
+
+ for (i=0; i
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include /* for unlink() */
+#include
+#include /* for getopt() */
+#include
+#include
+#include
+
+#include
+#include
+
+#define MAX_MODEL_LEN 20
+#define MAX_SIGNATURE_LEN 30
+#define MAX_REGION_LEN 4
+#define MAX_VERSION_LEN 12
+
+#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
+
+struct file_info {
+ char *file_name; /* name of the file */
+ uint32_t file_size; /* length of the file */
+ uint32_t write_size;
+};
+
+struct img_header {
+ uint32_t checksum;
+ uint32_t image_size;
+ uint32_t kernel_size;
+ char model[MAX_MODEL_LEN];
+ char signature[MAX_SIGNATURE_LEN];
+ char region[MAX_REGION_LEN];
+ char version[MAX_VERSION_LEN];
+ unsigned char header_len;
+ unsigned char is_tgz;
+ unsigned char pad[4];
+} __attribute__ ((packed));
+
+/*
+ * Globals
+ */
+static char *ofname;
+static char *progname;
+
+static char *model;
+static char *signature;
+static char *region = "DEF";
+static char *version;
+static struct file_info kernel_info;
+static struct file_info rootfs_info;
+static uint32_t kernel_size;
+static uint32_t image_size;
+
+/*
+ * Message macros
+ */
+#define ERR(fmt, ...) do { \
+ fflush(0); \
+ fprintf(stderr, "[%s] *** error: " fmt "\n", \
+ progname, ## __VA_ARGS__ ); \
+} while (0)
+
+#define ERRS(fmt, ...) do { \
+ int save = errno; \
+ fflush(0); \
+ fprintf(stderr, "[%s] *** error: " fmt " (%s)\n", \
+ progname, ## __VA_ARGS__, strerror(save)); \
+} while (0)
+
+#define DBG(fmt, ...) do { \
+ fprintf(stderr, "[%s] " fmt "\n", progname, ## __VA_ARGS__ ); \
+} while (0)
+
+static void usage(int status)
+{
+ FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
+
+ fprintf(stream, "Usage: %s [OPTIONS...]\n", progname);
+ fprintf(stream,
+"\n"
+"Options:\n"
+" -k read kernel image from the file \n"
+" -M set model to \n"
+" -o