1. 27 Sep, 2016 1 commit
    • Tao Bao's avatar
      DO NOT MERGE Duplicate the last_install content into last_log. · a8c0d0b4
      Tao Bao authored
      Currently we save the OTA metrics in last_install, which keeps the data
      for the _last_ install only. This CL logs the same content into last_log
      so that we keep the metrics for every install.
      
      Bug: 31607469
      Test: Apply an update (via OTA and sideload) and check last_log and last_install.
      
      Change-Id: Id8f174d79534fddc9f06d72a4e69b2b1d8ab186c
      (cherry picked from commit f4885adc)
      a8c0d0b4
  2. 17 Aug, 2016 1 commit
    • Tianjie Xu's avatar
      "view recovery logs" will show /tmp/recovery.log · 62ab2a0f
      Tianjie Xu authored
      For A/B devices, "view recovery logs" doesn't work due to the lack
      of cache partition. To help debugging, we'll show /tmp/recovery.log
      instead if /cache is not found.
      
      Change-Id: Idb77c3a4c30388148a210b38d732a7b27e757bba
      Test: Tested on an A/B device and /tmp/recovery.log showed up.
      Bug: 30905700
      (cherry picked from commit a54f75ed)
      62ab2a0f
  3. 12 Jul, 2016 1 commit
    • Tianjie Xu's avatar
      Skip update-on-boot for bootreason in blacklist · 27b9fc8a
      Tianjie Xu authored
      Skip the OTA installation when bootreason is 'kernel_panic',
      'Panic' etc.
      
      Change-Id: Ic1202492bffefa1a9d8d0e691b5af979285e552c
      Test: On angler, ota installation skips for one bootreason in the blacklist.
      Bug: 29978689
      27b9fc8a
  4. 30 Jun, 2016 1 commit
    • Yabin Cui's avatar
      Create bootloader_message static library. · 2f272c05
      Yabin Cui authored
      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
      2f272c05
  5. 24 Jun, 2016 1 commit
    • Tianjie Xu's avatar
      Increase EIO retry count · c37c5c34
      Tianjie Xu authored
      Increase the number of attempts of an OTA update from 3 to 5 in case
      an I/O error happened. This should increase the success rate of the
      update.
      
      Bug: 29619468
      Change-Id: I88a067d9debd55a07be22ed981f395f6e47ec28f
      c37c5c34
  6. 21 Jun, 2016 1 commit
    • Yabin Cui's avatar
      Verify wipe package when wiping A/B device in recovery. · 6faf0265
      Yabin Cui authored
      To increase the security of wiping A/B devices, let uncrypt write
      wipe package in misc partition. Then recovery verifies the wipe
      package before wiping the device.
      
      Bug: 29159185
      
      Change-Id: I186691bab1928d3dc036bc5542abd64a81bc2168
      6faf0265
  7. 10 Jun, 2016 1 commit
  8. 03 Jun, 2016 1 commit
    • Tao Bao's avatar
      recovery: Add support to brick a device. · b0838186
      Tao Bao authored
      When recovery starts with --brick, it tries to brick the device by
      securely wiping all the partitions as listed in /etc/recovery.brick.
      
      This is designed to support bricking lost devices.
      
      Bug: 27253717
      Change-Id: Ib0bd4f0a3bdaca4febc91fce6b682e3ec74354e2
      (cherry picked from commit 862a4c11)
      b0838186
  9. 20 May, 2016 1 commit
    • Tianjie Xu's avatar
      Allow recovery to return error codes · 16255838
      Tianjie Xu authored
      Write error code, cause code, and retry count into last_install. So we
      can have more information about the reason of a failed OTA.
      
      Example of new last_install:
      @/cache/recovery/block.map     package name
      0                              install result
      retry: 1                       retry count (new)
      error: 30                      error code (new)
      cause: 12                      error cause (new)
      
      Details in:
      go/android-ota-errorcode
      
      Bug: 28471955
      Change-Id: I00e7153c821e7355c1be81a86c7f228108f3dc37
      16255838
  10. 29 Apr, 2016 2 commits
    • Tao Bao's avatar
      recovery: Always log the update attempt. · 56870018
      Tao Bao authored
      An OTA may be skipped due to low battery. But we should always log it to
      understand why an update _fails_ to apply.
      
      Bug: 27893175
      Change-Id: I50a3fbbb3e51035e0ac5f1cca150e283852825c3
      56870018
    • Tianjie Xu's avatar
      Add ability to show "installing security update" · 35926c4b
      Tianjie Xu authored
      Add a new command "--security" to boot commands. If this command is
      observed as part of BCB, choose a different background text picture
      for installing stage in recovery UI. As a result, users will see
      "installing security update" instead of "installing system update"
      when applying a security update package.
      
      Bug: 27837319
      Change-Id: I2e2253a124993ecc24804fa1ee0b918ac96837c5
      35926c4b
  11. 15 Apr, 2016 1 commit
    • Elliott Hughes's avatar
      Update the system update animation. · 498cda6e
      Elliott Hughes authored
      Switch to a Wear-like intro/loop system. We don't have an intro yet,
      but hopefully this will let Wear delete more code when they move to N.
      Unlike them, we don't hard-code the number of frames: we just look to
      see what we have available. We do hard-code the fps though.
      
      Also add a graphics test mode so you can see a demo of the UI components
      without having to actually apply an OTA.
      
      Also fix a bug where default locale is null rather than en-US: it's
      more useful to show _some_ text if we don't have a locale (which should
      only be during development anyway).
      
      Bug: http://b/26548285
      Change-Id: I63422e3fef3c41109f924d96fb5ded0b3ae7815d
      498cda6e
  12. 31 Mar, 2016 1 commit
    • Mark Salyzyn's avatar
      recovery: use __android_log_pmsg_file_write for log files · 13aca598
      Mark Salyzyn authored
      (cherry-pick from commit a4f701af)
      
      - 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
      13aca598
  13. 10 Mar, 2016 1 commit
    • Tianjie Xu's avatar
      Reboot and retry on I/O errors · fa12b973
      Tianjie Xu authored
      When I/O error happens, reboot and retry installation two times
      before we abort this OTA update.
      
      Bug: 25633753
      Change-Id: Iba6d4203a343a725aa625a41d237606980d62f69
      (cherry picked from commit 3c62b67f)
      fa12b973
  14. 04 Mar, 2016 1 commit
    • Tao Bao's avatar
      recovery: Handle devices without /cache partition. · ae6408d1
      Tao Bao authored
      Since we may not have /cache partition on A/B devices, let recovery
      handle /cache related operations gracefully if /cache doesn't exist.
      
      (1) Disable the wipe for /cache partition.
      
      (2) Skip wiping /cache while wiping /data (i.e. factory reset).
      
      (3) Disable logging-related features, until we figure out better
      ways / places to store recovery logs (mainly for factory resets on A/B
      devices).
      
      Bug: 27176738
      Change-Id: I7b14e53ce18960fe801ddfc15380dac6ceef1198
      (cherry picked from commit 26112e58)
      ae6408d1
  15. 25 Feb, 2016 1 commit
  16. 23 Feb, 2016 1 commit
  17. 14 Jan, 2016 1 commit
    • Tao Bao's avatar
      recovery: Fork a process for fuse when sideloading from SD card. · cdcf28f5
      Tao Bao authored
      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
      cdcf28f5
  18. 04 Dec, 2015 1 commit
  19. 20 Nov, 2015 1 commit
  20. 16 Nov, 2015 2 commits
    • Tao Bao's avatar
      recovery: Allow "Mount /system" for system_root_image. · 8f903899
      Tao Bao authored
      When system images contain the root directory, there is no entry of
      "/system" in the fstab. Change it to look for "/" instead if
      ro.build.system_root_image is true. We actually mount the partition
      to /system_root instead, and create a symlink to /system_root/system
      for /system. This allows "adb shell" to work properly.
      
      Bug: 22855115
      Change-Id: I91864444950dc3229fda3cc133ddbadeb8817fb8
      (cherry picked from commit abb8f778)
      8f903899
    • Tao Bao's avatar
      recovery: Switch to clang · 7101b2e2
      Tao Bao authored
      And a few trival fixes to suppress warnings.
      
      Change-Id: Id28e3581aaca4bda59826afa80c0c1cdfb0442fc
      (cherry picked from commit 80e46e08)
      7101b2e2
  21. 13 Nov, 2015 1 commit
  22. 17 Sep, 2015 1 commit
    • Tao Bao's avatar
      recovery: Add timestamps in update logs. · 04ca4263
      Tao Bao authored
      Fork a logger process and send over the log lines through a pipe.
      Prepend a timestamp to each line for debugging purpose. Timestamps are
      relative to the start of the logger.
      
      Example lines with the change in this CL:
      
      [  445.948393] Verifying update package...
      [  446.279139] I:comment is 1738 bytes; signature 1720 bytes from end
      [  449.463652] I:whole-file signature verified against RSA key 0
      [  449.463704] I:verify_file returned 0
      
      Change-Id: I139d02ed8f2e944c1618c91d5cc43282efd50b99
      04ca4263
  23. 10 Sep, 2015 1 commit
    • Tao Bao's avatar
      recovery: Remove redirect_stdio() when calling ShowFile(). · 9a7fd80d
      Tao Bao authored
      When calling ScreenRecoveryUI::ShowFile(), the only thing that gets
      inadequately logged is the progress bar. Replace the call to
      ScreenRecoveryUI::Print() with ScreenRecoveryUI::PrintOnScreenOnly() for
      the progress bar, so we can avoid calling redirect_stdio().
      
      Change-Id: I4d7c5d5b39bebe0d5880a99d7a72cee4f0b8f325
      9a7fd80d
  24. 07 Aug, 2015 1 commit
  25. 05 Aug, 2015 1 commit
  26. 31 Jul, 2015 1 commit
    • Tao Bao's avatar
      recovery: Allow "Mount /system" for system_root_image. · abb8f778
      Tao Bao authored
      When system images contain the root directory, there is no entry of
      "/system" in the fstab. Change it to look for "/" instead if
      ro.build.system_root_image is true. We actually mount the partition
      to /system_root instead, and create a symlink to /system_root/system
      for /system. This allows "adb shell" to work properly.
      
      Bug: 22855115
      Change-Id: Ibac493a5a9320c98ee3b60bd2cc635b925f5454a
      abb8f778
  27. 10 Jun, 2015 3 commits
  28. 03 Jun, 2015 1 commit
    • Tao Bao's avatar
      recovery: Switch to clang · 80e46e08
      Tao Bao authored
      And a few trival fixes to suppress warnings.
      
      Change-Id: I38734b5f4434643e85feab25f4807b46a45d8d65
      80e46e08
  29. 27 May, 2015 1 commit
  30. 07 May, 2015 2 commits
  31. 05 May, 2015 2 commits
    • Tao Bao's avatar
      Keep multiple kernel logs · 93cec9a0
      Tao Bao authored
      Currently we are keeping one copy of the kernel log (LAST_KMSG_FILE).
      This CL changes to keep up to KEEP_LOG_COUNT copies for kernel logs.
      
      Bug: http://b/18092237
      Change-Id: Ied862b5b70cbbae7775f59c78c32ec62aeeca655
      (cherry picked from commit bef39710)
      93cec9a0
    • Tao Bao's avatar
      Keep multiple kernel logs · bef39710
      Tao Bao authored
      Currently we are keeping one copy of the kernel log (LAST_KMSG_FILE).
      This CL changes to keep up to KEEP_LOG_COUNT copies for kernel logs.
      
      Bug: http://b/18092237
      Change-Id: I1bf5e230de3efd6a48a5b2ae5a34241cb4d9ca90
      bef39710
  32. 04 May, 2015 2 commits
  33. 13 Apr, 2015 1 commit
    • Elliott Hughes's avatar
      Move the menu header out of the menu. · 8fd86d77
      Elliott Hughes authored
      This makes it easier for us to deal with arbitrary information at the
      top, and means that headers added by specific commands don't overwrite
      the default ones.
      
      Add the fingerprint back, but broken up so it fits even on sprout's
      display.
      
      Change-Id: Id71da79ab1aa455a611d72756a3100a97ceb4c1c
      8fd86d77