Commit Graph

7212 Commits

Author SHA1 Message Date
Tianjie Xu c3a273b33a Merge "Move load & restore logs to logging.cpp"
am: 3aff98aee8

Change-Id: I7da098091879ca823be31bd12b60dc12d5c45145
2019-04-16 11:07:47 -07:00
Tianjie Xu 3aff98aee8 Merge "Move load & restore logs to logging.cpp" 2019-04-16 17:57:02 +00:00
Tao Bao 510daac2cc Merge "Remove the FD parameter from FuseDataProvider ctor."
am: bb0c6e1fe7

Change-Id: I56b4751370b621bb78be64e77c78d44b367c9990
2019-04-16 10:51:23 -07:00
Treehugger Robot bb0c6e1fe7 Merge "Remove the FD parameter from FuseDataProvider ctor." 2019-04-16 17:25:08 +00:00
xunchang 2239b9e4dd Move load & restore logs to logging.cpp
We perform these steps to perserve the recovery logs when wiping
/cache partition. Move them to logging.cpp to keep the actually
EraseVolume function concise.

Bug: 130166585
Test: unit tests pass, mount cache and check last log after cache
Change-Id: Idc52833817a446f3a0148a3dd2112f911c9ef48d
2019-04-15 23:18:13 -07:00
Tao Bao 2be9737cf4 Remove the FD parameter from FuseDataProvider ctor.
This leaves the FD implementation details to subclasses. In particular,
it allows minadbd to do additional works with the FD after sideloading.

Bug: 128415917
Test: atest recovery_component_test
Test: atest minadbd_test
Test: Sideload package on taimen.
Change-Id: I106bbaad05201227bbc5fe28890bbbb06fdcb67e
2019-04-15 16:53:31 -07:00
Tianjie Xu 2148d317cd Merge "Move wipe cache|data to libinstall"
am: 9fc764f1f0

Change-Id: I6d3fc5b0fa75a25a96d8939e0f9c3b04de1f5245
2019-04-15 15:57:17 -07:00
Tianjie Xu 9fc764f1f0 Merge "Move wipe cache|data to libinstall" 2019-04-15 22:34:19 +00:00
xunchang 316e971746 Move wipe cache|data to libinstall
Therefore, libinstall becomes the sole owner to handle the request
from minadbd service.

The change also includes
1. move logging.cpp out of librecovery
2. drop the dependency on common.h
3. now it's more sensible to move the wipe_cache as part of
install_package. move the wipe_cache to the end of the function.

Bug: 130166585
Test: wipe data and cache from menu
Change-Id: I6f356dccdb38015c50acf756bac246f87c30fc1f
2019-04-15 12:22:11 -07:00
Bill Yi 440d03ede2 [automerger skipped] Merge "Import translations. DO NOT MERGE"
am: 0b172415fd -s ours
am skip reason: subject contains skip directive

Change-Id: If5cfd25a964ca17fe36abe979de0f1ea6fe21d92
2019-04-13 04:56:33 -07:00
Treehugger Robot 0b172415fd Merge "Import translations. DO NOT MERGE" 2019-04-13 11:43:41 +00:00
Bill Yi 29077dc25a Import translations. DO NOT MERGE
Change-Id: Ic746bf49180622c3de6029067a811b91007ed507
Auto-generated-cl: translation import
2019-04-13 01:52:59 -07:00
Tianjie Xu f9709883f1 Merge "Add socket communication between recovery and minadbd"
am: 6c5f70b9b2

Change-Id: Iad5a591943b860bd4234b43c0b1f0a9609173993
2019-04-11 16:57:53 -07:00
Tianjie Xu 6c5f70b9b2 Merge "Add socket communication between recovery and minadbd" 2019-04-11 23:42:25 +00:00
xunchang 34690ced91 Add socket communication between recovery and minadbd
This cl adds a socket pair to support the communication between recovery
and minadbd. Therefore, minadbd will be able to issue multiple commands
to recovery and get back the status of each command.

This cl also switches the adb sideload from the recovery menu to use
this protocol; and moves minadbd to a separate binary.

Bug: 130166585
Test: sideload a package
Change-Id: I80d36d5c4e6fe1ae3ea23640907bc50c0dc0d482
2019-04-11 14:23:53 -07:00
Tao Bao a8cc70fbe1 Merge "Build libinstall as a static library."
am: 38d5e60874

Change-Id: Iafa5f28ec978dc1276a5b2bfdbb433e77e216dac
2019-04-08 15:05:28 -07:00
Tao Bao 38d5e60874 Merge "Build libinstall as a static library." 2019-04-08 21:22:15 +00:00
Tao Bao 0deed3389b Build libinstall as a static library.
It was once considered to be shared between recovery and minadbd, so
that the latter can start an install on its own. The plan has been
changed, since package install -- including device wipe operations --
could be device-specific, which should be done by recovery only.

