Commit graph

88 commits

Author SHA1 Message Date
Elliott Hughes
726a6a9159 libsparse: python3.
Test: treehugger
Test: ran simg_dump.py on a file created by img2simg
Change-Id: I999747867733a2e789c0da95add0bba83c36133f
2021-08-17 15:02:00 -07:00
Bob Badour
d69ad69a93 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id740a7d2884556081fdb68876584b25eb95e1bef
2021-02-19 12:59:05 -08:00
Elliott Hughes
c3a206ccda Revert "[LSC] Add LOCAL_LICENSE_KINDS to system/core"
This reverts commit 187b7d1950.

Reason for revert: system/core is multiple projects, not one.

Change-Id: I790ea41741f8cd9b8b6db2f59a49e71fb0958fd6
2021-02-16 20:01:20 +00:00
Bob Badour
187b7d1950 [LSC] Add LOCAL_LICENSE_KINDS to system/core
Added SPDX-license-identifier-Apache-2.0 to:
  bootstat/Android.bp
  cli-test/Android.bp
  code_coverage/Android.bp
  cpio/Android.bp
  debuggerd/crasher/Android.bp
  debuggerd/proto/Android.bp
  diagnose_usb/Android.bp
  fs_mgr/libdm/Android.bp
  fs_mgr/libfiemap/Android.bp
  fs_mgr/liblp/Android.bp
  fs_mgr/libsnapshot/Android.bp
  fs_mgr/libstorage_literals/Android.bp
  fs_mgr/libvbmeta/Android.bp
  fs_mgr/tests/Android.bp
  fs_mgr/tools/Android.bp
  gatekeeperd/Android.bp
  healthd/Android.bp
  healthd/testdata/Android.bp
  init/Android.bp
  init/Android.mk
  init/sysprop/Android.bp
  init/test_kill_services/Android.bp
  init/test_service/Android.bp
  libappfuse/Android.bp
  libasyncio/Android.bp
  libbinderwrapper/Android.bp
  libcrypto_utils/Android.bp
  libcrypto_utils/tests/Android.bp
  libdiskconfig/Android.bp
  libgrallocusage/Android.bp
  libkeyutils/mini_keyctl/Android.bp
  libmodprobe/Android.bp
  libnetutils/Android.bp
  libpackagelistparser/Android.bp
  libprocessgroup/Android.bp
  libprocessgroup/cgrouprc/Android.bp
  libprocessgroup/cgrouprc_format/Android.bp
  libprocessgroup/profiles/Android.bp
  libprocessgroup/setup/Android.bp
  libqtaguid/Android.bp
  libsparse/Android.bp
  libstats/push_compat/Android.bp
  libsuspend/Android.bp
  libsync/Android.bp
  libsystem/Android.bp
  libsysutils/Android.bp
  libusbhost/Android.bp
  libutils/Android.bp
  libvndksupport/Android.bp
  libvndksupport/tests/Android.bp
  llkd/Android.bp
  llkd/tests/Android.bp
  property_service/libpropertyinfoparser/Android.bp
  property_service/libpropertyinfoserializer/Android.bp
  property_service/property_info_checker/Android.bp
  qemu_pipe/Android.bp
  reboot/Android.bp
  rootdir/Android.bp
  rootdir/Android.mk
  rootdir/avb/Android.bp
  rootdir/avb/Android.mk
  run-as/Android.bp
  sdcard/Android.bp
  set-verity-state/Android.bp
  shell_and_utilities/Android.bp
  storaged/Android.bp
  toolbox/Android.bp
  trusty/apploader/Android.bp
  trusty/confirmationui/Android.bp
  trusty/confirmationui/fuzz/Android.bp
  trusty/coverage/Android.bp
  trusty/fuzz/Android.bp
  trusty/fuzz/test/Android.bp
  trusty/gatekeeper/Android.bp
  trusty/gatekeeper/fuzz/Android.bp
  trusty/keymaster/Android.bp
  trusty/keymaster/fuzz/Android.bp
  trusty/libtrusty/Android.bp
  trusty/libtrusty/tipc-test/Android.bp
  trusty/secure_dpu/Android.bp
  trusty/storage/interface/Android.bp
  trusty/storage/lib/Android.bp
  trusty/storage/proxy/Android.bp
  trusty/storage/tests/Android.bp
  trusty/utils/spiproxyd/Android.bp
  trusty/utils/trusty-ut-ctrl/Android.bp
  usbd/Android.bp
  watchdogd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  debuggerd/Android.bp
  fastboot/Android.bp
  libkeyutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-MIT
