chromiumos/third_party/flashmap.git
18 months agoRemove extra parentheses to pass clang checking. 68/47368/2 factory-4128.B factory-4290.B factory-4455.B factory-pit-4280.B factory-pit-4390.B factory-pit-4471.B factory-spring-4131.B factory-spring-4262.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-pit-4482.B firmware-wolf-4389.24.B master release-R28-4100.B release-R29-4319.B release-R30-4537.B stabilize-4008.0.B stabilize-4035.0.B stabilize-4068.0.B stabilize-4100.38.B stabilize-4255.B stabilize-4287.B stabilize-4443.B stabilize-4512.B stabilize-spring-4100.53.B toolchainB
Yunlian Jiang [Thu, 4 Apr 2013 22:20:43 +0000 (15:20 -0700)]
Remove extra parentheses to pass clang checking.

BUG=chromium:219220
TEST=emerge-lumpy flashmap, the error message is gone.

Change-Id: I5fe8b5c9f1b6802d2487b57b96e93ba2e4e7c226
Reviewed-on: https://gerrit.chromium.org/gerrit/47368
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
18 months agoFix improper use of memset. 91/47191/2
Han Shen [Tue, 2 Apr 2013 22:48:37 +0000 (15:48 -0700)]
Fix improper use of memset.

For the following code snippet -
  char *str;
  str = (char *)malloc(...);
  memset(str, '\0', sizeof(str));
                    ^^^^^^^^^^^ always equals 4 or 8

TEST=Built.
BUG=None

Change-Id: I42fb6c27a2bd8cdbeb4941d8b01e242132132154
Reviewed-on: https://gerrit.chromium.org/gerrit/47191
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Tested-by: Han Shen <shenhan@google.com>
Commit-Queue: Han Shen <shenhan@google.com>

19 months agogive strncpy() an appropriate limit 43/45143/2 factory-spring-3842.B release-R27-3912.B stabilize-3881.0.B stabilize-3912.79.B toolchainA
David Hendricks [Mon, 11 Mar 2013 22:08:53 +0000 (15:08 -0700)]
give strncpy() an appropriate limit

This tells strncpy() to copy max_len bytes instead of strlen(src)
bytes, which will set bytes beyond strlen(src) with null bytes.

We really only need strlen(src) + 1, but for debugging it's
nice not to have a bunch of garbage in the destination buffer.

This fixes a test which err'd due to the lack of a terminating NULL
at the end of dest (do_strcpy is only used by unit tests).

BUG=none
TEST=make test

Change-Id: I73e19a15c91d874702b84877100cbf8d51bf8ac1
Reviewed-on: https://gerrit.chromium.org/gerrit/45143
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: David Hendricks <dhendrix@chromium.org>

19 months agoadd gcov file extensions (.gcda and .gcno) to .gitignore 42/45142/2
David Hendricks [Mon, 11 Mar 2013 22:17:15 +0000 (15:17 -0700)]
add gcov file extensions (.gcda and .gcno) to .gitignore

BUG=none
TEST=gcov files no longer appear in git status

Change-Id: I455e6445e32a6fdef2cb381b994908a17bde3e0f
Reviewed-on: https://gerrit.chromium.org/gerrit/45142
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Commit-Queue: David Hendricks <dhendrix@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
19 months agoadd PRESUBMIT.cfg 41/45141/2
David Hendricks [Mon, 11 Mar 2013 22:55:57 +0000 (15:55 -0700)]
add PRESUBMIT.cfg

This adds a presubmit config file so we don't get annoying repo upload
warnings for tabs and software license.

BUG=none
BRANCH=none
TEST=tried uploading a change, didn't get nagged for tabs and license

Change-Id: Ia46ae58c6281fb6cc7ac0864d45c613908cb2df4
Reviewed-on: https://gerrit.chromium.org/gerrit/45141
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Commit-Queue: David Hendricks <dhendrix@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
2 years agoAdd libfmap.a to install and uninstall rules 86/21686/1 factory-2268.16.B factory-2305.B factory-2338.B factory-2368.B factory-2394.B factory-2460.B factory-2475.B factory-2569.B factory-2717.B factory-2723.14.B factory-2846.B factory-2848.B factory-2914.B factory-2985.B factory-2993.B factory-3004.B factory-3536.B firmware-butterfly-2788.B firmware-link-2348.B firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-snow-2695.90.B firmware-snow-2695.B firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B firmware-spring-3833.B firmware-stout-2817.B release-R20-2268.B release-R21-2465.B release-R22-2723.B release-R23-2913.B release-R25-3428.B release-R26-3701.B stabilize stabilize-3428.110.0 stabilize-3428.149 stabilize-3428.149.B stabilize-3428.193 stabilize-3658.0.0 stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-3701.81.B stabilize-bluetooth-smart stabilize-daisy stabilize-link stabilize-link-2913.278 stabilize2 toolchain-3428.65.B toolchain-3701.42.B
David Hendricks [Wed, 2 May 2012 21:51:57 +0000 (14:51 -0700)]
Add libfmap.a to install and uninstall rules

BUG=none
TEST=locally compiled

"sudo emerge flashmap" (amd64) --> /usr/lib64/libfmap.a
"emerge-daisy flashmap" (32-bit) --> /build/daisy/usr/lib/libfmap.a

adding -C to those commands removes the .a files

Change-Id: I679e040675db4eedd79b2bbc55b49f20d0fe79e4

2 years agouse libdir for .pc install 27/11127/1 factory-1284.B factory-1412.B factory-1987.B firmware-kiev-2.112.B firmware-uboot_v2-1299.B release-R17-1412.B release-R18-1660.B release-R19-2046.B
Mike Frysinger [Wed, 2 Nov 2011 16:33:05 +0000 (12:33 -0400)]
use libdir for .pc install

