Commit Graph

228 Commits

Author SHA1 Message Date
Elliott Hughes 5f9d7749e9 Merge \\\\"Fix install.h\\\\'s use of attribute printf.\\\\" am: a82ee456bb am: 691db7ba77 am: 7c4a34195f
am: 937ca850ec

Change-Id: I4c496ee69e554f9616b5da98e3e708880060da0e
2016-06-30 18:32:29 +00:00
Elliott Hughes 691db7ba77 Merge \"Fix install.h\'s use of attribute printf.\"
am: a82ee456bb

Change-Id: Ibcfabbb0e044d503f889f1afea271cf73ad93f45
2016-06-30 18:18:40 +00:00
Elliott Hughes 83ce755518 Fix install.h's use of attribute printf.
And move off the bionic __nonnull macro, which I'm removing.

Change-Id: I40b4424f4fd7bd8076e0eee3ec35de36c3ded8de
2016-06-30 09:28:42 -07:00
Tianjie Xu 254b8d0a99 Check the results from applypatch am: 31f8cc84cf am: d0dcbddd31
am: 24488eb7db

Change-Id: I27ebbde5a6a013152b2595ff4bcd372b55afefee
2016-06-16 18:20:30 +00:00
Tianjie Xu 24488eb7db Check the results from applypatch am: 31f8cc84cf
am: d0dcbddd31

Change-Id: I00439aae8f79b0e2a5f7de6566110240492b526a
2016-06-16 18:11:47 +00:00
Tianjie Xu 93110c767f Check the results from applypatch
am: 31f8cc84cf

Change-Id: I2ea241fb3e688f5f8b0558d638dd3ed502223f97
2016-06-16 18:08:59 +00:00
Tianjie Xu 31f8cc84cf Check the results from applypatch
Check the results from applypatch in PerformCommandDiff; and abort the
update on failure.

Bug:29339536
Change-Id: I5087d79ba532b54250f4c17560524255c8a4fabc
2016-06-15 23:26:59 +00:00
Elliott Hughes 26474639b9 resolve merge conflicts of 179c0d8 to stage-aosp-master am: 274d17dc0f am: eaddde6888
am: b36980cc09

Change-Id: I1ebaa7e62c774f08a07360df7d8498872aaf4e9d
2016-06-15 22:50:01 +00:00
Elliott Hughes 274d17dc0f resolve merge conflicts of 179c0d8 to stage-aosp-master
Change-Id: Iba5aec266444cabf83f600f2bdb45a3c027e5995
2016-06-15 15:22:17 -07:00
Elliott Hughes 179c0d80bc Merge "Remove obsolete MTD support." 2016-06-15 21:55:15 +00:00
Tao Bao 2a069a9dfd Merge \\\\"updater: Fix the broken ReadFileFn.\\\\" am: 4ddd5edf31 am: 89dfe730d4 am: 1e67422f37
am: d241c85cd0

Change-Id: Id5d0de845b101668ff30d19cc257d78e0575e58d
2016-06-11 19:00:54 +00:00
Tao Bao 1e67422f37 Merge \\"updater: Fix the broken ReadFileFn.\\" am: 4ddd5edf31
am: 89dfe730d4

Change-Id: Ia465c92d341da4681d3490151a20e1e117271e52
2016-06-11 18:53:14 +00:00
Tao Bao efacd80364 updater: Fix the broken ReadFileFn.
Was accidentally broken by the CL in [1].

[1]: commit d6c93afcc2

Change-Id: I851e13ccea6f5be6fcd47f712cc95867245f9934
2016-06-11 03:59:56 -07:00
Elliott Hughes 63a319201f Remove obsolete MTD support.
Bug: http://b/29250988
Change-Id: Ia97ba9082a165c37f74d6e1c3f71a367adc59945
2016-06-10 13:45:35 -07:00
Tianjie Xu cf5c1bc87d resolve merge conflicts of 57ad046 to nyc-mr1-dev-plus-aosp
am: 894176632c

* commit '894176632c7295875d01cfdc273b706996c483a4':
  Call ioctl before each write on retry