to:
  Android.bp
  libcutils/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  fs_mgr/Android.bp
  fs_mgr/libfs_avb/Android.bp
  trusty/utils/rpmb_dev/Android.bp

Added SPDX-license-identifier-BSD
to:
  fastboot/fuzzy_fastboot/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I5bd81adb5cdcf2b4dd4141b204eb430ff526af8f
2021-02-16 04:10:03 -08:00
Jiyong Park
3ed3d4cd94 Add assemble_cvd to com.android.virt
assemble_cvd directly or indirectly depends on these modules. To add
assemble_cvd to the com.anroid.virt APEX, these modules are marked as
being available to the APEX.

Bug: 174639526
Test: m com.android.virt
Change-Id: Id3b2989a9f038a1cdc769a2021a116cf09ab1b15
2021-01-05 14:46:01 +09:00
Yifan Hong
e85233c560 libsparse: make vendor_ramdisk_available.
Test: pass
Bug: 173425293
Change-Id: Id360f205b9135b83edb59d13f978eb28cad041de
2020-11-19 17:35:21 -08:00
Alistair Delva
9e28cd32fd Make libsparse vendor_available
We are porting cuttlefish to Android, it currently uses libsparse to
desparse Android filesystems to be used directly as disk images by
crosvm. Making this library available to 'vendor' enables us to support
desparsing downloaded images on-device as well.

Bug: 167675429
Change-Id: I8ae4a916cfb0b2002dd9e462f32e8cb0e533d821
2020-09-03 08:43:46 -07:00
Hyeongseok Kim
e8d02c50d7 libsparse: Fix overflow of merged sparse chunk length
Merging sparse chunk can make sparse map block bigger than 4GiB,
that can't be covered by unsigned integer type. Fix this by
changing unsigned int to uint64_t type.

Test: sparse build
Bug: 162808120
Change-Id: Id4d3f88f9d531c25c3937c99b2c81efb915605ee
Signed-off-by: Hyeongseok Kim <hyeongseok@gmail.com>
Cc: hyeongseok.kim <hyeongseok.kim@lge.com>
2020-08-11 08:34:28 +09:00
Woody Lin
a386482f1d libsparse: Limit block size to 64 MB
Limit the block size to 64 MB before fastboot executable binary for
windows 64-bit is released.

Bug: 156057250
Change-Id: Ic4edb963a3d99f718d7630aba3f351729a84e994
2020-06-03 11:45:17 +08:00
Elliott Hughes
c44f50ca58 libsparse: use memory-mapping on Windows too.
Bug: 156057250
Test: treehugger
Change-Id: Icdd2dfa43208ca4086e709d09c4cafbec4b84791
2020-05-14 16:52:18 -07:00
Yifan Hong
7dd4553991 Make ramdisk_available.
Test: pass
Bug: 147347110
Change-Id: I9787e386e552393efc5beed5aac577be9ce1a3c5
2020-01-22 16:47:14 -08:00
Robin Hsu
48c9f6196f libsparse: fix memory leak in output_file_close()
Fix memory leak in output_file_close():
Arguable whose resposibility to free structs allocated inside a file
struct (the caller or the library function), but the following protocol
(i.e. this fix) would better prevent memory leaks:
1) output_file_close() function will free those structs inside a file struct,
   right before closing the file.
   * Note: those structs are originally allocated by other libsparse function.
