summaryrefslogtreecommitdiffstats
path: root/updater/target_files.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-09-18Check for overflow before allocating memory fore decompression.Kelvin Zhang1-0/+7
On 32bit devices, an ZipEntry64 may have size > 2^32, we should check for such cases before attempting to allocate memory. Test: mm -j Change-Id: I0f916ef4b2a692f167719a74bd6ff2e887c6c2ce
2020-09-16Switch to zip64 in recoveryKelvin Zhang1-3/+3
There's already library support for zip64 in libziparchive. We just need to start using the new APIs. Bug: 167951876 Test: Sideload a large ota package in recovery Change-Id: I652741965f28de079d873c6822317ee9fa855201
2019-07-10Change the symlink to system_extJustin Yun1-1/+1
As system_ext partition will be linked to system/system_ext, update the path to system/system_ext. Bug: 134359158 Test: build Change-Id: I5a49adfe7e045e24bf6dfbf6990a965b8a5e1ce1
2019-06-28Rename product_services to system_extJustin Yun1-2/+2
Bug: 134359158 Test: build and boot Change-Id: I2ea21a0e528bdbab7d2479b48c73e7f2274ecca5
2019-06-28Add unit tests for simulatorTianjie Xu1-0/+5
Make sure the simulator succeeds executing common non-A/B update functions. Bug: 131911365 Test: run unit tests Change-Id: I520ce6a8827539b88a9e36f9e67eec30d8b586d4
2019-06-01Implement the TargetFile and BuildInfoTianjie Xu1-5/+261
The TargetFile class parses a target-file and provides functions to read its contents. And the BuildInfo tries to simulate the device with files on host. Some work it does includes parsing the build properties, and extracting the image files for partitions specified in the fstab. Bug: 131911365 Test: unit tests pass, run simulator with cuttlefish, wear devices and from extracted TF. Change-Id: Iefe4a96d619d2e4b3d038e31480f11a0f9a70afa
2019-05-29Implement an update simulator to verify BB OTA packages on hostTianjie Xu1-5/+8
Implement the simulator runtime and build the updater simulator as a host executable. The code to parse the target-files and mocks the block devices will be submitted in the follow-up. Bug: 131911365 Test: unit tests pass Change-Id: Ib1ba939aec8333ca68a45139514d772ad7a27ad8
2019-04-30install: Install functions return InstallResult.Tao Bao1-1/+2
Test: `atest recovery_unit_test recovery_component_test` Test: Sideload a package on taimen. Change-Id: I2d42f55a89931ee495ea5c5d9e6b5ee1058e8e52
2019-04-16DO NOT MERGE: Move wipe cache|data to libinstallxunchang1-1/+1
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 (cherry picked from commit 316e9717461890dd319dc370970069fe4532a561)
2019-04-15Move wipe cache|data to libinstallxunchang1-1/+1
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-03-29Move install to separate modulexunchang1-0/+0
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-21Move librecovery_ui to a sub-directoryTianjie Xu1-2/+2
This helps to expose librecovery_ui for device specific RecoveryUi. Bug: 76436783 Test: mma, unit tests pass Change-Id: Ic6c3d301d5833e4a592e6ea9d9d059bc4e4919be (cherry picked from commit b5108c372c8b92671ea5ebb4eeff00757fcee187)
2019-03-21Move librecovery_ui to a sub-directoryTianjie Xu1-2/+2
This helps to expose librecovery_ui for device specific RecoveryUi. Bug: 76436783 Test: mma, unit tests pass Change-Id: Ic6c3d301d5833e4a592e6ea9d9d059bc4e4919be
2019-03-20Move apply_from_sdcard to fuse_sdcard_installxunchang1-1/+4
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
2019-03-19Create a FuseDataProvider base classxunchang1-5/+2
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
2016-01-14recovery: Fork a process for fuse when sideloading from SD card.Tao Bao1-2/+1
For applying update from SD card, we used to use a thread to serve the file with fuse. Since accessing through fuse involves going from kernel to userspace to kernel, it may run into deadlock (e.g. for mmap_sem) when a page fault occurs. Switch to using a process instead. Bug: 23783099 Bug: 26313124 Change-Id: Iac0f55b1bdb078cadb520cfe1133e70fbb26eadd
2015-07-24recovery: Switch fuse_* to C++.Tao Bao1-6/+0
Change-Id: Id50c3e6febd0ab61f10a654b9b265cf21a2d1701 (cherry picked from commit 71dc365f25676cfb3f62dbb7163697a8c3c5243d)
2015-07-20recovery: Switch fuse_* to C++.Tao Bao1-6/+0
Change-Id: I68770ad1a9e99caee292f8010cfd37dfea3acc64
2015-04-10Switch minadb over to C++.Elliott Hughes1-0/+6
Change-Id: I5afaf70caa590525627c676c88b445d3162de33e
2014-07-10do sdcard sideloading through the fuse filesystemDoug Zongker1-3/+4
Make a fuse filesystem that sits on top of the selected package file on the sdcard, so we can verify that the file contents don't change while being read and avoid copying the file to /tmp (that is, RAM) before verifying and installing it. Change-Id: Ifd982aa68bfe469eda5f839042648654bf7386a1
2014-07-10refactor fuse sideloading codeDoug Zongker1-3/+3
Split the adb-specific portions (fetching a block from the adb host and closing the connections) out from the rest of the FUSE filesystem code, so that we can reuse the fuse stuff for installing off sdcards as well. Change-Id: I0ba385fd35999c5f5cad27842bc82024a264dd14
2014-07-02sideload without holding the whole package in RAMDoug Zongker1-4/+4
Implement a new method of sideloading over ADB that does not require the entire package to be held in RAM (useful for low-RAM devices and devices using block OTA where we'd rather have more RAM available for binary patching). We communicate with the host using a new adb service called "sideload-host", which makes the host act as a server, sending us different parts of the package file on request. We create a FUSE filesystem that creates a virtual file "/sideload/package.zip" that is backed by the ADB connection -- users see a normal file, but when they read from the file we're actually fetching the data from the adb host. This file is then passed to the verification and installation systems like any other. To prevent a malicious adb host implementation from serving different data to the verification and installation phases of sideloading, the FUSE filesystem verifies that the contents of the file don't change between reads -- every time we fetch a block from the host we compare its hash to the previous hash for that block (if it was read before) and cause the read to fail if it changes. One necessary change is that the minadbd started by recovery in sideload mode no longer drops its root privileges (they're needed to mount the FUSE filesystem). We rely on SELinux enforcement to restrict the set of things that can be accessed. Change-Id: Ida7dbd3b04c1d4e27a2779d88c1da0c7c81fb114
2009-06-12edify extensions for OTA package installation, part 1Doug Zongker1-7/+5
Adds the following edify functions: mount unmount format show_progress delete delete_recursive package_extract symlink set_perm set_perm_recursive This set is enough to extract and install the system part of a (full) OTA package. Adds the updater binary that extracts an edify script from the OTA package and then executes it. Minor changes to the edify core (adds a sleep() builtin for debugging, adds "." to the set of characters that can appear in an unquoted string).
2009-03-04auto import from //depot/cupcake/@135843The Android Open Source Project1-0/+24
2009-03-04auto import from //depot/cupcake/@135843The Android Open Source Project1-24/+0