Commit graph

3144 commits

Author SHA1 Message Date
Tao Bao
63d786cf22 updater: Remove some obsoleted functions for file-based OTA.
This CL removes the updater support for delete(), symlink(), rename(),
set_metadata() and set_metadata_recursive(). Such functions have been
removed from the generation script in commit
f388104eaacd05cfa075d6478369e1d0df5ddbf3 (platform/build).

Note: This CL also removes delete_recursive() which seems to have never
been supported in generation script.

Bug: 35853185
Test: recovery_component_test passes.
Change-Id: I51e1ec946fa73761118fa1eaa082423df6d588e9
2017-03-13 10:02:08 -07:00
Tao Bao
a7211b3c16 Merge "update_verifier: Set the success flag if dm-verity is not enabled." 2017-03-11 01:32:44 +00:00
Tao Bao
db57f0d7f4 update_verifier: Set the success flag if dm-verity is not enabled.
For devices that are not using dm-verity, update_verifier can't verify
anything, but to mark the successfully booted flag unconditionally.

Test: Successfully-booted flag is set on devices w/o dm-verity.
Test: Successfully-booted flag is set after verification on devices w/
      dm-verity.
Change-Id: I79ab2caec2d4284aad0d66dd161adabebde175b6
2017-03-10 15:16:27 -08:00
Treehugger Robot
7a0dfec771 Merge "recovery: replacing fs_mgr_read_fstab() with new fs_mgr APIs" 2017-03-10 16:06:01 +00:00
Bowgo Tsai
d13b6cf29c recovery: replacing fs_mgr_read_fstab() with new fs_mgr APIs
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
2017-03-10 17:27:31 +08:00
Tao Bao
f0e8f0727e Merge "recovery: Fix the FIXME in get_menu_selection()." 2017-03-08 19:16:19 +00:00
Tao Bao
cbb2bcf541 Merge "recovery: Move a few int to bool." 2017-03-08 01:07:13 +00:00
Tao Bao
50dd532934 recovery: Fix the FIXME in get_menu_selection().
It used to return a REBOOT action on timeout, until the CL in commit
daefc1d442 that redefined the return value
of get_menu_selection() (changing from action to a menu index).

Prior to this CL, it was returning 0 (i.e. the value of Device::REBOOT)
to trigger the reboot. This CL specifies a return value of -1 to
indicate the timeout.

Test: Boot into a user build recovery; it reboots automatically on
      timeout (120 sec).
Change-Id: I4aedb7a4628bf258017078fe73eb8b48a21d0ea8
2017-03-07 15:35:17 -08:00
Tao Bao
fc5499f22b recovery: Move a few int to bool.
Most of the changes are trivial.

Also update a dead reference to device_handle_key() in device.h comment,
and add some comments to get_menu_selection() function.

Test: `mmma bootable/recovery`
Change-Id: I59ef9213ec88ab35c0e7b8a7813ccf9c56dbd5c5
2017-03-07 15:35:12 -08:00
Tao Bao
b7f56f9b91 Merge "recovery: Add the missing #include." 2017-03-07 21:37:54 +00:00
Tao Bao
ed4a537bf0 recovery: Add the missing #include.
Although I checked there's no reference to 'stage' in device-specific
recovery codes (for commit a8d72bc3b4),
it's insufficient to capture the missing #include issue.

Test: lunch aosp_dragon-userdebug; mmma bootable/recovery
Change-Id: I4c5dbe9acf38918491c3aa776ce358be03f9ecca
2017-03-07 13:33:27 -08:00
Tao Bao
9bd1dced90 Merge "recovery: Drop the "--stages" / '-g' argument." 2017-03-07 20:28:06 +00:00
Tao Bao
1a575f8d5f Merge "recovery: Add SetStage() into 'Run graphics test'." 2017-03-07 20:02:15 +00:00
Tao Bao
73d21d1c1c Merge "recovery: Minor clean up to choose_recovery_file()." 2017-03-07 19:45:40 +00:00
Tao Bao
08fc6beef8 recovery: Minor clean up to choose_recovery_file().
Test: 'View recovery logs' on bullhead and sailfish.
Change-Id: I53272b121e3e55e6fe4c77b71e3c2e819e72cb64
2017-03-07 00:57:08 -08:00
Tao Bao
a8d72bc3b4 recovery: Drop the "--stages" / '-g' argument.
This was introduced in commit c87bab1018.
But the stage info should be passed through BCB only (there's a
dedicated field in struct bootloader_message).

