Commit Graph

1619 Commits

Author SHA1 Message Date
Tao Bao 6f1f20622e am 6997c287: Merge "updater: Clean up C codes."
* commit '6997c287bedbd32fb5ffb84fc2efd081e6f56d3e':
  updater: Clean up C codes.
2015-09-03 00:32:04 +00:00
Tao Bao 6997c287be Merge "updater: Clean up C codes." 2015-09-02 21:45:36 +00:00
Tao Bao 0940fe17b0 updater: Clean up C codes.
Replace C-string with std::string, pointers with references, and
variable-size arrays in struct with std::vector.

Change-Id: I57f361a0e58286cbcd113e9be225981da56721b2
2015-09-01 12:57:35 -07:00
Tao Bao 73468ee8fb am 5a16eba2: am eef99138: Merge "updater: Remove the unused isunresumable in SaveStash()."
* commit '5a16eba2c323ecb4f1dd1ecb2ecea7a0ac8bdbb5':
  updater: Remove the unused isunresumable in SaveStash().
2015-08-26 21:17:50 +00:00
Tao Bao 5a16eba2c3 am eef99138: Merge "updater: Remove the unused isunresumable in SaveStash()."
* commit 'eef991389c7f739dd80bbe6e4a3699322c12dcfb':
  updater: Remove the unused isunresumable in SaveStash().
2015-08-26 21:10:23 +00:00
Tao Bao eef991389c Merge "updater: Remove the unused isunresumable in SaveStash()." 2015-08-26 21:03:01 +00:00
Tao Bao 304c65b8fc am dc61d17d: am 50c17f9d: Merge "GOOGLEGMS-749 Fix integer overflow while applying block based OTA package"
* commit 'dc61d17d5b3c9e85a2863ec461170263325f1466':
  GOOGLEGMS-749 Fix integer overflow while applying block based OTA package
2015-08-26 01:14:31 +00:00
Tao Bao 9739a2920c updater: Remove the unused isunresumable in SaveStash().
Change-Id: I6a8d9bea4c1cd8ea7b534682061b90e893b227a2
2015-08-25 18:05:38 -07:00
Tao Bao dc61d17d5b am 50c17f9d: Merge "GOOGLEGMS-749 Fix integer overflow while applying block based OTA package"
* commit '50c17f9da69ed3de0cd3ed032c50af067c1dc1f1':
  GOOGLEGMS-749 Fix integer overflow while applying block based OTA package
2015-08-26 01:05:09 +00:00
Tao Bao 50c17f9da6 Merge "GOOGLEGMS-749 Fix integer overflow while applying block based OTA package" 2015-08-26 00:57:42 +00:00
Shrinivas Sahukar a6153df887 GOOGLEGMS-749 Fix integer overflow while applying block based OTA package
There is an integer overflow when the size of system goes beyond the
signed int limits. Hence changing pos to size_t.

Change-Id: I6e5e1b2f0e72030b30a6df09a01642f4c82abc79
2015-08-21 15:59:28 -07:00
Tao Bao 822685a864 am dbbdcf3f: am 93fa4b67: Merge "edify: Switch to C++."
* commit 'dbbdcf3fd817128f89474f9ea8c84743fc648a1a':
  edify: Switch to C++.
2015-08-21 18:20:17 +00:00
Tao Bao dbbdcf3fd8 am 93fa4b67: Merge "edify: Switch to C++."
* commit '93fa4b677cac9288e936915f15ca8e5f76a4e4b6':
  edify: Switch to C++.
2015-08-21 17:39:39 +00:00
Tao Bao 93fa4b677c Merge "edify: Switch to C++." 2015-08-21 17:36:11 +00:00
Tao Bao 2a5a49d337 edify: Switch to C++.
Change-Id: I71aede6e29af1dc4bb858a62016c8035db5d3452
2015-08-20 12:11:04 -07:00
Tao Bao a9a50fef97 am 4854e292: am ad509fd4: Merge "Fix potential crash"
* commit '4854e292e0cd0eb58bce4488dc849273904d9302':
  Fix potential crash
2015-08-11 16:23:52 +00:00
Tao Bao 4854e292e0 am ad509fd4: Merge "Fix potential crash"
* commit 'ad509fd4a2c597ced8e53b0817f754cb2209b98a':
  Fix potential crash