Change-Id: I814e7c9409d94aed8733a9e1fc562394f8da1e76
2016-06-03 23:07:58 +00:00
Tianjie Xu 894176632c resolve merge conflicts of 57ad046 to nyc-mr1-dev-plus-aosp
Change-Id: I98502950a0882050f5ed1acb0549b218b2cd06e4
2016-06-03 16:01:28 -07:00
Tianjie Xu 64f46fb16c resolve merge conflicts of 7ce287d to nyc-dev-plus-aosp
Change-Id: I2194d1170281f58eb508f2ef63b39c8729125f76
2016-06-03 15:44:52 -07:00
Tianjie Xu 7ce287d432 Call ioctl before each write on retry
If the update is a retry, ioctl(BLKDISCARD) the destination blocks before
writing to these blocks.

Bug: 28990135
Change-Id: I1e703808e68ebb1292cd66afd76be8fd6946ee59
2016-06-03 12:12:50 -07:00
Tianjie Xu 3f6eb86390 resolve merge conflicts of 50f6417
Fix a typo for ota_fclose().

Change-Id: Ia93e911aa5391afc604874fc3a09c5a45c094c80
2016-05-23 14:58:53 -07:00
Tianjie Xu 8a43084979 resolve merge conflicts of 3aabd77 to nyc-mr1-dev-plus-aosp
am: 549745cc87

* commit '549745cc8778f806e46809e472fbcf3c7f066b83':
  Allow recovery to return error codes

Change-Id: I474bc0afb4e92ffafec9de60e1665e3aa3c2cf10
2016-05-23 21:28:44 +00:00
Tianjie Xu 549745cc87 resolve merge conflicts of 3aabd77 to nyc-mr1-dev-plus-aosp
Change-Id: I834aba65cb29102055ff9e70969973a7870d0e60
2016-05-23 12:30:42 -07:00
Tianjie Xu 84478e8823 resolve merge conflicts of 50f6417 to nyc-dev-plus-aosp
Change-Id: I42c127f7946e678acf6596f6352f090abc0ca019
2016-05-23 12:24:28 -07:00
Tianjie Xu 162558382b Allow recovery to return error codes
Write error code, cause code, and retry count into last_install. So we
can have more information about the reason of a failed OTA.

Example of new last_install:
@/cache/recovery/block.map     package name
0                              install result
retry: 1                       retry count (new)
error: 30                      error code (new)
cause: 12                      error cause (new)

Details in:
go/android-ota-errorcode

Bug: 28471955
Change-Id: I00e7153c821e7355c1be81a86c7f228108f3dc37
2016-05-20 13:56:53 -07:00
Tianjie Xu 0f85209b2e Add time and I/O info to last_install am: dd874b1c87 am: 027b403e8a
am: fb5d7f6172

* commit 'fb5d7f6172f88a9e26ef554ef56717798f83522d':
  Add time and I/O info to last_install

Change-Id: I3e80f862aff97a2fbbd2324cbbc5d16aede196f3
2016-05-18 18:54:59 +00:00
Tianjie Xu fb5d7f6172 Add time and I/O info to last_install am: dd874b1c87
am: 027b403e8a

* commit '027b403e8aa90ddc533e39e623df09fc319bb6ee':
  Add time and I/O info to last_install

Change-Id: I04c368dd551946427f683df906eb42e0f2f740e9
2016-05-18 18:47:31 +00:00
Tianjie Xu 142b864ba1 Add time and I/O info to last_install
am: dd874b1c87

* commit 'dd874b1c87eb04f28db0db2629df0adde568a74c':
  Add time and I/O info to last_install

Change-Id: I02aa858d5ce488d3acbf5400811e2565cf7d9c75
2016-05-18 18:44:31 +00:00
Tianjie Xu dd874b1c87 Add time and I/O info to last_install
One example of last_install is:

/sideload/package.zip
1
time_total: 101
bytes_written_system: 14574000
bytes_stashed_system: 100
bytes_written_vendor: 5107400
bytes_stashed_vendor: 0

Bug: 28658632
Change-Id: I4bf79ea71a609068d38fbce6b41bcb892524aa7a
2016-05-16 14:54:37 -07:00
Tao Bao d654c35ab2 Merge "updater, minzip: Remove unnecessary O_SYNC flags." am: c7d7eb2225 am: d03ee52eb7 am: eef053fda1
am: aec86d3692

* commit 'aec86d3692a9271db027e4478178c02451c558cc':
  updater, minzip: Remove unnecessary O_SYNC flags.