2) If the caller wants to clean up those struct inside a file struct,
   it may.  Just free those structs, and set the pointer to NULL.
   Afterward, when file_close()'s are called, they won't be free'ed twice.

Bug: 142483439
Test: verified by script MemLeak_LastCmd.sh (attached in Bugnizer)
Change-Id: I8bb9f7c9f7d19268663e2830d1a90d27bd5f99bd
Signed-off-by: Robin Hsu <robinhsu@google.com>
2019-11-12 18:52:29 +08:00
hamzeh
d17dc6af52 Add fuzzer for libsparse
Bug: 141129284
Test: SANITIZE_TARGET="hwaddress fuzzer' make libsparse_fuzzer
Change-Id: I54e19d399f7ea29a45734f1ddc520ceec56add09
2019-09-25 13:27:52 -07:00
cfig
946da7c528
libsparse: replace legacy min() with std::min()
this makes libsparse compile with MacOS clang++
Test: "libsparse" compiles and works fine under both Linux and MacOS

Change-Id: Ifcf018b856d2fe5f1dac7eeddd72de2810be66c5
2019-08-15 14:07:51 +08:00
Stephen Hines
45b11d9035 Fix an unintialized return value.
Bug: http://b/131390872
Test: Built aosp_blueline successfully.
Change-Id: Iea5255be280dfc089a95fc25a0f988e913c18679
2019-05-02 12:54:09 -07:00
Sasha Smundak
3a62fc44e8 Convert Android.mk file to Android.bp
See build/soong/README.md for more information.

Bug: 122332380
Test: treehugger
Change-Id: I39a69c722922cfb19059d10ff37132442f0337ba
2019-01-24 21:16:39 -08:00
Chih-Hung Hsieh
5d08f63950 Fix cert-dcl16-c clang-tidy warnings.
Bug: 120614316
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,cert-dcl16-c
Change-Id: I069b2c861cf7c349445c15bf789908377fe7227f
2018-12-11 10:38:27 -08:00
Tobias Thierer
fca4a9c279 Revert "libsparse: Add sparse typed callback"
This reverts commit db69f0d47f.

Reason for revert: Broke the build:

In file included from system/core/libsparse/sparse.cpp:26:
system/core/libsparse/output_file.h:34:72: error: unknown type name 'off64_t'; did you mean 'off_t'?
int (*skip_write)(void*, off64_t), void* priv,
^~~~~~~
off_t
/Applications/Xcode6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/sys/_types/_off_t.h:30:25: note: 'off_t' declared here
typedef __darwin_off_t off_t;
^
1 error generated.

Bug: 78793464
Change-Id: I0f8bc4e9aa2f74612bfd8721d00d961e3f7e695f
2018-07-26 05:23:45 +00:00
Jerry Zhang
db69f0d47f libsparse: Add sparse typed callback
Currently, sparse_file_callback uses libsparse's
own logic for reading a file into a buffer. However,
a caller may want to use their own logic for doing
this in order to customize the buffer size and parallelize
the reads/writes. Also, a caller may want to implement
fill blocks with their own logic as well. To do this
add sparse_file_typed_callback which calls a different
callback function depending on the type of the sparse
chunk being written.

Test: Use typed callback for fd writes
Bug: 78793464
Change-Id: I75955a464fc05991f806339830fdfa05fda354b9
2018-07-25 11:04:03 -07:00
Yi Kong
17ba95ed9e [libsparse] Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning.

