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
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
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
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
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
We will reuse them to implement the fuse provider from block maps.
Test: unit tests pass, sideload an OTA
Change-Id: Iaa409d19569c4ccc0bb24e12518044fcddb45c69
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)
Move the sdcard installation function and all helper functions to a
separate file, and drop the dependency on common.h.
In the future, we want to move these functions into the install class.
Bug: 127071893
Test: unit tests pass
Change-Id: I0b7f7cbf0b68918e638e13878ca28bfca367088a
It's no longer needed with the newly added FuseDataProvider class. Also
cleans up the parameters for run_fuse_sideload.
Bug: 127071893
Test: unit tests pass, run a sideload
Change-Id: I1ccd6798d187cfc6ac9f559ffb3f3edf08dad55c
The fuse data provider for adb/sdcard shares common code and structures.
This cl creates a FuseDataProvider base class and provides
implementations for adb and sdcard.
In the follow cls, we can kill the provider_vtab struct; and also add
another implementation to parse a block map file and provides data.
Test: unit tests pass, sideload a package, apply a package from sdcard
Change-Id: If8311666a52a2e3c0fbae0ee9688fa6d01e4ad09
android::vintf::VintfObjectRecovery::CheckCompatibility() may try to
mount partitions in order to read the needed files, which may not be
feasible when resuming an interrupted update. This CL changes the logic
to enforce compatibility check on fresh install only.
Fix: 122864541
Test: Sideloading on taimen keeps working.
Test: Sideload a package by setting the retry bit. Check that
compatibility check is skipped.
Change-Id: I018a0c802c85a0e84a6f2aac50630a677d64382a
This is another implementation of the Package class. And we will later
need it when reading the package from FUSE.
Bug: 127071893
Test: unit tests pass, sideload a file package on sailfish
Change-Id: I3de5d5ef60b29c8b73517d6de3498459d7d95975
<stdint.h> for uint8_t; <stdlib.h> for free(3); <thread> for
std::thread.
Test: mmma -j bootable/recovery
Test: Run unit tests on crosshatch.
Change-Id: Id99b29b3d514f4e453983599c8b1aa6b0fab4ef8
We have already switched to the protobuf format for new builds, and
the downgrade packages will require a data wipe. So it should be safe
to drop the support for text format.
This also helps to save the issue when users sideload a package with a
pending OTA, because the new CareMap contains the fingerprint of the
intended build.
Bug: 128536706
Test: unit tests pass, run update_verifier with legacy CareMap
Change-Id: I1c4d0e54ec591f16cc0a65dac76767725ff9e7c4
The wipe package used to open the zip file directly from the content
string. Switch to use the interface from the new package class instead.
Bug: 127071893
Test: unit tests pass
Change-Id: I990e7f00c5148710722d17140bab2e343eea3b6b
The input_cb in ev_init() should be shared among the detected input
devices.
Test: Boot into recovery. Check key inputs.
Change-Id: I0315f6a23625bacedd333fefacbf4ac6797bc1fd
Creates a new class handle the package in memory and package read from fd.
Define the new interface functions, and make approximate changes to the
verify and install functions.
Bug: 127071893
Test: unit tests pass, sideload a package
Change-Id: I66ab00654df92471184536fd147b237a86e9c5b5
This gives us finer control over the partitions to wipe on the host
side.
Bug: 127492427
Test: unit tests pass, install a wipe package on sailfish
Change-Id: I612f8bac743a310f28e365b490ef388b278cfccb
Found these FDs unintentionally propagated into forked processes (e.g.
updater) during my local debugging. Use O_CLOEXEC to avoid that.
Test: Dump open FDs in updater process.
Test: Sideload a package on taimen (which uses framebuffer).
Test: Run graphics test on taimen.
Change-Id: I1fb65dd4a103c47d28b15973def9e9359c251ca3
Also clean up the comments regarding updater/recovery protocol.
Test: Sideload a package on taimen. Check that /tmp/recovery.log
contains the log from update_engine_sideload.
Test: Factory reset on taimen. Check that log file has the info from
mke2fs.
Change-Id: If560269ce7007769fc85a63bd228813bdd75bebd