The .pc files should be under the same libdir as the libraries, so use
the existing $(libdir) variable rather than hardcoding /usr/lib/ when
installing the pkg-config files.

BUG=chromium-os:20636
TEST=`emerge-amd64-generic flashmap` and see .pc files in /usr/lib64/
TEST=`emerge-x86-generic flashmap` and see .pc files in /usr/lib/

Change-Id: I619f6d4c7d04eda0cbe0e3d0fed987a69d764021

3 years agoset flashmap install prefix to /usr instead of /usr/local 08/11008/4
David Hendricks [Tue, 1 Nov 2011 23:09:53 +0000 (16:09 -0700)]
set flashmap install prefix to /usr instead of /usr/local

/usr/local/ does not exist on non-developer images in Chrome OS.

BUG=chromium-os:22304
TEST=Built locally and ensured files are placed in /usr instead of /usr/local.

For x86-generic:
/build/x86-generic/usr/lib/libfmap.so
/build/x86-generic/usr/lib/libfmap.so.0
/build/x86-generic/usr/lib/pkgconfig/fmap.pc
/build/x86-generic/usr/lib/libfmap.so.0.0.0
/build/x86-generic/usr/include/fmap.h
/build/x86-generic/usr/sbin/fmap_encode
/build/x86-generic/usr/sbin/fmap_decode
/build/x86-generic/usr/sbin/fmap_csum

For amd64-generic:
/build/amd64-generic/usr/lib/pkgconfig/fmap.pc
/build/amd64-generic/usr/lib64/libfmap.so
/build/amd64-generic/usr/lib64/libfmap.so.0
/build/amd64-generic/usr/lib64/libfmap.so.0.0.0
/build/amd64-generic/usr/include/fmap.h
/build/amd64-generic/usr/sbin/fmap_encode
/build/amd64-generic/usr/sbin/fmap_decode
/build/amd64-generic/usr/sbin/fmap_csum

Change-Id: I64278c91c4b52f4d89d8d174a579ddb62da3a0c1

3 years agoUpdate libfmap naming and install rule 98/10698/6
David Hendricks [Wed, 26 Oct 2011 03:39:44 +0000 (20:39 -0700)]
Update libfmap naming and install rule

This updates the libfmap .so filename to better match GNU convention
and also updates the soname (seen when running objdump -x). It also
updates the installation so that the package installs symbolic links.

(Note: There was also some disambiguation between the lib directory
 belonging to the system and the lib directory belonging to the source)

BUG=chrome-os-partner:6600
TEST=locally built for arm-generic and amd64-generic targets

Change-Id: Ib1002f20a1a324bd9583f617f59cf3804e06659c

3 years agoRevert "add version number to -lfmap provided by pkg-config" 95/10695/1
David Hendricks [Wed, 26 Oct 2011 01:40:48 +0000 (18:40 -0700)]
Revert "add version number to -lfmap provided by pkg-config"

This turned out to be less useful than originally thought. Nothing broke, but nothing was gained either. Reverting.

This reverts commit e4b12265cf338b774f5bf338db7fb7c587387293

3 years agoadd version number to -lfmap provided by pkg-config 13/10613/1
David Hendricks [Tue, 25 Oct 2011 01:22:10 +0000 (18:22 -0700)]
add version number to -lfmap provided by pkg-config

This is intended as a short-term fix to some linking issues caused by
the strange soname configuration currently used in this package, namely
that successfully linking other packages to libfmap depends on a symlink
being created by ldconfig, which is currently created more or less on accident.

Future versions will likely revert this change and come with some other
changes to the Makefile.

BUG=none
TEST=See notes below.
Before:
pkg-config-x86-generic --libs-only-l fmap
-lfmap

After:
pkg-config-x86-generic --libs-only-l fmap
-lfmap-0.3

Change-Id: I103e7661d0a1b322e7b477e28f366da2cc499476

3 years agoAdd pkg-config support to flashmap 46/8446/2
David Hendricks [Wed, 28 Sep 2011 00:04:48 +0000 (17:04 -0700)]
Add pkg-config support to flashmap

This adds a rule to the Makefile to generate a pkg-config .pc file
and install it if:
1) /usr/lib/pkgconfig is a directory
2) The user sets an environment variable.

The latter is useful for sandboxed environments since /usr/lib/pkgconfig
might exist in the target environment but not the sandbox where flashmap
is being built.

BUG=none
TEST=Test compiled on Goobuntu, cros_sdk (emerge), and x86-generic (emerge-x86-generic)

Change-Id: Id45ef5300b693f8258671729b624b82ea1780965

3 years agoConditionally assign toolchain variables 00/7300/1
David Hendricks [Tue, 6 Sep 2011 22:20:12 +0000 (15:20 -0700)]
Conditionally assign toolchain variables

tc-export apparently does not set the CROSS_COMPILE prefix for tools like gcc,
ar, etc. Instead, it seems to set the variables directly.

Conditionally assigning them in the Makefile with "?=" instead of "=" or ":="
makes cross compilation work for board overlays. With "=" instead of "?=",
compilation fails complaining that "atom" is not value for -mtune and -march.

BUG=none
TEST=Compiled for host (amd64), x86-generic and tegra2_seaboard

Change-Id: I9ddb2eb769d53be3ade5e325e9b83f343b9b19ba

3 years agoInitial import of flashmap 07/7207/1 factory-1020.B release-1011.B
David Hendricks [Wed, 31 Aug 2011 19:29:48 +0000 (12:29 -0700)]
Initial import of flashmap