summaryrefslogtreecommitdiffstats
path: root/recovery-persist.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix logical bugs around access() POSIX callArtem Yudin2022-06-081-10/+14
| | | | | | | | | | | | According to docs of access(): If the specified access is permitted, access() returns 0. If the given file cannot be accessed in the specified way, access() returns -1 See my comment: https://android-review.googlesource.com/c/platform/bootable/recovery/+/883392/comments/e9b76d97_f4cab88d Test: builds Bug: 234887937 Change-Id: I5712d61e967566246603f23a62e2c7b708130b0d
* Retire the Tron metrics reporting for non-A/B updateTianjie Xu2020-01-171-18/+0
| | | | | | | | | | | | This is part of the effort to remove libmetricslogger in platform. Remove the reporting since the status from non-A/B update is less important to us. Plus the gmscore already has a copy of the logic to parse the contents from last_install and report non-A/B metrics to the clearcut log. bug: 147776349 Test: build Change-Id: I4fc5d58fb616edb3eb1edadf4614d3eca15c7ce1
* otautil: Factor out the utils that're private to recovery.Tao Bao2019-10-021-2/+2
| | | | | | | | | | | A number of utility functions are intended for serving recovery's own use. Exposing them via libotautil (which is a static lib) would pass the dependencies onto libotautil's users (e.g. recovery image, updater, host simulator, device-specific recovery UI/updater extensions etc). This CL finds a new home for the utils that are private to recovery. Test: mmma bootable/recovery Change-Id: I575e97ad099b85fe1c1c8c7c9458a5a43d4e11e1
* Move wipe cache|data to libinstallxunchang2019-04-151-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
* Check that install file exists before unlinkNg Zhi An2019-01-241-2/+2
| | | | | | | | | | | | | 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
* Move the parse of last_install to recovery-persistTianjie Xu2018-09-131-13/+43
| | | | | | | | | | | | | | | The recovery-persist used to look for the related recovery logs in persist storage, and copy them under /data/misc/recovery during the normal boot process. As we also want to find out the sideload information from last_install, it makes more sense to move the parse & report of non-a/b metrics to recovery-persist. Thus we can avoid the race condition of the file system between the native code and RecoverySystem. Bug: 114278989 Test: unit test pass, check the event buffer for metrics report Change-Id: I32d7b2b831bc74a61a70af9a2f0b8a7e9b3e36ee
* recovery: Refactor logging code into logging.cppJerry Zhang2018-05-071-1/+1
| | | | | | | | | | Move common logging related functions to rotate_logs.cpp, and rename that to logging.cpp. Test: Recovery works Bug: 78793464 Merged-In: I00f20a79a296680122b8437d54a87897c5cb2fc7 Change-Id: I00f20a79a296680122b8437d54a87897c5cb2fc7
* Fix the android-cloexec-* warnings in bootable/recoveryTianjie Xu2017-07-191-15/+15
| | | | | | | | Add the O_CLOEXEC or 'e' accordingly. Bug: 63510015 Test: recovery tests pass Change-Id: I7094bcc6af22c9687eb535116b2ca6a59178b303
* Cleanup the duplicates of logs rotation functionsTianjie Xu2016-11-041-38/+4
| | | | | | | | Bug: 32067516 Test: Logs rotated successfully on angler, recovery-refresh/persist tests passed on an a/b device. Change-Id: Ie80adf0fa958ad3d7869d2d17f49489666b86c29
* Switch recovery to libbase loggingTianjie Xu2016-09-011-8/+7
| | | | | | | | Clean up the recovery image and switch to libbase logging. Bug: 28191554 Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35 Merged-In: Icd999c3cc832f0639f204b5c36cea8afe303ad35
* recovery-persist: pick up both pstore console filesMark Salyzyn2016-04-051-2/+7
| | | | | | | | | | | | | - Volantis console-ramoops-0 (upstream correct) - Angler console-ramoops - Bullhead console-ramoops - Shamu console-ramoops NB: Shamu also has kernel crashes in other pstore files, not merging them in. Bug: 27176738 Change-Id: Ib6eef3e25475935b89252f51c960719c7860511a
* recovery: use __android_log_pmsg_file_write for log filesMark Salyzyn2016-03-281-0/+200
- Add call to __android_log_pmsg_file_write for recovery logging. - Add call to refresh pmsg if we reboot back into recovery and then allow overwrite of those logs. - Add a new one-time executable recovery-refresh that refreshes pmsg in post-fs phase of init. We rely on pmsg eventually scrolling off to age the content after recovery-persist has done its job. - Add a new one-time executable recovery-persist that transfers from pmsg to /data/misc/recovery/ directory if /cache is not mounted in post-fs-data phase of init. - Build and appropriately trigger the above two as required if BOARD_CACHEIMAGE_PARTITION_SIZE is undefined. - Add some simple unit tests NB: Test failure is expected on systems that do not deliver either the recovery-persist or recovery-refresh executables, e.g. systems with /cache. Tests also require a timely reboot sequence of test to truly verify, tests provide guidance on stderr to direct. Bug: 27176738 Change-Id: I17bb95980234984f6b2087fd5941b0a3126b706b