Commit graph

1785 commits

Author SHA1 Message Date
Tao Bao
37e3c71da3 Merge "recovery: Fork a process for fuse when sideloading from SD card." 2016-01-14 18:25:54 +00:00
Tao Bao
cdcf28f54f recovery: Fork a process for fuse when sideloading from SD card.
For applying update from SD card, we used to use a thread to serve the
file with fuse. Since accessing through fuse involves going from kernel
to userspace to kernel, it may run into deadlock (e.g. for mmap_sem)
when a page fault occurs. Switch to using a process instead.

Bug: 23783099
Bug: 26313124
Change-Id: Iac0f55b1bdb078cadb520cfe1133e70fbb26eadd
2016-01-13 21:29:20 -08:00
Tao Bao
0305fcecc5 Merge "uncrypt: avoid use-after-free" 2016-01-14 00:41:04 +00:00
Daniel Micay
c5631fc096 uncrypt: avoid use-after-free
The `std::string package` variable goes out of scope but the input_path
variable is then used to access the memory as it's set to `c_str()`.

This was detected via OpenBSD malloc's junk filling feature.

Change-Id: Ic4b939347881b6ebebf71884e7e2272ce99510e2
2016-01-12 14:08:34 -08:00
Ying Wang
ab9db5284e Merge "Rename .l/.y to .ll/.yy" 2016-01-12 17:35:33 +00:00
Ying Wang
c8abc4ec45 Rename .l/.y to .ll/.yy
Now to generate .cpp you need to use .ll/.yy.

Bug: 26492989
Change-Id: Ib078e03b3b0758f7a62595c343e52ae856bcb33f
2016-01-11 18:14:17 -08:00
Tianjie Xu
6f8b9b60db Merge "updater: Add a function to check first block" 2016-01-08 00:23:50 +00:00
Tianjie Xu
57bed6d8c9 updater: Add a function to check first block
Add and register a function to check if the device has been remounted
since last update during incremental OTA. This function reads block 0
and executes before partition recovery for version >= 4.

Bug: 21124327
Change-Id: I8b915b9f1d4736b3609daa9d16bd123225be357f
(cherry picked from commit 30bf476559)
2016-01-07 11:19:48 -08:00
David Riley
8e150a5b24 Merge "imgdiff: skip spurious gzip headers in image files" 2016-01-04 18:02:04 +00:00
David Riley
0779fc9814 imgdiff: skip spurious gzip headers in image files
dragon kernel is compressed via lz4 for boot speed and bootloader
support reasons and recent prebuilts happen to include the gzip header
sequence which is causing imgdiff to fail.

Detect a spurious gzip header and treat the section as a normal section.

Bug: 26133184
Change-Id: I369d7d576fd7d2c579c0780fc5c669a5b6ea0d3d
(cherry picked from commit 0f2f6a746af517afca9e5e089a4a17be0a9766d6)
Signed-off-by: David Riley <davidriley@google.com>
2015-12-23 09:43:59 -08:00
Tao Bao
29b0fbe160 Merge "res: Embed FPS into icon_installing.png." 2015-12-18 22:20:20 +00:00
Tao Bao
b723f4f38f res: Embed FPS into icon_installing.png.
We allow vendor-specific icon installing image but have defined private
animation_fps that can't be overridden. This CL changes the image
generator to optionally embed FPS (otherwise use the default value of
20) into the generated image.

For wear devices, they are using individual images instead of the
interlaced one. Change the animation_fps from private to protected so
that it can be customized.

Bug: 26009230
Change-Id: I9fbf64ec717029d4c54f72316f6cb079e8dbfb5e
2015-12-16 11:35:52 -08:00
Tao Bao
4e72d1a81e Merge "updater: Use O_SYNC and fsync() for package_extract_file()." 2015-12-15 17:55:05 +00:00
Tao Bao
d3cac34430 updater: Use O_SYNC and fsync() for package_extract_file().
We are already using O_SYNC and fsync() for the recursive case
(package_extract_dir()). Make it consistent for the single-file case.

Bug: 20625549
Change-Id: I487736fe5a0647dd4a2428845e76bf642e0f0dff
2015-12-14 17:13:34 -08:00
Tao Bao
e062645efa Merge "update_verifier: Track the API change for isSlotBootable()." 2015-12-11 04:53:48 +00:00
Tao Bao
ca18526760 Merge "uncrypt: Suppress the compiler warnings on LP64." 2015-12-11 00:43:18 +00:00
Tianjie Xu
32f6298742 Merge "updater: Output msg when recovery is called" 2015-12-11 00:23:45 +00:00
Tianjie Xu
3b010bc393 updater: Output msg when recovery is called
Output messages in log when recovery is attempted or succeeded during
incremental OTA update.

Change-Id: I4033df7ae3aaecbc61921d5337eda26f79164fda
(cherry picked from commit b686ba2114)
2015-12-10 16:20:48 -08:00
Tao Bao
612161ef1c update_verifier: Track the API change for isSlotBootable().
[1] added a new API isSlotMarkedSuccessful() to actually query if a
given slot has been marked as successful.

