Commit graph

84 commits

Author SHA1 Message Date
Tao Bao
1d510671c7 Merge "Remove LOCAL_CLANG"
am: 231c627a55

Change-Id: Idfd30503b9ebd8e3d59af7ab703911a500ad6c09
2017-07-25 21:58:22 +00:00
Lennart Wieboldt
5e5e334b3b Remove LOCAL_CLANG
clang is the default compiler since Android nougat

Change-Id: I930bba431dc49970cb4491ed5fcf44b5e00e97df
Signed-off-by: Lennart Wieboldt <lennart.1997@gmx.de>
2017-07-25 21:48:39 +02:00
Bowgo Tsai
1bd484f941 Merge "recovery: replacing fs_mgr_read_fstab() with new fs_mgr APIs" am: 7a0dfec771 am: 1a23257214
am: 1a76f4a3bc

Change-Id: I8869ddf69589c2a1bb0e8dd493df67f9126db585
2017-03-10 16:17:39 +00:00
Bowgo Tsai
d13b6cf29c recovery: replacing fs_mgr_read_fstab() with new fs_mgr APIs
The fstab settings of early-mounted partitions (e.g., /vendor) will be in
kernel device tree. Switch to the new API to get the whole settings with
those in device tree:

    fs_mgr_read_fstab_with_dt("/etc/recovery.fstab")

The original default /fstab.{ro.hardware} might be moved to
/vendor/etc/. or /odm/etc/. Use another new API to get the default fstab
instead of using the hard-coded /fstab.{ro.hardware}. This API also
includes the settings from device tree:

    fs_mgr_read_fstab_default()

Bug: 35811655
Test: boot sailfish recovery
Change-Id: Iaa56ac7f7b4c4dfc7180c65f03e9a37b94f1de09
2017-03-10 17:27:31 +08:00
Tianjie Xu
8ff296be1a Merge "Retry ioctl in uncrypt if it returns block# 0" am: ceafe69fb8 am: 06b4254a70 am: 5ec75851a7
am: 4536c470f8

Change-Id: I399f35a1bc1575f9e1fcfa5d2bb537390360505e
2017-01-07 01:28:03 +00:00
Tianjie Xu
ceafe69fb8 Merge "Retry ioctl in uncrypt if it returns block# 0" 2017-01-07 01:11:13 +00:00
Tao Bao
97b2fa2fbf Merge "Add tests for setup-bcb and clear-bcb via uncrypt." am: 4e48a6c1a1 am: af62097c08 am: b1e8150c44
am: 51ccca4b8c

Change-Id: Ifa6579a34df60e48ff53689397bb53464a5d15ee
2016-12-14 05:46:01 +00:00
Tao Bao
1033408801 Add tests for setup-bcb and clear-bcb via uncrypt.
Bug: http://b/33534933
Test: recovery_component_test passes (and fails on buggy build due to
      the CL in [1]).

[1]: commit 7e31f421a5

Change-Id: I120498048ec1db8f9fcbb3cf135c05d3a48cfcdf
2016-12-13 17:46:03 -08:00
Tianjie Xu
bc42603a8d Retry ioctl in uncrypt if it returns block# 0
In some conditions, ioctl(fd, FIBMAP, &block) returns block number 0.This
is a failure to locate the actual block number of the update package and
will result in an invalid block.map. This CL retries ioctl a few times
if it returns block number as 0.

Bug: 31632090
Test: On N9, uncrypt retries ioctl and produces the correct blockmap.
Change-Id: I913f98cf5c112915c2e803d0683db273c89053b6
2016-12-05 11:59:58 -08:00
Tianjie Xu
f2574b8206 Merge "Allow uncrypt to work without socket communication"
am: 4c1f3eda98

Change-Id: I8e86d4201d2fac0293e70df54e0816c96e85a9b7
2016-11-12 01:02:33 +00:00
Tianjie Xu
7ceff3e003 Allow uncrypt to work without socket communication
It was inconvenient to uncrypt a update package under adb shell
because the uncrypt executable required a socket to start its job.
Add a workaround to allow uncrypt executes without socket
communication.