Change-Id: I21018c49066f9bb69d21f358f1b684da5bd53add
2016-05-08 18:12:51 +00:00
Alistair Strachan 733285fea2 updater, minzip: Remove unnecessary O_SYNC flags.
Remove O_SYNC from mzExtractRecursive() and PackageExtractFileFn().
These functions deal with extracting whole files from the update
package onto a filesystem. If run on ext4 on a rotating disk, for
example, the O_SYNC flag will cause serious performance problems
and the extraction proecss can take over 30 minutes, with no
obvious benefits.

This API function already calls fsync(fd) after each file is
extracted to ensure data and metadata is written to the underlying
block device, so the O_SYNC calls should be superfluous and safely
removable.

This change does not affect the OTA patch paths or any modification
of the bootloader partition or writes to other 'emmc' partitions.

Signed-off-by: Alistair Strachan <alistair.strachan@imgtec.com>
Change-Id: I9cbb98a98e6278bf5c0d7efaae340773d1fbfcd2
2016-05-05 16:04:58 -07:00
Chih-hung Hsieh f81339203a Merge "Fix google-explicit-constructor warnings." am: fafa6a6531 am: 77d7cb1d0a am: 8d3b85a320
am: ac7d8f278b

* commit 'ac7d8f278b65142ddd84bc15331e3daef5946059':
  Fix google-explicit-constructor warnings.

Change-Id: I333dd160ccee076431e5accc51d91646c5ead1ac
2016-04-29 22:38:20 +00:00
Chih-hung Hsieh fafa6a6531 Merge "Fix google-explicit-constructor warnings." 2016-04-29 22:26:41 +00:00
Chih-Hung Hsieh 49c5c79df1 Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I5b35ae16c069e7e9229e66963386f322bd808af1
2016-04-29 14:16:35 -07:00
Tao Bao d9237d27ea Merge "updater: Don\'t zero out CommandParameters with memset(3)." am: df59cee am: 4458d3e am: 6bfe76e
am: 187e7c7

* commit '187e7c7ab027af90409371fd08386e6d1c2eac3b':
  updater: Don't zero out CommandParameters with memset(3).

Change-Id: I0e894b103a5c1a43a24177707fc1190764c1ea45
2016-04-28 04:45:05 +00:00
Tao Bao 730646199b updater: Don't zero out CommandParameters with memset(3).
[1] switched a few things to android::base::unique_fd including
CommandParameters.fd. However, we were using memset(3) to zero out the
struct, which effectively assigned unique_fd(0) to fd. When it called
fd.reset(), file descriptor 0 was unintentionally closed. When FD 0 was
later reassigned via open(2), it led to lseek(2) errors: "Bad file
descriptor".

This CL switches to using braced-init (i.e. '= {}') instead, so that the
default constructor unique_fd(-1) would be called.

[1]: commit bcabd09293

Bug: 28391985
Change-Id: If1f99932b15552714c399e65c8b80550344b758a
2016-04-26 17:36:13 -07:00
Chih-hung Hsieh 7140a083c7 Merge "Fix google-runtime-int warnings." am: a1f4a1e am: bcad1d1 am: 0231e70
am: ed4c0c4

* commit 'ed4c0c4ca04943a79d2dc7ac2c095ed6ca20f749':
  Fix google-runtime-int warnings.

Change-Id: Ifbed57a32b75f1baf9d31126087a2d3eb2983d8b
2016-04-18 22:39:41 +00:00
Chih-Hung Hsieh 54a2747ef3 Fix google-runtime-int warnings.
Bug: 28220065
Change-Id: Ida199c66692a1638be6990d583d2ed42583fb592
2016-04-18 12:29:30 -07:00
Mattias Nissler ecd32c786c resolve merge conflicts of 2bf95ac to nyc-dev-plus-aosp
am: 6e2a8b1

* commit '6e2a8b11ecb0bdfd6f4a2f096519075663a2d1c2':
  Convert recovery to use BoringSSL instead of mincrypt.

Change-Id: Ief6b279d1e7fd00af4e8153ac29212343493b293
2016-04-13 01:49:17 +00:00
Mattias Nissler 452df6d99c Convert recovery to use BoringSSL instead of mincrypt.
This changes the verification code in bootable/recovery to use
BoringSSL instead of mincrypt.

