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
fastbootd looks too much like recovery, even if you're carefully reading
the menu. It's not obvious the device is in a flashing mode, and it's
too tempting to reboot or unplug the device in this state.
As a first step, this patch adds a big red "fastbootd" logo so it's less
obviously in recovery mode.
Bug: 120429730
Test: manual test
Change-Id: I73359f1fdfdc0b1694993f760fe7f35c5713b24e
This moves actually marking the slot as successful to a later point
so that on devices with checkpointing enabled we can still roll back to
the previous version if we fail to boot to the point that the checkpoint
is marked as successful.
Test: When taking an update on a checkpoint enabled device, it
defers marking the slot as successful instead of directly
marking it. Visible in logs.
Bug: 123260515
Change-Id: I7ed3595c1b0904ddbfe20d1cad4f69ecbf1ea351
The intended string constructor is supposed be
basic_string(size_type count, CharT ch). But the parameter is
accidentally reversed when calling the constructor in install_test.
Test: A failed unit test pass
Change-Id: Id9765bfa7d2368ff0d7fbeea45c9c8357864e060
Also add libfstab dependencies where needed. Previously the
`typedef struct FstabEntry Volume;` line served to both define a
`struct FstabEntry` as well as alias Volume to it. With the new
namespace for android::fs_mgr::FstabEntry, `struct FstabEntry` isn't
compatible anymore, so we need to alias Volume to the real
android::fs_mgr::FstabEntry.
In doing so, we need to include <fstab/fstab.h> and this requires
libfstab as a library, which a few modules did not have before.
Test: treehugger
Change-Id: I655209a0efb304b3e0568db0748bd5cf7cecbdb7
This reverts commit 9ce1d14ef6.
Reason for revert: AOSP is fixed with new vendor image
Change-Id: Ie5a9748acdae22a2b9862cb2ecedda7031f77264
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
This will remove spurious error messages in logcat such as:
08-02 00:27:21.580 600 600 E /system/bin/recovery-persist: Failed to
unlink /data/misc/recovery/last_install: No such file or directory
since the install file doesn't exist in the first place.
Bug: None
Test: m
Change-Id: Ifaa95729c50efae4e641286dfbe1718aceb5f50a
Because set_sched_policy is moved into libprocessgroup an additional
dependency is requred for recovery_component_test to build.
Exempt-From-Owner-Approval: janitorial
Bug: 111307099
Test: builds, boots
Merged-In: I7cf75e473ee1e2837940606c71d15be26db0c3f2
Change-Id: I7cf75e473ee1e2837940606c71d15be26db0c3f2
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Switch to 64 bit integers since the size of the entire src/tgt images may
not fit in size_t of ILP32.
There are other theoretical overflow cases in memory allocation and I/O
functions. However, they reside within a single transfer command and are
less likely to happen. I will evaluate and address them in separate
cls.
Test: unit tests pass
Bug: 122461124
Change-Id: Ib719ee695920877458fcfaa25c6ac058a5bbabf2