Test: run uncrypt under adb shell, and the block map generates successfully
Bug: 29906218

Change-Id: Ibc328b31636d925dc429ede8dcec7392a721dd53
(cherry picked from commit 28c1e5d3aa)
2016-11-11 13:51:15 -08:00
Yabin Cui
fd99a318fe Verify wipe package when wiping A/B device in recovery.
To increase the security of wiping A/B devices, let uncrypt write
wipe package in misc partition. Then recovery verifies the wipe
package before wiping the device.

Based on the original cherrypick, this CL also has additional changes to
address the LOG statements and libziparchive changes.

Bug: 29159185
Test: Build and boot into recovery.

Change-Id: I186691bab1928d3dc036bc5542abd64a81bc2168
(cherry picked from commit 6faf0265c9)
2016-10-19 11:19:15 -07:00
Tao Bao
e2a706824e resolve merge conflicts of e89bf25 to stage-aosp-master am: 69c117c2ff
am: 2a576e2097

Change-Id: Iee6000f594a04a0862b3687f1d87daa809fb3804
2016-10-18 23:08:05 +00:00
Tao Bao
69c117c2ff resolve merge conflicts of e89bf25 to stage-aosp-master
Change-Id: I3b0ddb23daf264d407370cd8ace31eceb230a11a
2016-10-18 15:08:07 -07:00
Yabin Cui
8b309f6970 Create bootloader_message static library.
bootloader_messages merges bootloader_message_writer
and bootloader.cpp, so we can use the same library to
manage bootloader_message in normal boot and recovery mode.

Bug: 29582118

Change-Id: I9efdf776ef8f02b53911ff43a518e035e0c29618
(cherry picked from commit 2f272c0551)
2016-10-18 11:37:05 -07:00
Tianjie Xu
10e223c181 Turn on -Werror for recovery
am: 17e316cce0

Change-Id: Ia0e1948491edf7cca8b64d7e7f0cac91314c2025
2016-09-30 20:34:23 +00:00
Tianjie Xu
17e316cce0 Turn on -Werror for recovery
Also remove the 0xff comparison when validating the bootloader
message fields. As the fields won't be erased to 0xff after we
remove the MTD support.

Bug: 28202046
Test: The recovery folder compiles for aosp_x86-eng
Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab
(cherry picked from commit 7aa88748f6)
2016-09-30 11:18:01 -07:00
Tianjie Xu
7aa88748f6 Turn on -Werror for recovery
Also remove the 0xff comparison when validating the bootloader
message fields. As the fields won't be erased to 0xff after we
remove the MTD support.

Bug: 28202046
Test: The recovery folder compiles for aosp_x86-eng
Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab
2016-09-29 19:21:24 -07:00
Tianjie Xu
c8fbbc786c Report uncrypt errors in details
am: 68fc81e860

Change-Id: I57eff7b0aaa388c32dc8e99318e68ca25ff5c02d
2016-09-29 19:44:26 +00:00
Tianjie Xu
68fc81e860 Report uncrypt errors in details
Add the error codes for uncrypt and report the failure details in
uncrypt_status.

Test: uncrypt_error logs correctly in last_install
Bug: 31603820
Change-Id: I8e0de845ce1707b6f8f5ae84564c5e93fd5f5ef5
(cherry picked from commit 0c68675f5ae80cd669e0bf014a69689b6fe08eee)
2016-09-29 11:27:46 -07:00
Tianjie Xu
553d47bf91 Merge "Report uncrypt errors in details" am: af8b9363c6 am: 7582609d61 am: fc887a8fba
am: b0d0ee3c7d

Change-Id: Ie44169accea9196457d7cae696836c3a6fe14c8e
2016-09-27 21:27:56 +00:00
Tianjie Xu
b0d0ee3c7d Merge "Report uncrypt errors in details" am: af8b9363c6 am: 7582609d61
am: fc887a8fba