Change-Id: I37b37d84b22e81c32ac180cd1240c02150ddf3a7
2016-04-06 15:54:17 +02:00
Elliott Hughes 844007b722 Merge "Move selinux dependencies out of header files." am: 8124750 am: dc91161
am: 5c23b80

* commit '5c23b801e5f29ca85dde4a58fde4a69faacd7c6c':
  Move selinux dependencies out of header files.

Change-Id: I191e0337501fc5520da1fa726911ffabd5d156c9
2016-04-02 16:12:29 +00:00
Elliott Hughes 4bbd5bf8a6 Move selinux dependencies out of header files.
Bug: http://b/27764900
Change-Id: Ib62a59edcb13054f40f514c404d32b87b14ed5f1
2016-04-01 18:24:39 -07:00
Elliott Hughes 54937d0b59 resolve merge conflicts of 5cf4701 to nyc-dev-plus-aosp
am: 20ab2db

* commit '20ab2db8f1e04f4f9b4c1dc0e9377f0586bfc10a':
  Switch to <android-base/unique_fd.h>.

Change-Id: I3ad1eae327ad83c82aa684e4a2846d4313fd4486
2016-03-29 18:29:55 +00:00
Elliott Hughes bcabd09293 Switch to <android-base/unique_fd.h>.
Change-Id: I13ba3f40bd52b5f3e3fe9002a45a9a8630040129
2016-03-29 08:18:34 -07:00
Tianjie Xu 7eca97e75d Skip stashing source blocks in verify mode
Currently block_image_verify() stashes source blocks to /cache and
in some case triggers I/O errors. To avoid this risk, We create
a map from the hash value to the source blocks' range_set. When
executing stash command in verify mode, source range is saved but block
contents aren't stashed. And load_stash could get its value from
either the stashed file from the previous update, or the contents on
the source partition specified by the saved range.

Bug: 27584487
Bug: 25633753
Change-Id: I775baf4bee55762b6e7b204f8294afc597afd996
(cherry picked from commit 0188935d55)
2016-03-25 14:56:21 -07:00
Tianjie Xu 8085b38c18 Merge "Skip stashing source blocks in verify mode" into nyc-dev am: adca297
am: 7781778

* commit '77817789e04337011d4a659114795d745c98bf7a':
  Skip stashing source blocks in verify mode
2016-03-24 00:40:01 +00:00
Tianjie Xu 77817789e0 Merge "Skip stashing source blocks in verify mode" into nyc-dev
am: adca297

* commit 'adca29794376e4936824b60aeaa53b285962ee05':
  Skip stashing source blocks in verify mode
2016-03-24 00:37:55 +00:00
Tianjie Xu 0188935d55 Skip stashing source blocks in verify mode
Currently block_image_verify() stashes source blocks to /cache and
in some case triggers I/O errors. To avoid this risk, We create
a map from the hash value to the source blocks' range_set. When
executing stash command in verify mode, source range is saved but block
contents aren't stashed. And load_stash could get its value from
either the stashed file from the previous update, or the contents on
the source partition specified by the saved range.

Bug: 27584487
Bug: 25633753
Change-Id: I775baf4bee55762b6e7b204f8294afc597afd996
2016-03-23 15:19:18 -07:00
Jed Estep 9d8a68099f Control fault injection with config files instead of build flags am: ff6df89
am: 6f78768

* commit '6f7876816b2322169432658235ebf7882ced0564':
  Control fault injection with config files instead of build flags
2016-03-21 21:40:15 +00:00
Jed Estep 6f7876816b Control fault injection with config files instead of build flags
am: ff6df89

* commit 'ff6df890a2a01bf3bf56d3f430b17a5ef69055cf':
  Control fault injection with config files instead of build flags
2016-03-21 21:37:33 +00:00
Jed Estep ff6df890a2 Control fault injection with config files instead of build flags
Bug: 27724259
Change-Id: I65bdefed10b3fb85fcb9e1147eaf0687d7d438f4
2016-03-18 17:58:25 -07:00
Tao Bao 156de0473e resolve merge conflicts of ce58688 to nyc-dev-plus-aosp
am: 6f44637

* commit '6f446373fdda9e084e7cce86c4694f365e75951b':
  Revert "DO NOT MERGE Control fault injection with config files instead of build flags"
2016-03-17 22:57:55 +00:00