This CL removes it from recovery arguments, and also moves 'stage'
variable to std::string.

Test: 'stage' variable is not used by any device-specific recovery code.
Test: Code search shows no hit of '--stages' use.
Change-Id: Iccbde578a13255f2b55dd4a928e9ecf487f16b97
2017-03-07 00:12:06 -08:00
Tao Bao
db7e898080 recovery: Add SetStage() into 'Run graphics test'.
This allows a quicker test for stage UI.

Bug: 27804510
Test: 'Run graphices test' with the new recovery image.
Change-Id: I47689ae8e4cac6d7e5d1f6a10b9e393d50d713f3
2017-03-06 23:53:16 -08:00
Treehugger Robot
a2e7a07031 Merge "Refractor the code for imgdiff" 2017-03-07 03:06:09 +00:00
Tianjie Xu
1ea84d6da9 Refractor the code for imgdiff
Put ImageChunk and some helper functions into a class. Also switch to
using std::vector instead of malloc.

Bug: 18606652
Test: imgdiff_test passed on host. Also generate a complete incremental OTA package.
The file content is the same and time consumption is similar.

Change-Id: Id603ada4e130ef521218400761a119001a86ca79
2017-03-06 15:41:02 -08:00
Tianjie Xu
b694ba8aab Merge "Fix an error on bootloadermessager test teardown" 2017-03-03 21:43:14 +00:00
Tianjie Xu
cace743c4d Fix an error on bootloadermessager test teardown
The test should not clear bcb during teardown on devices without
/misc.

Bug: 35712836
Test: The test tears down without errors after /misc removed from the fstab.
Change-Id: I42df89feb18fac5a435cd17eef97a6bad0f44545
2017-03-03 11:59:28 -08:00
Treehugger Robot
53feebea4f Merge "Recovery Test: add SideloadTest to test FUSE support on target" 2017-03-03 01:10:55 +00:00
Wei Wang
b72a15a2ab Recovery Test: add SideloadTest to test FUSE support on target
FUSE FS is required in recovery sideload functionalites.
This CL is to add a native test to flag when FUSE is not
supported in the device kernel.

Bug: 35768196
Test: mma, run recovery_component_test on marlin and pass all
Change-Id: I43b6dbee658010df56ba4d4b0e91baa7fd1c4480
2017-03-02 15:38:22 -08:00
Treehugger Robot
0f26468eda Merge "Skip BootloaderMessageTest, UncryptTest for devices without /misc" 2017-03-01 03:25:02 +00:00
Tao Bao
d549616b24 Merge "recovery: Remember the last log position." 2017-03-01 02:26:46 +00:00
Tianjie Xu
ca94856416 Skip BootloaderMessageTest, UncryptTest for devices without /misc
Skip these two tests if /misc partition is not found in fstab.

Bug: 35712836
Test: Both test skip correctly if there's no /misc in fstab.${hardware}.
Change-Id: I38417a8677030229a335e43eaef85ae70c4e0845
2017-02-28 17:55:27 -08:00
Tao Bao
c9447cc505 recovery: Remember the last log position.
After reading one log entry, it should stay at the same menu position.

Test: 'View recovery logs' -> Read -> Exit
Change-Id: I4b579be4c2fe1e3a1dcc4873e128fd0b2d619ba3
2017-02-28 15:27:08 -08:00
Treehugger Robot
021304503a Merge "recovery: Don't show "No /cache partition found" on screen." 2017-02-24 19:54:19 +00:00
Tao Bao
f7f1da3fb5 recovery: Don't show "No /cache partition found" on screen.
People have been confused by the message and thought that's an error.

Test: Boot recovery on sailfish; choose 'View recovery logs'.
Change-Id: I2c540f18d6493c1a129233d10ecbc96823dd3601
2017-02-24 10:16:18 -08:00
Elliott Hughes
3ac0dd2a56 Merge "Add a missing #include for openat(2)." 2017-02-24 16:55:25 +00:00
Elliott Hughes
25a29d452e Add a missing #include for openat(2).
Bug: https://code.google.com/p/android/issues/detail?id=64374
Test: builds
Change-Id: I7d7650463197710657820a1adce51f71c1b01415
2017-02-23 10:45:42 -08:00
Sen Jiang
f9962dbfe2 Merge "Use bspatch from external/bsdiff." 2017-02-16 21:14:10 +00:00
Tao Bao
635eb1c83e Merge "recovery: Clean up browse_directory()." 2017-02-14 01:56:24 +00:00
Tao Bao
0d14cc279c Merge "minui: Move graphics_{adf,drm,fbdev} into classes." 2017-02-13 18:25:06 +00:00
Tao Bao
c4a18efa84 recovery: Clean up browse_directory().
Get rid of the malloc/realloc/free'd menus.

