Commit graph

987 commits

Author SHA1 Message Date
Daniel Zheng
37673f0bf5 Merge "Fixing circular dependency" 2023-04-19 00:16:13 +00:00
Daniel Zheng
729c159744 Merge "Moving logging include" 2023-04-18 16:26:01 +00:00
Daniel Zheng
0897526557 Fixing circular dependency
Test: tested compilation
Change-Id: Iae25cade1efb2372e5fc219fa69cbb2381b4e05c
2023-04-17 11:34:00 -07:00
Daniel Zheng
7627b54910 Moving logging include
Header file shouldn't have include of logging

Test: tested compilation
Change-Id: I02cccb66b6ee5811e5d4f2b9b72508fee640e828
2023-04-17 09:42:39 -07:00
Daniel Zheng
0a785083bb Merge "Cleaning up main code" 2023-04-13 20:44:31 +00:00
Daniel Zheng
83800601f6 Merge "Adding const to task constructors" 2023-04-10 19:44:31 +00:00
Daniel Zheng
23631b9be7 Merge "Cleaned up slot logic" 2023-04-10 18:02:05 +00:00
Daniel Zheng
dddb5fa80b Merge "Correcting Reboot Task Functionality" 2023-04-10 17:46:03 +00: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
Daniel Zheng
1e6456b011 Cleaned up slot logic
Updating old clean up slot logic change. Some devices don't know current
slot so we can't always just call get_current_slot()

Test: tested flashall on raven
Change-Id: Id655f1c1ee0b1ff09331f0d91d77412836d0af8d
2023-04-10 09:35:48 -07:00
Treehugger Robot
b2fdbef489 Merge "Revert "Cleaned up some slot logic"" 2023-04-03 21:49:25 +00:00
Kelvin Zhang
2a4a45f3e4 Revert "Cleaned up some slot logic"
This reverts commit bd85a18d0b.

Reason for revert: b/276759363

Change-Id: I3ba08cf4abeeb7769569512d50e7ff135438cf20
2023-04-03 20:44:05 +00:00
Daniel Zheng
b16aba889a Merge "Cleaned up some slot logic" 2023-03-30 21:49:15 +00:00
Daniel Zheng
719caca725 Merge "Added some error logs to wipe" 2023-03-30 21:30:11 +00:00
Daniel Zheng
76c9343339 Cleaning up main code
cleaning up main() code in fastboot.cpp to run off one task vector. The
eventual goal is to just have all functionality run off this vector.

Test: tested commands on raven
Bug: 194686221
Change-Id: I98d0ba33091eff31ff1bc338766c3689ffb54746
2023-03-30 18:35:14 +00:00
Daniel Zheng
1418fb8ce0 Correcting Reboot Task Functionality
Modifying fastboot-info.txt to directly call reboot fastboot instead of
reboot userspace -> so no longer need "userspace" in reboot task. Also
moving skip_reboot check to task since in old code we can have
skip_reboot be true and still reboot to bootloader, fastboot, or
recovery

Test: tested reboot commands on Raven
Change-Id: I98ba51747bf7229a88ba737540c81d20b42e5981
2023-03-30 18:35:14 +00:00
Daniel Zheng
4aa47338f2 Merge "Added check to copy AVB footer" 2023-03-30 18:24:31 +00:00
Daniel Zheng
bd85a18d0b Cleaned up some slot logic
Doesn't look like we actually need current_slot, since we can always
just call function get_current_slot

Test: tested flashall on raven
Change-Id: Icba64bc9fdd08f36d44965e32558a73d0beab0e1
2023-03-30 18:21:28 +00:00
Daniel Zheng
6f213b2c79 Added some error logs to wipe
Changed so if we call wipe on a partition that doesn't exist we'll get
some helpful error messages.

Test: tested wipe test
Bug: 194686221
Change-Id: I19dc0396a7a98d0b2be7859edbffeb8acdc9850a
2023-03-30 18:19:04 +00:00
Daniel Zheng
e33e8a8685 Added check to copy AVB footer
is_logical shouldn't work in bootloader for some devices, so we also need to check
using should_flash_in_userspace to see if partition is dynamic

Test: tested to flash {partition} on raven and checked to see avb
footers are not copied from dynamic partitions

Change-Id: Iabb3ea535fa80b26cf1c08040beb3d4ea5e8c2ae
2023-03-30 18:19:04 +00:00
Ayushi Khopkar
33ff88f9c3 Updated fuzz_config in Android.bp file
Added new fields in fuzz_config like - hotlists,
description, vector, service_privilege, users, fuzzed_code_usage, etc.

Bug: 271384401
Test: Build fastboot_fuzzer