This CL moves libinstall back to a static library, which also saves the
overall size (reducing from 140256 + 660576 to 555880 bytes on
aosp_taimen-userdebug).

Bug: 130166585
Test: Run recovery_component_test.
Test: `adb sideload` on taimen.
Change-Id: Ib1f5f79f235df4682c0bd104425c9c122f6091ba
2019-04-08 11:59:48 -07:00
Tao Bao 416343e73a Merge "libotautil exports libfstab header."
am: 8e0821e690

Change-Id: I652370bda1e5523379c20612e20de1f16cc1201a
2019-04-03 17:06:38 -07:00
Tao Bao 8e0821e690 Merge "libotautil exports libfstab header." 2019-04-03 23:48:21 +00:00
Tao Bao cecad743c1 libotautil exports libfstab header.
otautil/roots.h includes <fstab/fstab.h>, but users of otautil/roots.h
don't need to explicitly depend on libfstab unless they have a real
need.

Also remove the unneeded include of <fstab/fstab.h> from
fsck_unshare_blocks.cpp.

Test: mmma -j bootable/recovery
Change-Id: Id3dc995a4769e631ab242843ee439bd94b2bf0bc
2019-04-03 11:41:54 -07:00
David Anderson 9a53189ae5 Merge "Append -verity when looking for verity device-mapper names."
am: bc2eab4315

Change-Id: I39b5e0f2f0baf8d459a535de470c99f8a5d4adf9
2019-04-02 14:04:49 -07:00
David Anderson bc2eab4315 Merge "Append -verity when looking for verity device-mapper names." 2019-04-02 20:16:36 +00:00
David Anderson c52663c4ea Append -verity when looking for verity device-mapper names.
Bug: 123666267
Test: recovery_component_test passes
Change-Id: I9b608b3fbfa14cc45ad0b4de6cb5cecdef983acb
2019-04-01 17:13:11 -07:00
Tao Bao effd4ca883 Merge changes Ibbe7084e,If584fc8a
am: bb8f0fff17

Change-Id: I1df188d9a668dffc2f81000c30ae1d6fd2f4bb1c
2019-03-30 08:33:15 -07:00
Tao Bao bb8f0fff17 Merge changes Ibbe7084e,If584fc8a
* changes:
  recovery: Remove SetUsbConfig() out of common.h.
  Remove ui_print().
2019-03-30 15:18:18 +00:00
Tao Bao e0cfab3de9 recovery: Remove SetUsbConfig() out of common.h.
libinstall now has its own copy.

Test: mmma -j bootable/recovery
Change-Id: Ibbe7084e15baeb7e744f2175d5944477092acc9e
2019-03-29 15:54:02 -07:00
Tao Bao bc982a4f88 Remove ui_print().
This used to be a helper function that allows printing message to UI.
We no longer have any active user in bootable/recovery. Device-specific
code can achieve the same functionality by calling GetUI()->Print()
instead.

Test: mmma -j bootable/recovery
Change-Id: If584fc8a51d1af466f1d94d8ea5faa262603a784
2019-03-29 15:50:02 -07:00
Tianjie Xu 3f25d6bb07 Merge "Move install to separate module"
am: a232d9dccb

Change-Id: I6de83aec6ab98ae5280bad07e3359c4bb38abd5e
2019-03-29 14:43:56 -07:00
Tianjie Xu a232d9dccb Merge "Move install to separate module" 2019-03-29 21:23:49 +00:00
xunchang 2478885f3c Move install to separate module
Build libinstall as a shared library. Also drop the dependency on the
global variables in common.h.

Test: unit tests pass, sideload an OTA
Change-Id: I30a20047768ce00689fc0e7851c1c5d712a365a0
2019-03-29 10:27:51 -07:00
Bill Peckham 111663d893 Merge "Use flags = 0 to avoid fd closing for child updater process"
am: 50bda24f1e

Change-Id: I0ddb3f3cb29d63922f0c3972e5800f03bd5a85ac
2019-03-29 06:49:40 -07:00
Bill Peckham 50bda24f1e Merge "Use flags = 0 to avoid fd closing for child updater process" 2019-03-29 13:41:40 +00:00
Bernie Innocenti 7367caad0f Merge "Fix bogus error checking on unique_fd"
am: a0fe1227b8

Change-Id: I90f7429cf22cd2a400054a9b3eed4fc4d79436a6
2019-03-28 21:08:33 -07:00
Treehugger Robot a0fe1227b8 Merge "Fix bogus error checking on unique_fd" 2019-03-29 03:52:46 +00:00
Bill Peckham 08ba1ad9b1 Use flags = 0 to avoid fd closing for child updater process
If we use the default parameter we'll get O_CLOEXEC, which will close the fd
that we pass to the child process, which will cause it to fail. Passing zero
avoids the problem.