browse_directory() will only be called on devices with SD card. Tested
the CL by temporarily setting SDCARD_ROOT to a different location.

Test: See above.
Change-Id: I935e1bf4bad0273e3dff87fa2536924f1219adb5
2017-02-10 21:21:52 -08:00
Tao Bao
557fa1f45e minui: Move graphics_{adf,drm,fbdev} into classes.
This CL defines minui_backend as an interface, and expresses the three
backends (adf, drm and fbdev) as subclasses to the interface.

Test: 'Run graphics test' on N9, Pixel C and N5X.
Change-Id: I0e23951c7b2e2ff918957a8d9fc8b0085b6e5952
2017-02-10 17:05:15 -08:00
Treehugger Robot
df464dbe79 Merge "minui: Save errno before calling close()." 2017-02-09 23:17:59 +00:00
Tao Bao
f04592ba23 minui: Save errno before calling close().
Otherwise errno would be overwritten when calling close(2).

Test: mmma bootable/recovery
Change-Id: I661e46b1b040f550639a728aa2683e91621b4307
2017-02-09 12:59:19 -08:00
Treehugger Robot
5121961421 Merge "minui: Clean up graphics_fbdev.cpp." 2017-02-09 20:31:02 +00:00
Tao Bao
d592e1d5e1 Merge "minui: Clean up graphics_adf.cpp." 2017-02-09 20:07:09 +00:00
Treehugger Robot
648f252c71 Merge "minui: Clean up graphics_drm.cpp." 2017-02-09 19:43:20 +00:00
Tao Bao
76be34cb34 minui: Clean up graphics_drm.cpp.
Remove unneeded header includes. Switch a few memset() to '= {}'
style. Otherwise mostly cosmetic changes like reformatting.

Test: 'Run graphics test' on ryu (which is a DRM device).

Change-Id: I4b0ab2dc0da69a690f09e4f0674b8377de662962
2017-02-07 14:47:59 -08:00
Tao Bao
acf4dd157a minui: Clean up graphics_fbdev.cpp.
Remove unneeded header includes. Otherwise mostly cosmetic changes like
reformatting.

Test: 'Run graphics test' on bullhead (which uses fbdev).

Change-Id: I9b92c96128fa332ac940f73764f9c5fc93ff6c8c
2017-02-07 14:46:31 -08:00
Tao Bao
8f0e21b271 minui: Clean up graphics_adf.cpp.
Remove unneeded header includes. Switch a few memset() to '= {}' style.
Otherwise mostly cosmetic changes like reformatting.

Test: 'Run graphics test' on N9 (which is an ADF device).

Change-Id: If008af18ddae9521f53216b581d882d5eed76d41
2017-02-07 13:20:55 -08:00
Treehugger Robot
95bcbfdd4e Merge "Replace _exit(-1) with _exit(EXIT_FAILURE)." 2017-02-03 23:40:06 +00:00
Tao Bao
3da880156b Replace _exit(-1) with _exit(EXIT_FAILURE).
-1 is not a valid exit status.

Also replace a few exit(1) with exit(EXIT_FAILURE).

Test: mmma bootable/recovery
Change-Id: I4596c8328b770bf95acccc06a4401bd5cabd4bfd
2017-02-03 14:11:11 -08:00
Treehugger Robot
0f275ae56e Merge "Avoid to call UI functions in child process" 2017-02-03 22:06:50 +00:00
Tianjie Xu
c44c479197 Merge "update_verifier should read dm wrapped partition" 2017-02-03 21:50:07 +00:00
Tao Bao
b04bc0540d Merge "minui: Minor clean up to graphics.cpp." 2017-02-03 20:48:47 +00:00
Tianjie Xu
ab1abae59c Avoid to call UI functions in child process
ui_print uses a mutex to protect the critical section. And a forked
child process may intialize the mutex inappropriatly, which leads to a
hanging child process. So we shall avoid to call the UI functions in
child process.

Bug: 34769056
Test: fake ota on fugu failed as expected due to updater format mismatch.
Change-Id: I81bc942a796878fac19cf712512092c2b0d807c9
2017-02-03 20:35:40 +00:00