Commit graph

13 commits

Author SHA1 Message Date
David Anderson
adb91b0e59 remount: Detect when flashall has happened in the bootloader.
This adds a new metadata header flag to the super partition. This flag
is set when "adb remount" is used, and is implicitly cleared when
flashing.

If there is a scratch partition present on /data, we require that the
flag be set in order to proceed using overlays. If not set, scratch is
not mapped in first-stage init, and scratch images are removed later
during startup.

Bug: 297923468
Test: adb remount -R, touch file in out/, sync, flashall
Change-Id: I9cc411a1632101b5fc043193b38db8ffb9c20e7f
2023-12-14 16:00:27 -08:00
Yi Kong
90f6cb4b2c Fix -Wunused-variable compiler warning
Test: presubmit
Change-Id: Ia6d0a735c94c7be39994fb9c8ae4d3b65d6f4301
2023-12-06 14:07:36 +09:00
Christopher Ferris
9dabc9ef32 Change source to be a unique_ptr.
The current code keeps a pointer to a local variable which doesn't
work too well. Change this to a unique_ptr and allocate the source
object that will be used instead.

Test: All unit tests pass.
Test: fastboot -w flashall on a mokey which crashed without this change.
Change-Id: Ief5437374181e514928c45dd540b42898901a137
2023-10-02 17:02:51 -07:00
Daniel Zheng
afe1163ade Adding test for IsDynamicPartition
Adding a test case for checking if flash task is a dynamic partition
flash task. This function is used since is-logical only works in
fastbootd, and should_flash_in_userspace() only works if
$ANDROID_PRODUCT_OUT is set. This function works with fastboot update
when called in bootloader without $OUT dir set

Test: fastboot_test
Change-Id: I65309f97e04fdfc449e61de5cd3a6feff18bc9ab
2023-08-30 12:59:29 -07:00
Daniel Zheng
1fff690c18 Adding testing for optimized flash super
Adding test cases for correct formation of optimized flash super task.
We are adding an explicit pattern match for this task to be correctly
formed. Changing Optimized flash task to only remove the reboot to
userspace as a user might want to reboot back to bootloader after
flashing. We also need to change a couple functions to take a
IFastbootDriver to mock up the initialization path.

Test: fastboot_test
Bug: 297085098
Change-Id: Ic5c63bd4057ca6d64647134e5ce33fef12077fdb
2023-08-30 12:59:26 -07:00
Daniel Zheng
eabfe272c3 Fastboot-info testing
adding test to compare task list formed from fastboot-info vs list
formed from image list. To test, we need to set sparse_limit in flashing
plan and turn off update-super-optimization. The list of partitions to
be flashed by parsing fastboot-info should be a superset of the
partitions flashed by the hardcoded list. Changing is_retrofit_device()
to also take in a fastboot driver so we can pass in a mock

Test: fastboot_test
Bug: 194686221
Change-Id: Ib860c24c85779de1fbaa6bec8778e1f5ebb9475a
2023-07-11 12:53:29 -07:00
Daniel Zheng
630f29e0db Updating fastboot-info version check
Updating version to just be a single number.  Reason for updating is
to keep format the same as Flashstation's

Test: fastboot_test
Bug: 194686221
Change-Id: I21ab0747e620d3f6d05c5170c3e55707eed0288a
2023-05-01 14:04:12 -07:00
Daniel Zheng
0d2d631d27 Added Mock function call tests
Checking flash partition is called correct number of times

Test: tested fastboot_test
Change-Id: I8a04fb0e30e794641f3e2fbe2ab666274be18b85
2023-04-20 14:31:16 -07:00
Daniel Zheng
207c0a3577 Updating Test Suite Names
updating task_test naming convention

Test: m fastboot_test
Change-Id: I56f93f47b3c15e2bc7bb6584b5b3dc12816eb681
2023-04-20 14:20:30 -07:00
Daniel Zheng
32dc6dd5de Adding correct task formed test
Test: test passes
Change-Id: I07b591a2c72d207d794dd3eb044a5fdfc048eb70
2023-04-20 14:18:22 -07:00
Daniel Zheng
935ee1f971 Added test for parsing bad input
Test: fastboot_test
Change-Id: I04fc24741987bc88a490b2084189dfd8f3714582
2023-04-20 14:11:06 -07:00
Daniel Zheng
68b84df994 Added test for version check
Test: fastboot_test
Bug: 194686221
Change-Id: I886c0a91be3b4f4bf7f2b8c76704aa30a352ee5b
2023-04-19 12:30:38 -07:00
Daniel Zheng
76aa257850 Adding Test for Parsing Flash Task
Test: fastboot_test
Bug: 194686221
Change-Id: Ie15b2d0423366fb9d1debb9be52de3b6d3a891af
2023-04-19 12:30:38 -07:00