Bug: 122813742
Test: Verify that non-A/B OTA update is successful.
Change-Id: Ia61bc7260f17d9209715583e6ded69e1196ed3f6
2019-03-28 18:42:13 -07:00
Tao Bao 9e23616e2e Merge "Remove the extern declaration of sehandle from roots.cpp."
am: 047582b506

Change-Id: I19b4158f57b6fb6e562872b2c2cf9d5de4fef820
2019-03-28 09:14:50 -07:00
Treehugger Robot 047582b506 Merge "Remove the extern declaration of sehandle from roots.cpp." 2019-03-28 15:49:44 +00:00
Bernie Innocenti 8bd6f455d2 Fix bogus error checking on unique_fd
The expression "!fd" calls the implicit conversion to int, but comparing
the raw fd against 0 does not work, since open() and other POSIX calls
returning a file descriptor use -1 to signal an error.

Test: m recovery
Change-Id: I0847c276f39cb9dd09c7ffb96951276113418fc8
2019-03-28 17:28:13 +09:00
Tao Bao fd7d835fd9 Remove the extern declaration of sehandle from roots.cpp.
It has become obsolete since we replaced the call to make_ext4 with
e2fsprogs (commit ded2dac082, which landed
into P).

Test: mmma -j bootable/recovery
Change-Id: I09141322874213dcb0f1280bba239376e71a4d17
2019-03-27 23:29:38 -07:00
Tianjie Xu 3de9ee62b8 Merge "Allow RSA 4096 key in package verification"
am: 3168ddf79d

Change-Id: Ie22fb0caddbf3185d5ee52ae883fc933c35e8cc4
2019-03-27 11:21:01 -07:00
Tianjie Xu 3168ddf79d Merge "Allow RSA 4096 key in package verification" 2019-03-27 17:57:38 +00:00
Tianjie Xu 67a3ffc22f Merge "Move out the code to parse block map in MemMap"
am: f1cbd2f7f2

Change-Id: I630bae5c6be83a4e3f300542b45a10c4b31967a6
2019-03-26 16:09:33 -07:00
Tianjie Xu f1cbd2f7f2 Merge "Move out the code to parse block map in MemMap" 2019-03-26 21:52:40 +00:00
xunchang 908ad77af8 Allow RSA 4096 key in package verification
The RSA_verify sitll works for 4096 bits keys. And we just
need to loose the check on modulus.

Sample commands to generate the key & package:
1. openssl genrsa -out keypair.pem 4096
2. openssl pkcs8 -topk8 -inform PEM -outform DER -nocrypt \
   -in keypair.pem -out private.pk8
3. openssl req -new -x509 -key keypair.pem -out public.x509.pem \
   -days 365
4. java -Djava.library.path=prebuilts/sdk/tools/linux/lib64 -jar \
   prebuilts/sdk/tools/lib/signapk.jar -w public.x509.pem private.pk8 \
   unsigned.zip signed.zip

Bug: 129163830
Test: unit tests pass
Change-Id: I5a5ff539c9ff1955c02ec2ce4b17563cb92808a4
2019-03-26 12:28:23 -07:00
xunchang 625c588c0f Move out the code to parse block map in MemMap
We will reuse them to implement the fuse provider from block maps.

Test: unit tests pass, sideload an OTA
Change-Id: Iaa409d19569c4ccc0bb24e12518044fcddb45c69
2019-03-26 11:47:27 -07:00
Tianjie Xu 45898d8bb4 Merge "Move librecovery_ui to a sub-directory"
am: 6287253eb4

Change-Id: Ib055c175eab1857713d5d5bed63fd91ed43e881b
2019-03-22 08:15:37 -07:00
Tianjie Xu 6287253eb4 Merge "Move librecovery_ui to a sub-directory" 2019-03-22 15:05:00 +00:00
Tianjie Xu 8f397309b4 Move librecovery_ui to a sub-directory
This helps to expose librecovery_ui for device specific RecoveryUi.

Bug: 76436783
Test: mma, unit tests pass
Change-Id: Ic6c3d301d5833e4a592e6ea9d9d059bc4e4919be
(cherry picked from commit b5108c372c)
2019-03-21 10:46:11 -07:00
Tianjie Xu 3c21700fcd Merge "Move apply_from_sdcard to fuse_sdcard_install"
am: 3c61cd02cf

Change-Id: Idd0f65f979145b572e30bd9b8b38d477f2b7e185
2019-03-20 11:07:00 -07:00