Test: m
Bug: 68236239
Change-Id: I43dae734817cae7a260ffc7afcd85fbd4451eddf
2018-07-23 23:32:01 +00:00
Treehugger Robot
06651fbe02 Merge "libsparse: add OWNERS." 2018-06-13 21:48:29 +00:00
Jerry Zhang
7b444f08c1 libsparse: Add .clang-format and reformat to google3 style
Bug: 78793464
Test: compiles
Change-Id: I8e44ba77195a12fc2bac7d4276bbc4aa95149b31
2018-06-13 20:32:24 +00:00
Elliott Hughes
91e66ab14a libsparse: add OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ie26da2ff47de4cef20050b996a04d53c2b5c358f
2018-06-13 12:43:08 -07:00
Jerry Zhang
5a75507795 libsparse: Change source files to cpp
Bug: 78793464
Test: compiles
Change-Id: Ib8b933fe3ccb8dfa49a77f7955891678bf0df086
2018-06-13 11:17:22 -07:00
Jerry Zhang
50e6029a4e libsparse: Add method to create sparse file from buffer
Refactor elements of sparse file parsing that depend on
an fd into SparseFileSource class, then create implementations
using both fd and buffer. Add sparse_file_read_buf which
reads the given buffer into a sparse file cookie without
copying.

Test: flash system with sparse images
Bug: 78793464
Change-Id: Ice6c8e1ff075d6867e070f80fcf5aa4f530a1b95
2018-06-07 14:33:18 -07:00
Jiyong Park
a0e75045e6 Build adbd for recovery
adbd (and its dependencies) are marked as recovery_available:true so
that recovery version of the binary is built separately from the one for
system partition. This allows us to stop copying the system version to
the recovery partition and also opens up the way to enable shared
libraries in the recovery partition. Then we can also build adbd as a
dynamic executable.

Bug: 79146551
Test: m -j adbd.recovery
Change-Id: Ib95614c7435f9d0afc02a0c7d5ae1a94e439e32a
2018-05-24 14:11:11 +09:00
Tao Bao
e18c03165b libsparse: Use 'size_t' for the 'len' parameter in callbacks.
This CL updates the callback function signature in
sparse_file_callback() and sparse_file_foreach_chunk().

Before:
int sparse_file_callback(
    struct sparse_file *s, bool sparse, bool crc,
    int (*write)(void *priv, const void *data, int len), void *priv);

int sparse_file_foreach_chunk(
    struct sparse_file *s, bool sparse, bool crc,
    int (*write)(
        void *priv, const void *data, int len, unsigned int block,
        unsigned int nr_blocks),
    void *priv);

After:
int sparse_file_callback(
    struct sparse_file *s, bool sparse, bool crc,
    int (*write)(void *priv, const void *data, size_t len), void *priv);

int sparse_file_foreach_chunk(
    struct sparse_file *s, bool sparse, bool crc,
    int (*write)(
        void *priv, const void *data, size_t len, unsigned int block,
        unsigned int nr_blocks),
    void *priv);

The length (i.e. 'len') comes from the size of a chunk, which could be
legitimately larger than INT_MAX. Prior to this CL, callers (e.g.
write_sparse_data_chunk()) were already passing unsigned int to the
callbacks. When a chunk size exceeds INT_MAX, the callback would see a
negative value, which could lead to undesired behavior. For example,
out_counter_write(), as one of the internal callbacks in libsparse,
gives a wrong sum of chunk sizes, which in turn fails the fastboot
flashing when given a huge sparse image.

It also defines SPARSE_CALLBACK_USES_SIZE_T that allows clients to keep
their codes compatibile with both versions.

Bug: 78432315
Test: `m dist` (with matching changes to all the clients)
Test: Build fastboot and successfully flash a previously failing (huge)
      sparse image.
Change-Id: Iac4bcf7b57039d08af3c57f4be00d75f6b693d93
2018-04-25 10:29:22 -07:00
Treehugger Robot
796987482f Merge "<stdbool.h> not necessary in C++." 2017-10-17 19:26:53 +00:00
Elliott Hughes
a0f73f9bff <stdbool.h> not necessary in C++.
Bug: N/A
Test: builds
Change-Id: I1f32b202e353414e74ace87a7d5b495b5deb5f99
Merged-In: I1f32b202e353414e74ace87a7d5b495b5deb5f99
2017-10-17 16:21:33 +00:00
Xiaolei Yu
c39caafbbb libsparse: fix building on linux host.
memset is declared in <string.h>

