summaryrefslogtreecommitdiffstats
path: root/bootloader_message/bootloader_message.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge AOSP android-9.0.0_r3Ethan Yonker2018-08-241-16/+17
|\ | | | | | | | | | | Fix conflicts and make it build in 5.1, 6.0, 7.1, 8.1, and 9.0 Change-Id: Ida0a64c29ff27d339b7f42a18d820930964ac6e4
| * Switch to bionic gtest in bootable/recoveryTianjie Xu2017-11-031-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We encountered segfaults in Imgdiff host tests due to the failure to reset states of getopt. The problem can be solved by switching to use bionic's gtest where a new process is forked for each test. Also modify the recovery_component_test to make sure it runs in parallel. Changes include: 1. Merge the writes to misc partition into one single test. 2. Change the hard coded location "/cache/saved.file" into a configurable variable. Bug: 67849209 Test: recovery tests pass Change-Id: I165d313f32b83393fb7922c5078636ac40b50bc2
* | Merge up to android-8.1.0_r1 and fix conflictsEthan Yonker2017-12-151-0/+7
|\| | | | | | | Change-Id: I2dc060134d15ec9f015a606cb24ef8276f6af1fc
| * Boot control HAL based on the A/B headers.Alex Deymo2017-04-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The added bootctrl.bcb module implement the legacy interface for the bootctrl HAL based on the Boot Control Block (BCB) and the headers already specified in the booloader_message library. This serves as a reference implementation of the boot_control HAL. Bug: 32707546 Test: Tested internally that a device can use this HAL to flip slots and recovery from a /misc wipe. Change-Id: Ic02e5aaf4de7d0a1780eac4e8705dae20d0b3e10
* | Update to AOSP 8.0 baseEthan Yonker2017-09-081-184/+95
|\| | | | | | | Change-Id: I29fe722b4eb9718765327902779046840a01433e
| * Revert "libbootloader_message: use different fstab paths for normal/recovery boot"Bowgo Tsai2017-03-271-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 37bd44174bf2511320961f3f8cd1f698a1c72b66. The logic here is better to be moved into fs_mgr, not fs_mgr clients. Bug: 35811655 Bug: 36502022 Change-Id: Iae79bd8f7131516ad223f3323f1bc1d805206d51 Test: normal boot sailfish, go to Settings > System & tap on "Factory Data reset" Test: recovery boot sailfish
| * libbootloader_message: use different fstab paths for normal/recovery bootBowgo Tsai2017-03-251-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libbootloader_message is used by both normal boot and recovery boot. It needs to use different fstab paths, respectively. Otherwise, factory reset will fail when we move /fstab.{ro.hardware} to /vendor/etc/. Recovery boot: fs_mgr_read_fstab_with_dt("/etc/recovery.fstab") Normal boot: fs_mgr_read_fstab_default() Bug: 35811655 Bug: 36502022 Test: normal boot sailfish, go to Settings > System & tap on "Factory Data reset" Test: recovery boot sailfish Change-Id: I253f5bdfb9be8a01f80856eb1194f85cdf992bbd
| * recovery: replacing fs_mgr_read_fstab() with new fs_mgr APIsBowgo Tsai2017-03-101-18/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fstab settings of early-mounted partitions (e.g., /vendor) will be in kernel device tree. Switch to the new API to get the whole settings with those in device tree: fs_mgr_read_fstab_with_dt("/etc/recovery.fstab") The original default /fstab.{ro.hardware} might be moved to /vendor/etc/. or /odm/etc/. Use another new API to get the default fstab instead of using the hard-coded /fstab.{ro.hardware}. This API also includes the settings from device tree: fs_mgr_read_fstab_default() Bug: 35811655 Test: boot sailfish recovery Change-Id: Iaa56ac7f7b4c4dfc7180c65f03e9a37b94f1de09
| * Add update_bootloader_message() to fix two-step OTAs.Tao Bao2016-12-151-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a retry of commit 7e31f421a514da09b90e46dbd642a5e9b16e0003. Commit bd56f1590c967205dc45eb2ec298aa8d2aacb740 switches to calling write_bootloader_message(<options>) in get_args(), which unintentionally resets the stage field thus breaks two-step OTAs. This CL adds update_bootloader_message(<options>), which only sets the command field (to "boot-recovery") and the recovery field (with the specified options). Bug: 33534933 Test: Apply a two-step package. Test: recovery_component_test passes. Change-Id: Ie0b1ed4053d2d3c97d9cb84310d616b28fcfc72e
| * Revert "write_bootloader_message(<options>) should not reset stage field."Tao Bao2016-12-131-7/+1
| | | | | | | | | | | | | | This reverts commit 7e31f421a514da09b90e46dbd642a5e9b16e0003. Bug: 33534933 Change-Id: Ib173f6b1e36a79deafc3592785195693a6779471
| * write_bootloader_message(<options>) should not reset stage field.Tao Bao2016-12-061-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit bd56f1590c967205dc45eb2ec298aa8d2aacb740 switches to calling write_bootloader_message(<options>) in get_args(), which unintentionally resets the stage field thus breaks two-step OTAs. This CL changes write_bootloader_message(<options>) to only set the command field (to "boot-recovery") and the recovery field (with the specified options). Test: Apply a two-step package. Change-Id: I6905918812c7d3402cc1524688079066a4d22d29
| * updater: Refactor set_stage() and get_stage() functions.Tao Bao2016-11-181-23/+45
| | | | | | | | | | | | | | | | | | | | | | Add read_bootloader_message_from() and write_bootloader_message_to() to allow specifying the BCB device (/misc). Also add testcases for set_stage() and get_stage(). Test: recovery_component_test passes. Test: Build a recovery image and apply a two-step OTA package. Change-Id: If5ab06a1aaaea168d2a9e5dd63c07c0a3190e4ae
| * Add 'reboot bootloader' to bootloader_message.Vineela Tummalapalli2016-11-101-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | Add 'reboot bootloader' capability to the bootloader_message. BUG: https://issuetracker.google.com/issues/32474515 Change-Id: I01e8b2fad978bf7c8fc96ff6b08ad3e52533f504 Author: Vineela Tummalapalli <vineela.tummalapalli@intel.com> Signed-off-by: Vineela Tummalapalli <vineela.tummalapalli@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com> Reviewed-on: https://android.intel.com/548519
| * Fix bootloader_message.Yabin Cui2016-10-191-1/+1
| | | | | | | | | | | | Bug: 29945717 Change-Id: I934fd6c52b0111937fa75455de2fa4157fb30f6f (cherry picked from commit 9da04d595fe01e4c0ac1baf39186ac090bf234b3)
| * Create bootloader_message static library.Yabin Cui2016-10-181-0/+179
| | | | | | | | | | | bootloader_messages merges bootloader_message_writer and bootloader.cpp, so we can use the same library to manage bootloader_message in normal boot and recovery mode. Bug: 29582118 Change-Id: I9efdf776ef8f02b53911ff43a518e035e0c29618 (cherry picked from commit 2f272c0551f984e83bc5abaf240e0dddb38a3326)
* Fix bldr msg file open mode when offset specifiedMatt Mower2017-02-161-4/+1
| | | | | | | | | | | | It was pointed out to me by gmrt that O_APPEND is incorrect, as lseek before writing would be undone (perhaps we avoided this issue due to an inability to write beyond the end of a partition) and O_RDWR is not necessary to lseek. When AOSP switched from fopen to open, they also removed the full partition wipe (fopen in wb mode) before each write, so this is no longer an issue. Completely restore the original AOSP file access mode flags. Change-Id: I42b4efc5f499360ce5b761d3a2a5d4dac4cdfb65
* Allow custom bootloader msg offset in block miscMatt Mower2017-02-021-1/+4
| | | | | | | | | | | | | | Globally define BOARD_RECOVERY_BLDRMSG_OFFSET with a decimal integer to offset the read/write location in misc where the bootloader message should appear. Example: BOARD_GLOBAL_CFLAGS := -DBOARD_RECOVERY_BLDRMSG_OFFSET=2048 Edify commands get_stage and set_stage need to be aware of the custom bootloader msg offset because they write the stage directly to the BCB. Change-Id: Ifdb5ffe3e893a651be59ae63e3a0ebadd828c9f2
* bldrmsg: Only emmc /misc is supportedMatt Mower2017-01-181-1/+1
| | | | Change-Id: Ic0716557a87ec0638e2dbed1c3f743231e8b2f8e
* bootloader_message: Allow TWRP to ignore wipe-data command into miscnailyk-fr2017-01-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | * Rebase of https://gerrit.omnirom.org/#/c/20750/ patch-set 3 * Original commit message: fix: recently a change in AOSP causes a bootloop to TWRP (and therefore all ROM's based on it) Reason: AOSP enables use of /misc partition and normally the fstab in TWRP will not have /misc added. The problem is now when Android writes a wipe command to /misc it will force TWRP to boot but TWRP will do nothing - leaving the cmd in /misc. This results in a bootloop to TWRP. Solution: I added a new var TW_IGNORE_MISC_WIPE_DATA which can be set to "true" in Boardconfig.mk of a device requiring this which then ignores /misc commands like it would be when /misc would be just not in fstab BUT with this change TWRP clears the bit in /misc so a normal boot can happen. Besides that if the device do not have an own recovery key combo and /misc is enabled we want to open TWRP after walking through the factory reset screen - without actually doing a factory reset. kudos to nailyk (and DevUt) for the help with the C++ code! Change-Id: If6fed5872015f1a66304e3edbdb787c507236f69
* Update to android-7.1Ethan Yonker2016-11-301-11/+162
|
* Fix bootloader_message.Yabin Cui2016-07-061-1/+1
| | | | | Bug: 29945717 Change-Id: I934fd6c52b0111937fa75455de2fa4157fb30f6f
* Create bootloader_message static library.Yabin Cui2016-06-301-0/+181
bootloader_messages merges bootloader_message_writer and bootloader.cpp, so we can use the same library to manage bootloader_message in normal boot and recovery mode. Bug: 29582118 Change-Id: I9efdf776ef8f02b53911ff43a518e035e0c29618