Commit graph

25 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
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
1ef66b70ff Fixing optimization logic
Adding a hard pattern check for optimized task formation. To keep
behavior consistent, we will remove the old initialization path and add
resize tasks after attempting optimization.

Test: fastboot_test
Bug: 297085098
Change-Id: Ie0e656af9be7abdd130290fe547ffbf385ce75d6
2023-08-30 09:39:30 -07:00
Daniel Zheng
3e04857a59 Changing name of flash super layout
OptimizedFlashSuper makes more sense and is more consistent with
should-optimize-super

Test: m fastboot
Change-Id: I6ceb31144dce591e0a53faec68b932112d9cd360
2023-06-27 10:19:58 -07:00
Daniel Zheng
5769b268bf use FlashingPlan sparse_limit for testing
Have get_sparse_limit() return FlashingPlan's sparse limit if set. Used
for testing to compare task lists

Test: fastboot_test
Change-Id: I7ac1eb4dc83a53b3d7aa59aa668a780b4b550664
2023-06-22 09:52:06 -07:00
Daniel Zheng
665a460e8a Adding GetInfo method for tasks
Using for easier debugging. Replacing old getter methods in flash task
with GetInfo(key)

Test: fastboot_test
Change-Id: If42df86c4b0278c3dc5525b1058f1947f0b34794
2023-06-05 14:40:50 -07:00
Daniel Zheng
791a83bb45 Chang flash task to take in source
Old changes didn't actually take into account sources. fastboot update
{update.zip} should read fastboot-info from the update package. It was
instead flashing local images + reading local fastboot-info.txt

Test: m fastboot, fastboot update, fastboot flashall
Bug: 283330320

Change-Id: I9587a7735ddfbfb661153eb12ebc3caa7c32f141
2023-05-25 13:29:16 -07:00
Daniel Zheng
5a9905a62b Fixing constructors to match header files
Constructor in cpp file doesn't match header file

Test: m fastboot, fastboot flashall -w
Change-Id: I2c720bb594efca5af1e5a374277543a522ced5ef
2023-05-23 10:51:01 -07:00
Daniel Zheng
29a211c194 Changing flashall to parse fastboot-info.txt
Test: tested on Raven
Change-Id: I9f26bf6025a0a6318f84be929091f4e82bd87556
2023-04-19 12:30:37 -07:00
Daniel Zheng
0897526557 Fixing circular dependency
Test: tested compilation
Change-Id: Iae25cade1efb2372e5fc219fa69cbb2381b4e05c
2023-04-17 11:34:00 -07:00
Daniel Zheng
e6dbd4f194 Adding const to task constructors
Adding const decorator to class constructor to ensure Flashing Plan
isn't modified during task construction

Bug: 194686221
Test: tested Flashall on raven
Change-Id: I99b71b2b756beaf871a31a1a035545d754d128e8
2023-04-10 09:53:08 -07:00
David Anderson
ecdbbbda82 Merge changes Ie68aed2f,Ic40696b3
* changes:
  fastboot: Handle libsparse failures better.
  libsparse: Fix allocation failures on 32-bit systems.
2023-03-22 00:02:13 +00:00
David Anderson
74c7807af1 fastboot: Handle libsparse failures better.
sparse_file_len is not actually infallible; on Windows it's pretty easy
to make it fail by embedding large files in the stream. fastboot didn't
handle this anywhere, leading to bad sparse images when libsparse
runs out of address space.

Bug: 273933042
Bug: 268872725
Test: fastboot flashall on Windows
Change-Id: Ie68aed2f1970e820350d9f97aa89a6c0242229b8
2023-03-20 15:55:57 -07:00
Daniel Zheng
f1ddba9dfd Updating FlashTask to require img-name
Test: tested flash {partition} on pixel
Bug: 194686221
Change-Id: I8018e48f68606ec9c559d06973154d79e7c0634a
2023-03-20 20:20:43 +00:00
Daniel Zheng
403657d998 Changing FlashTask to take in apply_vbmeta
Test: tested on Raven
Change-Id: I709842d87aa4ad6a7772e4f441886d127c3028a7
2023-03-13 18:28:14 +00:00
Daniel Zheng
15e7783263 Added support for Wipe Task
Test: tested wipe on Raven
Bug: 194686221
Change-Id: I582800a279cbe8a3e733a1e75447e5b5142d4120
2023-03-13 17:37:31 +00:00
Daniel Zheng
43987c948b Fixed parameter styling and minor error in tasks
Test: tested compilation
Change-Id: Ieb949243da1284dec3bad2caa895a59465858adc
2023-03-08 23:07:51 +00:00
Daniel Zheng
aa70f4c748 Added support for Delete Task
Test: tested delete-logical-partition {partition} and flashall on Raven

Change-Id: I04f07c8132159deda42434b9178e8c98d5ab768b
Bug: 194686221
2023-03-08 23:07:51 +00:00
Daniel Zheng
9f7bf7eff3 Added support for Resize Task
Test: tested flashall on raven
Bug: 194686221
Change-Id: I60586756b2d5f99848a664def8204c0bd47d7e67
2023-03-08 23:07:50 +00:00
Daniel Zheng
6bb8baa929 Added support for Update Super Task
Test: tested flashall on raven
Bug: 194686221
Change-Id: Ifc99af77f9235bf56a549f53e7d43575686fb42b
2023-03-08 23:07:50 +00:00
Daniel Zheng
47d70a5559 Added support for FlashSuperLayoutTask
Test: testing flashall code with this change
Bug: 194686221
Change-Id: Ibb96980402db51b48c9a296338f29195f68c65bf
2023-03-08 23:07:48 +00:00
Daniel Zheng
bc01da5c0d Changed FlashTask and RebootTask to take in FlashingPlan
Test: tested flash {partition} on raven and reboot {target} on raven
Change-Id: I26f4723474c3a142b086c1ac361578f8487ec3b9
Bug: 194686221
2023-03-03 06:49:34 +00:00
Daniel Zheng
71b3b43495 Added support for reboot task
Test: tested on raven device
Change-Id: I4935d720f567e70da95ea8da37f3404b80b313c8
Bug: 194686221

Changed reboot {target} to work off tasks. reboot-{target} commands are
also supported.

Test: tested reboot on raven device
Change-Id: I05aed269d121a5d651c1ab1180a1b4878ae213fd

Modified load_buf to be able to find images in $OUT directory

Test: tested flash {partition} and flash {partition} {img_name} on raven
device

Change-Id: I3879792d11ad15bc910670853d2a7fe200fcc66f
2023-02-23 00:15:08 +00:00
Daniel Zheng
0d30718d9c Added support for flash task
Added Flash Task

Test: tested on raven
Change-Id: I4a6c22f795440afeba18497745dddf8d5c570f65
Bug: 194686221

changed flash {partition_name} to work with tasks

Test: tested flash {partition_name} on raven
Change-Id: I1fa45b949ad8e5017026dd542dfe1389279a9e64
Bug: 194686221
2023-02-13 23:27:41 +00:00
Daniel Zheng
1a01a1cda1 Created new Task.h file to contain task classes.
Test: tested Reboot {target} + Flash {partition} on raven device
Bug: 194686221
Change-Id: I0d80230d682f80af12cca9705df0172651bf4461
2023-02-06 23:58:13 +00:00