summaryrefslogtreecommitdiffstats
path: root/recovery-persist.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
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)
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