[1]: commit 72c88c915d957bf2eba73950e7f0407b220d1ef4

Change-Id: I9155c9b9233882a295a9a6e607a844d9125e4c56
2015-12-09 14:41:40 -08:00
Tao Bao
b8df5fb90e uncrypt: Suppress the compiler warnings on LP64.
We have the following warnings when compiling uncrypt on LP64 (e.g.
aosp_angler-userdebug).

bootable/recovery/uncrypt/uncrypt.cpp:77:53: warning: format specifies type 'long long' but the argument has type 'off64_t' (aka 'long') [-Wformat]
        ALOGE("error seeking to offset %lld: %s\n", offset, strerror(errno));
                                       ~~~~         ^~~~~~
                                       %ld
bootable/recovery/uncrypt/uncrypt.cpp:84:54: warning: format specifies type 'long long' but the argument has type 'unsigned long' [-Wformat]
            ALOGE("error writing offset %lld: %s\n", (offset + written), strerror(errno));
                                        ~~~~         ^~~~~~~~~~~~~~~~~~
                                        %lu
bootable/recovery/uncrypt/uncrypt.cpp:246:16: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'off_t' (aka 'long') [-Wsign-compare]
    while (pos < sb.st_size) {
           ~~~ ^ ~~~~~~~~~~

According to POSIX spec [1], we have:
  off_t and blksize_t shall be signed integer types;
  size_t shall be an unsigned integer type;
  blksize_t and size_t are no greater than the width of type long.

And on Android, we always have a 64-bit st_size from stat(2)
(//bionic/libc/include/sys/stat.h).

Fix the type and add necessary casts to suppress the warnings.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html

Change-Id: I5d64d5b7919c541441176c364752de047f9ecb20
2015-12-09 10:45:39 -08:00
Tao Bao
ddde4676b6 Merge changes If00669a7,Ia5504ed2
* changes:
  update_verifier: Log to logd instead of kernel log.
  Add update_verifier for A/B OTA update.
2015-12-08 19:25:26 +00:00
Tao Bao
740e01e2bd update_verifier: Log to logd instead of kernel log.
logd already gets started before we call update_verifier.

Bug: 26039641
Change-Id: If00669a77bf9a6e5534e33f4e50b42eabba2667a
(cherry picked from commit 45eac58ef1)
2015-12-08 11:24:35 -08:00
Tao Bao
7197ee0e39 Add update_verifier for A/B OTA update.
update_verifier checks the integrity of the updated system and vendor
partitions on the first boot post an A/B OTA update. It marks the
current slot as having booted successfully if it passes the verification.

This CL doesn't perform any actual verification work which will be
addressed in follow-up CLs.

Bug: 26039641
Change-Id: Ia5504ed25b799b48b5886c2fc68073a360127f42
(cherry picked from commit 1171d3a12b)
2015-12-08 11:24:11 -08:00
Tao Bao
d0acbb56ed Merge "updater: Replace strtok() with android::base::Split()." 2015-12-08 19:18:29 +00:00
Tao Bao
baad2d454d updater: Replace strtok() with android::base::Split().
Change-Id: I36346fa199a3261da1ae1bc310b3557fe1716d96
2015-12-06 16:56:27 -08:00
Elliott Hughes
06ca938ce2 Merge "Track rename from base/ to android-base/." 2015-12-04 23:33:59 +00:00
Elliott Hughes
4b166f0e69 Track rename from base/ to android-base/.
Change-Id: I354a8c424d340a9abe21fd716a4ee0d3b177d86f
2015-12-04 15:30:20 -08:00
Tao Bao
fc23a50cef Merge "Remove the building rules for applypatch_static." 2015-12-02 22:54:52 +00:00
Tao Bao
f2448d0cd5 Remove the building rules for applypatch_static.
The CL in [1] has stopped building and packaging the obsolete
applypatch_static tool.

[1]: commit a04fca31bf1fadcdf982090c942ccbe4d9b95c71

Bug: 24621915
Change-Id: I5e98951ad7ea5c2a7b351af732fd6722763f59bd
2015-12-02 14:05:38 -08:00
Elliott Hughes
ee5c87eea7 Merge "Track name change from adb_main to adb_server_main." 2015-11-20 21:06:51 +00:00
Elliott Hughes
9f4fdb3def Track name change from adb_main to adb_server_main.
Change-Id: I835805348a9817c81639ad8471e3b49cae93c107
2015-11-20 13:03:24 -08:00
Elliott Hughes
5c6912148b Merge "We can use fclose directly in std::unique_ptr." 2015-11-13 16:27:55 +00:00
Elliott Hughes
63b089e3aa We can use fclose directly in std::unique_ptr.
It turns out the standard explicitly states that if the pointer is
null, the deleter function won't be called. So it doesn't matter that
fclose(3) doesn't accept null.

Change-Id: I10e6e0d62209ec03ac60e673edd46f32ba279a04
2015-11-12 21:07:55 -08:00
Tao Bao
e4a3da9f51 Merge "uncrypt: remove O_SYNC to avoid time-out failures" 2015-11-05 18:02:05 +00:00
Jaegeuk Kim
cc4e3c6002 uncrypt: remove O_SYNC to avoid time-out failures
This patch removes costly O_SYNC flag for encrypted block device.
After writing whole decrypted blocks, fsync should guarantee their consistency
from further power failures.
This patch reduces the elapsed time significantly consumed by upgrading packages
on an encrypted partition, so that it could avoid another time-out failures too.

Change-Id: I1fb9022c83ecc00bad09d107fc87a6a09babb0ec
Signed-off-by: Jaegeuk Kim <jaegeuk@motorola.com>
2015-11-04 11:43:58 -08:00
Tao Bao
4ea2b0c4ac Merge "recovery: Depend on mkfs.f2fs only if needed."
am: a412198699

* commit 'a4121986990d7dde7918252a96d87e4c3c11c13c':
  recovery: Depend on mkfs.f2fs only if needed.
2015-10-28 16:36:23 +00:00
Tao Bao
a412198699 Merge "recovery: Depend on mkfs.f2fs only if needed." 2015-10-28 16:32:50 +00:00
Tao Bao
f68351209f recovery: Depend on mkfs.f2fs only if needed.
Don't build mkfs.f2fs unless device defines TARGET_USERIMAGES_USE_F2FS.

Change-Id: Ifac592c30315bbe7590c8fbf3a0844e6a7a31a1a
2015-10-27 22:00:35 -07:00
Tao Bao
cc9dd3d524 Merge "updater: Bump up the BBOTA version to 4."
am: f204185f71

* commit 'f204185f7138687769f95c28fe22fa88143bc004':
  updater: Bump up the BBOTA version to 4.
2015-10-23 18:45:30 +00:00
Tao Bao
f204185f71 Merge "updater: Bump up the BBOTA version to 4." 2015-10-23 18:37:33 +00:00
Tao Bao
1fdec8685a updater: Bump up the BBOTA version to 4.
To accommodate new changes in N release, such as error correction [1]
and other potential changes to the updater.

[1]: commit 0a7b47397d

Change-Id: I4dd44417d07dd0a31729894628635a0aa1659008
2015-10-22 17:04:28 -07:00
Sami Tolvanen
339ec2ef02 am 78615fa5: Merge "Error correction: Use libfec in blockimg.cpp for recovery"
* commit '78615fa50bb10318035d31bccdf502913e1041b7':
  Error correction: Use libfec in blockimg.cpp for recovery
2015-10-19 10:06:42 -07:00
Sami Tolvanen
78615fa50b Merge "Error correction: Use libfec in blockimg.cpp for recovery" 2015-10-19 17:03:04 +00:00
Sami Tolvanen
0a7b47397d Error correction: Use libfec in blockimg.cpp for recovery
Add block_image_recover function to rewrite corrupted blocks on the
partition. This can be attempted if block_image_verify fails.

Note that we cannot use libfec during block_image_update as it may
overwrite blocks required for error correction. A separate recovery
pass in case the image is corrupted is the only viable option.

Bug: 21893453
Change-Id: I6ff25648fff68d5f50b41a601c95c509d1cc5bce
2015-10-19 10:04:38 +01:00
Tao Bao
4c6c96a595 am 245b2da1: am 754ebaa9: Merge "updater: Skip empty lines in the transfer list file."
* commit '245b2da1711db8a9b8e333395d68235df5163483':
  updater: Skip empty lines in the transfer list file.
2015-09-30 23:59:57 +00:00
Tao Bao
245b2da171 am 754ebaa9: Merge "updater: Skip empty lines in the transfer list file."
* commit '754ebaa90a3e11012e2456013e69b34a30272c4a':
  updater: Skip empty lines in the transfer list file.
2015-09-30 23:44:35 +00:00
Tao Bao
754ebaa90a Merge "updater: Skip empty lines in the transfer list file." 2015-09-30 23:29:11 +00:00
Yabin Cui
6eb2668de1 am aa59a989: am 4b66a280: Merge "minadbd: use strdup() to create argument for sideload thread."
* commit 'aa59a9898824c39cad3f1a1dde5fc4c8ceeabb40':
  minadbd: use strdup() to create argument for sideload thread.
2015-09-30 20:16:54 +00:00
Yabin Cui
aa59a98988 am 4b66a280: Merge "minadbd: use strdup() to create argument for sideload thread."
* commit '4b66a280d314ab5aeb5027fe5b0023ae1f25ecca':
  minadbd: use strdup() to create argument for sideload thread.
2015-09-30 20:10:51 +00:00
Yabin Cui
4b66a280d3 Merge "minadbd: use strdup() to create argument for sideload thread." 2015-09-30 17:43:59 +00:00