2015-08-11 16:17:24 +00:00
Tao Bao ad509fd4a2 Merge "Fix potential crash" 2015-08-11 16:11:44 +00:00
Tao Bao 06e6ccb98a am 434a1761: am 0d46c7ab: Merge "Use unique_ptr and unique_fd to manager FDs."
* commit '434a1761aac48b8e3c13d5a6cb3edd90c8667f6f':
  Use unique_ptr and unique_fd to manager FDs.
2015-08-10 17:42:19 +00:00
Tao Bao b65a90235e am 7f89389a: am 7c511184: Merge "updater: Clean up char* with std::string."
* commit '7f89389a0b55d13ee1c9026c33f17dc1cc9c7ace':
  updater: Clean up char* with std::string.
2015-08-10 17:37:52 +00:00
Tao Bao 434a1761aa am 0d46c7ab: Merge "Use unique_ptr and unique_fd to manager FDs."
* commit '0d46c7ab02eb97d6b4b2e26b9202fd9b4e9dd8c8':
  Use unique_ptr and unique_fd to manager FDs.
2015-08-10 17:35:06 +00:00
Tao Bao 7f89389a0b am 7c511184: Merge "updater: Clean up char* with std::string."
* commit '7c511184bf3ed44f3590027730a64d565c0e12ee':
  updater: Clean up char* with std::string.
2015-08-10 17:29:54 +00:00
Tao Bao 0d46c7ab02 Merge "Use unique_ptr and unique_fd to manager FDs." 2015-08-10 17:28:52 +00:00
Tao Bao 7c511184bf Merge "updater: Clean up char* with std::string." 2015-08-10 17:23:13 +00:00
Tao Bao c754792a07 Use unique_ptr and unique_fd to manager FDs.
Clean up leaky file descriptors in uncrypt/uncrypt.cpp. Add unique_fd
for open() and unique_file for fopen() to close FDs on destruction.

Bug: 21496020
Change-Id: I0174db0de9d5f59cd43b44757b8ef0f5912c91a2
2015-08-09 22:35:49 -07:00
Dan Albert c2e91625a7 am 236b3eb6: am e67104a6: Merge "Use CPPFLAGS instead of CFLAGS."
* commit '236b3eb6a085bd0762849b5feca880f6dc63787d':
  Use CPPFLAGS instead of CFLAGS.
2015-08-08 00:56:58 +00:00
Dan Albert 236b3eb6a0 am e67104a6: Merge "Use CPPFLAGS instead of CFLAGS."
* commit 'e67104a6a778f70bd479e737b09eb32c835e250e':
  Use CPPFLAGS instead of CFLAGS.
2015-08-08 00:51:16 +00:00
Dan Albert e67104a6a7 Merge "Use CPPFLAGS instead of CFLAGS." 2015-08-08 00:45:43 +00:00
Dan Albert b02e90f85c Use CPPFLAGS instead of CFLAGS.
While we build these as C, to the build system they are technically
C++ and are subject to the global CPPFLAGS. Set LOCAL_CPPFLAGS here
instead of LOCAL_CFLAGS so we can be sure we override anything
provided by the build system.

Bug: http://b/23043421
Change-Id: I344b54ae4ff9f142365a42c33ba160c1be17a342
2015-08-07 17:24:49 -07:00
Elliott Hughes 8fa0007a3e am a9390df6: am 06689dc5: Merge "Fix recovery image build."
* commit 'a9390df6c6b8d6cc98b102aeffc8e7acd300c857':
  Fix recovery image build.
2015-08-07 21:17:02 +00:00
Elliott Hughes a9390df6c6 am 06689dc5: Merge "Fix recovery image build."
* commit '06689dc53d14ab0449c64c097d2937179f986873':
  Fix recovery image build.
2015-08-07 20:29:52 +00:00
Elliott Hughes 06689dc53d Merge "Fix recovery image build." 2015-08-07 20:24:21 +00:00
Elliott Hughes faa75006af Fix recovery image build.
A recent adb cleanup changed the signature of adb_main.

Change-Id: I98d084f999966f1a7aa94c63e9ed996b3375096d
2015-08-07 13:21:06 -07:00
Tao Bao e6aa3326c1 updater: Clean up char* with std::string.
So we can remove a few free()s. And also replace a few pointers with
references.

Change-Id: I4b6332216704f4f9ea4a044b8d4bb7aa42a7ef26
2015-08-06 13:05:00 -07:00
Jeremy Compostella 1b7d9b7368 Fix potential crash
Malloc might fail when replacing package path. In this case, print a
clear error message in the logs and let the OTA fails.

