summaryrefslogtreecommitdiffstats
path: root/recovery-persist.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-06-08Fix logical bugs around access() POSIX callArtem Yudin1-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
2020-01-17Retire the Tron metrics reporting for non-A/B updateTianjie Xu1-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
2019-10-02otautil: Factor out the utils that're private to recovery.Tao Bao1-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
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-01-24Check that install file exists before unlinkNg Zhi An1-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
2018-09-13Move the parse of last_install to recovery-persistTianjie Xu1-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
2018-05-07recovery: Refactor logging code into logging.cppJerry Zhang1-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
2018-05-07recovery: Refactor logging code into logging.cppJerry Zhang1-1/+1
Move common logging related functions to rotate_logs.cpp, and rename that to logging.cpp. Test: Recovery works Bug: 78793464 Change-Id: I00f20a79a296680122b8437d54a87897c5cb2fc7 (cherry picked from commit 3c3f211d1e5698da6eea9e83584acb2dee4ca46e)
2018-05-07recovery: Refactor logging code into logging.cppJerry Zhang1-1/+1
Move common logging related functions to rotate_logs.cpp, and rename that to logging.cpp. Test: Recovery works Bug: 78793464 Change-Id: I00f20a79a296680122b8437d54a87897c5cb2fc7
2017-07-19Fix the android-cloexec-* warnings in bootable/recoveryTianjie Xu1-15/+15
Add the O_CLOEXEC or 'e' accordingly. Bug: 63510015 Test: recovery tests pass Change-Id: I7094bcc6af22c9687eb535116b2ca6a59178b303
2016-11-04Cleanup the duplicates of logs rotation functionsTianjie Xu1-38/+4
Bug: 32067516 Test: Logs rotated successfully on angler, recovery-refresh/persist tests passed on an a/b device. Change-Id: Ie80adf0fa958ad3d7869d2d17f49489666b86c29
2016-09-01Switch recovery to libbase loggingTianjie Xu1-8/+7
Clean up the recovery image and switch to libbase logging. Bug: 28191554 Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35 (cherry picked from commit 747781433fb01f745529c7e9dd97c5599070ad0d)
2016-09-01Switch recovery to libbase loggingTianjie Xu1-8/+7
Clean up the recovery image and switch to libbase logging. Bug: 28191554 Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35 Merged-In: Icd999c3cc832f0639f204b5c36cea8afe303ad35
2016-09-01Switch recovery to libbase loggingTianjie Xu1-8/+7
Clean up the recovery image and switch to libbase logging. Bug: 28191554 Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
2016-04-05recovery-persist: pick up both pstore console filesMark Salyzyn1-2/+7
(cherry pick from commit 5f7111ff4dc5055298d302b228f392a7a22a00a0) - 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
2016-04-05recovery-persist: pick up both pstore console filesMark Salyzyn1-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
2016-03-31recovery: use __android_log_pmsg_file_write for log filesMark Salyzyn1-0/+200
(cherry-pick from commit a4f701af93a5a739f34823cde0c493dfbc63537a) - 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
2016-03-28recovery: use __android_log_pmsg_file_write for log filesMark Salyzyn1-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