diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/env/fw_env.c | 6 | ||||
-rw-r--r-- | tools/mkimage.c | 1 | ||||
-rwxr-xr-x | tools/setlocalversion | 22 |
3 files changed, 25 insertions, 4 deletions
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 74c0498..f723b5b 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -614,8 +614,7 @@ static int env_init (void) if (!crc1_ok) { fprintf (stderr, "Warning: Bad CRC, using default environment\n"); - environment.data = default_environment; - free (addr1); + memcpy(environment.data, default_environment, sizeof default_environment); } } else { flag1 = environment.flags; @@ -652,9 +651,8 @@ static int env_init (void) } else if (!crc1_ok && !crc2_ok) { fprintf (stderr, "Warning: Bad CRC, using default environment\n"); - environment.data = default_environment; + memcpy(environment.data, default_environment, sizeof default_environment); curdev = 0; - free (addr2); free (addr1); } else if (flag1 == active_flag && flag2 == obsolete_flag) { environment.data = addr1; diff --git a/tools/mkimage.c b/tools/mkimage.c index 70452db..5222bb2 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -93,6 +93,7 @@ table_entry_t arch_name[] = { { IH_CPU_SH, "sh", "SuperH", }, { IH_CPU_SPARC, "sparc", "SPARC", }, { IH_CPU_SPARC64, "sparc64", "SPARC 64 Bit", }, + { IH_CPU_BLACKFIN, "blackfin", "Blackfin", }, { -1, "", "", }, }; diff --git a/tools/setlocalversion b/tools/setlocalversion new file mode 100755 index 0000000..9a23825 --- /dev/null +++ b/tools/setlocalversion @@ -0,0 +1,22 @@ +#!/bin/sh +# Print additional version information for non-release trees. + +usage() { + echo "Usage: $0 [srctree]" >&2 + exit 1 +} + +cd "${1:-.}" || usage + +# Check for git and a git repo. +if head=`git rev-parse --verify HEAD 2>/dev/null`; then + # Do we have an untagged version? + if [ "`git name-rev --tags HEAD`" = "HEAD undefined" ]; then + printf '%s%s' -g `echo "$head" | cut -c1-8` + fi + + # Are there uncommitted changes? + if git diff-files | read dummy; then + printf '%s' -dirty + fi +fi |