Change-Id: I7209d95edc025e3ee1b4478f5e04f6e852d97205
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Signed-off-by: Gaelle Nassiet <gaellex.nassiet@intel.com>
2015-08-05 10:15:32 +02:00
Tao Bao 7daa48e62f resolved conflicts for merge of be19dce8 to mnc-dev-plus-aosp
Change-Id: Ic11b543d45f565ffb5a1f2b7b06e953f0235bfb3
2015-08-04 14:07:55 -07:00
Tao Bao 0e2efab345 am 393d1e73: am 27c1ab20: Merge "udpater: Call fsync() after rename()."
* commit '393d1e739fc10e526bd3b7b83836a266bfa24079':
  udpater: Call fsync() after rename().
2015-08-04 18:42:21 +00:00
Tao Bao 393d1e739f am 27c1ab20: Merge "udpater: Call fsync() after rename()."
* commit '27c1ab2095f25253d0920eb6afe7cd2791a708dc':
  udpater: Call fsync() after rename().
2015-08-04 18:33:00 +00:00
Tao Bao be19dce86c udpater: Call fsync() after rename().
We need to ensure the renamed filename reaches the underlying storage.

Bug: 22840552
Change-Id: I824b6e9d8a9c5966035be7b42a73678d07376342
(cherry picked from commit dc3922622a)
2015-08-04 11:28:12 -07:00
Tao Bao 27c1ab2095 Merge "udpater: Call fsync() after rename()." 2015-08-04 18:24:53 +00:00
Tao Bao dc3922622a udpater: Call fsync() after rename().
We need to ensure the renamed filename reaches the underlying storage.

Bug: 22840552
Change-Id: Ide2e753a2038691d472b6ee173cbf68ac998a084
2015-08-03 21:35:05 -07:00
Tao Bao 854ae7f9ba am 2e979ef6: am 302779e7: Merge "recovery: Allow "Mount /system" for system_root_image."
* commit '2e979ef6fd21e1681a8ec7ca2f5582ca8e14ddcd':
  recovery: Allow "Mount /system" for system_root_image.
2015-07-31 17:01:33 +00:00
Tao Bao 2e979ef6fd am 302779e7: Merge "recovery: Allow "Mount /system" for system_root_image."
* commit '302779e71cb1be68f60cb044c85436d4d6bcfecc':
  recovery: Allow "Mount /system" for system_root_image.
2015-07-31 16:49:33 +00:00
Tao Bao 302779e71c Merge "recovery: Allow "Mount /system" for system_root_image." 2015-07-31 16:43:39 +00:00
Tao Bao abb8f7785e recovery: Allow "Mount /system" for system_root_image.
When system images contain the root directory, there is no entry of
"/system" in the fstab. Change it to look for "/" instead if
ro.build.system_root_image is true. We actually mount the partition
to /system_root instead, and create a symlink to /system_root/system
for /system. This allows "adb shell" to work properly.

Bug: 22855115
Change-Id: Ibac493a5a9320c98ee3b60bd2cc635b925f5454a
2015-07-30 17:22:29 -07:00
Tao Bao f3f27990f2 am 7666f65b: am 62e19231: Merge "updater: Hoist fsync() to outer loop."
* commit '7666f65b2a1e4352c52df9fe7a0b26ce923a1477':
  updater: Hoist fsync() to outer loop.
2015-07-28 00:34:51 +00:00
Tao Bao 7666f65b2a am 62e19231: Merge "updater: Hoist fsync() to outer loop."
* commit '62e1923194de067c0ac589abcfc4f04fdddf2b1a':
  updater: Hoist fsync() to outer loop.
2015-07-28 00:21:36 +00:00
Tao Bao 62e1923194 Merge "updater: Hoist fsync() to outer loop." 2015-07-28 00:12:31 +00:00
Tao Bao 187efff6f3 updater: Hoist fsync() to outer loop.
Currently the fsync() inside write_all() may be called multiple times
when performing a command. Move that to the outer loop and call it
only after completing the command.

Also remove the O_SYNC flag when writing a stash.

Change-Id: I71e51d76051a2f7f504eef1aa585d2cb7a000d80
2015-07-27 14:17:09 -07:00
Tao Bao cb0e7f2da0 am 0622ccb3: am 6a4a33e3: Merge "applypatch: Fix the checking in WriteToPartition()."
* commit '0622ccb34d504170b76b8f4dd5f0639794be679a':
  applypatch: Fix the checking in WriteToPartition().
2015-07-24 23:29:48 +00:00