Change-Id: I7799ffcb7f11202711b19cf40e8c05e050d3b519
2023-03-23 16:06:24 +05:30
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
0bf3b71fbb Updating Flashall to work off tasks
Test: testing fastboot flashall on raven
Bug: 194686221
Change-Id: I82ac2392686775b57c3d98ea003ab30b48f1ab0f
2023-03-20 20:21:31 +00:00
Daniel Zheng
85c0f3e567 Updated location of initialization
Test: tested flashall on raven
Bug: 194686221
Change-Id: Ie0dd7acd65833a938623e374e2b21e6bd6079d08
2023-03-20 20:21:31 +00: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
980985af6e Removed hardcoded check to copy AVB Footer
Test: tested flashall on raven
Bug: 194686221
Change-Id: Iaca03bde51fcd6b2886dc8ba84da4f67174a9c3f
2023-03-20 16:24:40 +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
Dmitrii Merkurev
48b39ba01e Merge "fastboot: Introduce ParseNetworkSerial unit tests" 2023-03-03 18:52:33 +00:00
Daniel Zheng
78a0f7f1b2 Merge "Changed FlashTask and RebootTask to take in FlashingPlan" 2023-03-03 07:43:03 +00:00
Daniel Zheng
f8da682c84 Merge "Added Flashing Plan" 2023-03-03 07:42:55 +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
7df2ab9c87 Added Flashing Plan
Fastboot has a lot of flags that are used by many different functions
including the Flashall Class and newly added FlashSuperTask. Passing all
of these flags as paramaters is cumbersome, so adding a Flashing Plan
that contains these flags simplifies the code.

Test: tested Flashall and update img.zip on raven
Change-Id: I9c842f25389a20b852d55f684e1b86040af1d86a
Bug: 194686221
2023-03-03 06:49:32 +00:00
Dmitrii Merkurev
cdbfa7a3e8 fastboot: Introduce ParseNetworkSerial unit tests
Introduced positive and negative unit tests to cover
ParseNetworkSerial logic. Alongside with that move
result related stuff to the separate header.

Test: atest fastboot_test
Test: manually checked basic functionality works fine
Bug: 271155012
Change-Id: Icac6053c11b5a36daa64555209555826ea28cc61
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-03-02 00:03:49 +00:00
Dmitrii Merkurev
95c90c6588 fastboot: Fix fastboot_vendor_boot_img_utils_test mac os compilation
Use more universal lseek instead of lseek64

Test: atest fastboot_vendor_boot_img_utils_test
Test: mm on mac os
Bug: 271152365
Change-Id: I4d094dd2c24e4ffec8ea7fe2f3b355122fd8cd19
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-03-01 15:49:56 +00:00
Treehugger Robot
396b107a41 Merge "fastboot: Fix IPv6 connect and -s host parsing" 2023-02-28 22:46:02 +00:00
Dmitrii Merkurev
4785554ca1 fastboot: Fix IPv6 connect and -s host parsing
During fastboot connect / disconnect introduction, we
completely broke the IPv6 support (it was considering
all IPv6 addresses as a USB serial).

Makeing sure this problem isn't reproducible anymore
alongside with fixing EXCPECT causing process crash
and improve network serial error detection.

Bug: 271152365
Change-Id: Ic52aa5fff1948a64ac3d2672f3cf4d2b022e5cea
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-02-28 21:02:48 +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
Dmitrii Merkurev
45380e4ace Merge "fastboot: Use copy constructor to copy fastboot match callback" 2023-02-15 19:05:55 +00:00
Dmitrii Merkurev
96ea7b9ccf Merge "fastboot: Follow fastboot pattern to show network-connected device status" 2023-02-15 19:05:34 +00:00
Dmitrii Merkurev
c48cd9f6c0 fastboot: Follow fastboot pattern to show network-connected device status
Bug: 269348113
Test: checked output
Change-Id: Ie6c48d36bd67fcb060ad3f4a35185fd9cc59ff81
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-02-15 15:34:58 +00:00
Dmitrii Merkurev
b5b8276db1 fastboot: Use copy constructor to copy fastboot match callback
Test: fastboot -s 15171FDF6000CV getvar all on OSX
Bug: 269348113
Change-Id: I968626c95ee19ea348bac48cac308e3c817e0d55
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2023-02-15 15:21:22 +00:00
Treehugger Robot
368a908334 Merge "Fastboot: Add new TEXT message to protocol to handle long lines." 2023-02-15 11:49:24 +00:00
Raphael Herouart
99097cc020 Fastboot: Add new TEXT message to protocol to handle long lines.
Trusty Benchmarks need to be evaluated in ABL which is much more
controlled than linux. However fastboot prints evry atomic message from
trusty/abl on its own line starting with "(bootloader)"

Bug: 263454481
Test: - "fastboot oem trusty runtest trusty.hwrng.bench"
Change-Id: I99847a8cc54457c8ec809e219736325dce0ac891
2023-02-14 19:58:42 +00:00