Test: builds and works on host

Change-Id: I224a01c78ee1d0c2f8d5e86eef10c84c8960cbc0
2017-10-11 15:37:52 +08:00
Dan Willemsen
5cfa006059 Rename libz-host -> libz
Test: m host
Change-Id: Ib276431d13b3e1bd243f84a80f69aafc12e71aac
2017-09-27 16:24:45 -07:00
Chris Fries
221af0990b Merge "libsparse: Fix odd-sized input files total_blks" am: 652ce94f40 am: ab74c778df
am: cbd8d9d4f5

Change-Id: I3c7afcd7a3a3bab4460123751d0a5696cb1892c6
2017-04-19 19:26:27 +00:00
Chris Fries
3738968ed8 libsparse: Fix odd-sized input files total_blks
If the input file isn't a multiple of block_size, count the trailing
bit as a block in the output, otherwise bootloader will try to write
past the last declared block in the sparse file.

Test: Run sparse_test
Bug: 37339998
Change-Id: Iec143107d15795c6a6f4d3ea7b7515f6f16adcae
2017-04-19 10:32:45 -05:00
Chris Fries
4da21cdeb2 Merge "libsparse: Fix verbose_error string usage" am: 0bdf6539d6 am: 006ea1aebc
am: 5a07296873

Change-Id: I0e96c2b6212b115e4a3098cf462d5e5686a6de4a
2017-04-18 22:20:27 +00:00
Chris Fries
a7eeb22efb libsparse: Fix verbose_error string usage
Switch vnsprintf to StringPrintf to avoid off-by-one, and switch
sparse_read.c to cpp.

Test: fastboot flash normal image with smaller sparse limit

Change-Id: Ia399b167625deb271bfd0ee3273071306d71c4d4
2017-04-18 10:53:49 -05:00
Alex Deymo
4786e4e24f Remove "_host" and "_static" suffix from libsparse definition. am: b0c395955d am: 7b8d66e7cc am: 11b65cf3be
am: 092a732ef2

Change-Id: I3d9639af9f9f66742660edbbf62f73909c0d6915
2017-01-12 22:45:52 +00:00
Alex Deymo
b0c395955d Remove "_host" and "_static" suffix from libsparse definition.
This now combines all the "libsparse" libraries into the same soong
target. A minor side-effect of this change is that the libsparse
static library depends on the libz shared library instead of the libz
static library. This minor change has no effect since targets using
the static libsparse library need to explicitly include either the
static libz or the shared one.

Bug: 34220783
Change-Id: I8f41586cf4c3336791cfa57ab4f5ae59a76d7ffa
2017-01-11 19:15:11 -08:00
Adrien Schildknecht
ad0cd64332 Manually merge commit '61e74d7' into stage-aosp-master am: 9f9a239ca3 am: aec7316546
am: 669716d27c

Change-Id: I75f9c115fe178008174f1fea8cb8b890b83c2543
2016-12-03 04:20:07 +00:00
Adrien Schildknecht
a26a6bd6f3 libsparse: add a function to retrieve the data blocks
Test: m libsparse

Change-Id: I04bd3912bb4364e591b064ec2aab782cf02f6bd7
2016-11-30 19:16:28 -08:00
Colin Cross
84f83a57de Merge "libsparse: output_file.c, fix large data chunk issue" am: 62c9101646 am: faaeda8e12 am: 4179f2ec65
am: c0422d1b2a