Change-Id: I5e83be10f4443c8b107821975b3506381fcbdf0c
2016-09-27 21:25:26 +00:00
Tianjie Xu
da44cf18f3 Report uncrypt errors in details
Add the error codes for uncrypt and report the failure details in
uncrypt_status.

Test: uncrypt_error logs correctly in last_install
Bug: 31603820
Change-Id: I8e0de845ce1707b6f8f5ae84564c5e93fd5f5ef5
2016-09-26 22:48:45 -07:00
Elliott Hughes
130f6c86f5 resolve merge conflicts of d5c7d6b to nyc-mr1-dev-plus-aosp
Change-Id: Ia041044547351a3e65b647bb9913aa18c7d2c97c
2016-09-26 12:53:52 -07:00
Elliott Hughes
cb22040c63 Switch to <android-base/properties.h>.
Bug: http://b/23102347
Test: boot into recovery.
Change-Id: Ib2ca560f1312961c21fbaa294bb068de19cb883e
Merged-In: Ib2ca560f1312961c21fbaa294bb068de19cb883e
2016-09-26 09:51:37 -07:00
Elliott Hughes
91e3aee9bd Switch to <android-base/properties.h>.
Bug: http://b/23102347
Test: boot into recovery.
Change-Id: Ib2ca560f1312961c21fbaa294bb068de19cb883e
2016-09-23 18:16:35 -07:00
Tianjie Xu
e8437b5340 save uncrypt status to last_install am: e16e799dfd am: 4769f209dc
am: 707583a4ab

Change-Id: I22b520ceaea408cad4e267d5a87c21ec80cd5e1d
2016-09-13 02:29:39 +00:00
Tianjie Xu
707583a4ab save uncrypt status to last_install am: e16e799dfd
am: 4769f209dc

Change-Id: Ic9056d4af518df3747743ec6b2886fa437029395
2016-09-13 01:50:40 +00:00
Tianjie Xu
e16e799dfd save uncrypt status to last_install
Save the uncrypt time cost to /cache/recovery/uncrypt_status. Recovery
reads the file and saves its contents to last_install.

Bug: 31383361
Test: Tested on angler and uncrypt_time reports correctly.

(cherry picked from commit fe16b5ccaf)

Change-Id: Id69681a35c7eb2f0eb21b48e3616dcda82ce41b8
2016-09-12 16:59:48 -07:00
Tianjie Xu
fe16b5ccaf save uncrypt status to last_install
Save the uncrypt time cost to /cache/recovery/uncrypt_status. Recovery
reads the file and saves its contents to last_install.

Bug: 31383361
Test: Tested on angler and uncrypt_time reports correctly.

Change-Id: I5cd3f7b6ca069d69086d09acfea8fc4f1215c833
Merged-In: I5cd3f7b6ca069d69086d09acfea8fc4f1215c833
2016-09-12 22:55:36 +00:00
Tianjie Xu
c21edd4654 Switch recovery to libbase logging
Clean up the recovery image and switch to libbase logging.

Bug: 28191554
Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
(cherry picked from commit 747781433f)
2016-09-01 14:32:55 -07:00
Tianjie Xu
7b0ad9c638 Switch recovery to libbase logging
Clean up the recovery image and switch to libbase logging.

Bug: 28191554
Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
Merged-In: Icd999c3cc832f0639f204b5c36cea8afe303ad35
2016-09-01 18:33:25 +00:00
Tianjie Xu
747781433f Switch recovery to libbase logging
Clean up the recovery image and switch to libbase logging.

Bug: 28191554
Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
2016-09-01 17:43:14 +00:00
Tianjie Xu
28c1e5d3aa Allow uncrypt to work without socket communication
It was inconvenient to uncrypt a update package under adb shell
because the uncrypt executable required a socket to start its job.
Add a workaround to allow uncrypt executes without socket
communication.

Test: run uncrypt under adb shell, and the block map generates successfully
Bug: 29906218

