Commit graph

6 commits

Author SHA1 Message Date
Tom Marshall
cff2229a28 recovery: Provide caching for sideload files
Create a cache of block data received via adb.  The cache size is set
to ensure that there is at least 400mb available for the installer.

When the cache is large enough to hold the entire file, each block is
read via adb at most once.

When the cache is not large enough to hold the entire file, the cache
will need to be pruned.  Because files tend to be read sequentially
during install, the pruning algorithm attempts to discard blocks that
are behind the current file position.

Change-Id: Id8fc7fa5b38f1d80461eb576b1a1b5d53453cfc1
2024-09-08 01:05:13 +02:00
luoqiangwei1
95b85a4dcb Fix the fuse error that cannot handle the OTA package larger than 4 GiB
1. That read data will be blocked when adb sideload OTA package
2. An error(Out of bound read) occurs when installing OTA package by fuse

Test: as follows
    - adb sideload OTA package
    - install OTA package by install_with_fuse parameter

Change-Id: Ie53510d157f6ea4c92606b289fcb745d441918c8
Signed-off-by: luoqiangwei1 <luoqiangwei1@xiaomi.com>
2021-10-12 13:10:43 +08: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
xunchang
5e6832a24d Remove the provider_vtab
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
2019-03-19 13:03:59 -07:00
xunchang
ea2912f187 Create a FuseDataProvider base class
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
2019-03-19 11:11:58 -07:00
Tao Bao
4b51c3ab40 Export fuse_sideload.h for libfusesideload.
Move the module into a separate directory so that we can export only the
expected header.

With this change, minadbd no longer needs to include bootable/recovery.

Test: mmma -j bootable/recovery
Change-Id: I69b888ceb160a33a67d79c5bda208dc17ad6ed86
2018-03-07 10:01:51 -08:00
Renamed from fuse_sideload.cpp (Browse further)