Change-Id: I812e1f268fa8c3a1ba8b5555319424cadf07a707
2016-10-07 17:39:17 +00:00
Jeremy Compostella
fca594c2de libsparse: output_file.c, fix large data chunk issue
CHUNK_HEADER structure type allows DATA chunk to be up to MAX_UINT
large.

The write() callback LEN parameter should be unsigned int.

Also:
- write() callback should continue to write data if less than expected
  data have been written.
- gzerror() returns LEN on success, 0 otherwise

Test: manual
Change-Id: Id46d664b84c1a506f419524fe28055f784c2ae7a
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
2016-10-06 09:53:42 -07:00
Elliott Hughes
c2b3b5fade Merge "Test for _WIN32 in instead of USE_MINGW." am: ec99158580 am: 2e7e065db9 am: 04819403d6
am: c9dc124e2f

Change-Id: I2cfb73fc12da1bb6396bfdd8f638b9ce977f84bc
2016-10-05 18:44:02 +00:00
Elliott Hughes
34a4f0b8c7 Test for _WIN32 in instead of USE_MINGW.
Bug: http://b/23392815
Test: builds
Change-Id: I7fce8de1f0e2314170cce456cd49346dcee9d134
2016-10-05 09:37:44 -07:00
Patrick Tjin
c38720a962 libsparse: Add .csv and sha1 options for simg_dump.py
Adds CSV output option to output blocks to a CSV file.

Adds option to output SHA1 sum for each block.

Addressed misc lint errors

Test: compared output with previous version
Change-Id: I555c8816c6ef2b0b69dac2b9789fbfd8b2786a49
2016-10-03 15:34:37 -07:00
Dan Willemsen
45f05240c2 Convert more Android.mk files to Android.bp
These modules have their dependencies satisfied, and aren't doing
anything strange.

Change-Id: I72039a15256cbd5e5eee0d79a15d66d74a6c087d
2016-07-13 17:41:45 -07:00
Chih-Hung Hsieh
eabd5108b3 Fix misc-macro-parentheses warnings in libion, libsparse, libmem*
Bug: 28705665
Change-Id: I3dd5c086787f5e48ab100a71a42109ea0e417bf9
2016-05-18 15:41:16 -07:00
Colin Cross
1eb743ba8b Fix static analyzer issues caught by clang
system/core/libsparse/sparse_read.c:260:51: warning: Dereference of null pointer (loaded from variable 'crc_ptr')
                        ret = process_crc32_chunk(fd, chunk_data_size, *crc_ptr);
system/core/libsparse/sparse_read.c:404:9: warning: Potential leak of memory pointed to by 'buf'
        return 0;

Fixes leak in sparse_file_read_normal, and null pointer dereference
crash if an image with an obsolete CRC chunk was read with CRC checking
disabled.

Bug: 26904425

Change-Id: Ibc72cd37602929ae2c248bea1cdd1d22ea03baaf
2016-02-01 11:19:26 -08:00
Colin Cross
b5619d9630 Turn off CRC checking for append2simg
make_ext4fs doesn't write out a CRC chunk, and append2simg doesn't
either, but append2simg was still performing a CRC on every input
block.  Cuts append2simg time in half.

Change-Id: I678f807abbb741042461ed68a0f61b406d3665fb
2015-12-17 17:28:44 -08:00
caozhiyuan
f21f0f16e7 Fix parameter to lseek
Change-Id: I9c497a3ebc24ca1db92d0b9d3d1e9ac49dc40f75
2015-10-20 14:15:31 -07:00
Daniel Micay
af090a6ea8 fix misuse of formatting specifiers
The Clang/GCC formatting warning triggers for usage of %lld with off_t
on 64-bit because it's defined as a long int, not a long long int. It
isn't important, but it's technically undefined.

This fix is in anticipation of adding __attribute__((format(...))) to
many functions where it is currently missing.

Change-Id: I2bf33e6563a2892d2f54d7c582cbdeadf867e84f
2015-10-13 16:22:33 -04:00