Change-Id: Ibc328b31636d925dc429ede8dcec7392a721dd53
2016-06-30 19:46:01 -07:00
Yabin Cui
9b15ba8269 resolve merge conflicts of 2f272c0 to nyc-mr1-dev-plus-aosp
Change-Id: I889d94a723415ad2e660b8c99e66935142918bc4
2016-06-30 15:13:12 -07:00
Yabin Cui
2f272c0551 Create bootloader_message static library.
bootloader_messages merges bootloader_message_writer
and bootloader.cpp, so we can use the same library to
manage bootloader_message in normal boot and recovery mode.

Bug: 29582118

Change-Id: I9efdf776ef8f02b53911ff43a518e035e0c29618
2016-06-30 11:02:38 -07:00
Yabin Cui
bf049bffe2 resolve merge conflicts of ed4c49c to nyc-mr1-dev-plus-aosp
Change-Id: I8788cc80473dc77bfa0cd2682f3acb6e17ac36df
2016-06-21 11:09:38 -07:00
Yabin Cui
6faf0265c9 Verify wipe package when wiping A/B device in recovery.
To increase the security of wiping A/B devices, let uncrypt write
wipe package in misc partition. Then recovery verifies the wipe
package before wiping the device.

Bug: 29159185

Change-Id: I186691bab1928d3dc036bc5542abd64a81bc2168
2016-06-20 18:18:02 -07:00
Chih-hung Hsieh
0231e7016d Merge "Fix google-runtime-int warnings." am: a1f4a1e
am: bcad1d1

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

Change-Id: Ifad31026502e3375f4833899056662da540319b5
2016-04-18 22:34: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
Yabin Cui
49ef1342c1 resolve merge conflicts of a58a6db to nyc-dev-plus-aosp
Change-Id: I6d95fbd33f570d60e2caf42931ef6aa9f2634239
2016-04-08 18:33:01 -07:00
Yabin Cui
a58a6dbe3d uncrypt: split libbootloader_message_writer for reuse.
init and vold also need to write bootloader message, so
split this function from uncrypt into a separate library.

Bug: 27176738
Change-Id: If9b0887b4f6ffab6162d9cb47a6ceb7eedd60b4d
2016-04-08 11:46:56 -07:00
Yabin Cui
6507265906 uncrypt: remove --read-bcb option.
Bug: 27897241
Change-Id: I4f52ada58e8f204dba8c974ea0ae03876411ecf0
(cherry picked from commit 61799baba3)
2016-03-29 18:14:44 -07:00
Yabin Cui
0c39203698 resolve merge conflicts of 61799ba to nyc-dev-plus-aosp
Change-Id: Ib1d0afe9022ec82f05be8b56201e73505160cacc
2016-03-29 16:47:18 -07:00
Yabin Cui
912e87e91d Merge "uncrypt: fix call to close()." into nyc-dev 2016-03-29 22:48:08 +00:00
Yabin Cui
ffa3a1c222 uncrypt: fix call to close().
Bug: 27897229
Change-Id: Iab5e829af1676f7fcd8a4b00a194aa679ed4e372
2016-03-29 15:35:58 -07:00
Yabin Cui
61799baba3 uncrypt: remove --read-bcb option.
Bug: 27897241
Change-Id: I4f52ada58e8f204dba8c974ea0ae03876411ecf0
2016-03-29 14:33:35 -07:00
Elliott Hughes
d6ac68665d Fix uncrypt.cpp unique_fd build breakage.
Change-Id: I4654f59463d1f3e1f4450e937cd910508b64c157
2016-03-29 12:53:36 -07:00
Elliott Hughes
20ab2db8f1 resolve merge conflicts of 5cf4701 to nyc-dev-plus-aosp
Change-Id: Ia69f8b070c05cfe201115de510e3c12e813e38b5
2016-03-29 11:15:47 -07:00
Elliott Hughes
bcabd09293 Switch to <android-base/unique_fd.h>.
Change-Id: I13ba3f40bd52b5f3e3fe9002a45a9a8630040129
2016-03-29 08:18:34 -07:00