summaryrefslogtreecommitdiff
path: root/fastboot
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-13.0.0_r52' of ↵George Zacharia2023-07-021-0/+10
|\ | | | | | | | | | | | | | | https://android.googlesource.com/platform/system/core into xb Android 13.0.0 Release 52 (TQ3A.230605.012) Change-Id: Idd86c936487bfbc0181743dccce9d1f9f08bbe5c
| * Port ADB's new handling of the USB packet ClearFeature(HALT) to Fastboot.Nicolas Gagnon2023-01-311-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch addresses Fastboot/Fastbootd connection issues seen on ARM Mac devices. Original ADB patch: https://android-review.googlesource.com/c/platform/packages/modules/adb/+/1699250/ Bug: 238779161 Test: 'fastboot update <path_to_update_archive>.zip' now works on ARM Mac. Signed-off-by: Nicolas Gagnon <nicolasgagnon@google.com> Merged-In: Id67904d91abc8b66ef1a00962e1fd57c97df98a7 Change-Id: Id67904d91abc8b66ef1a00962e1fd57c97df98a7 (cherry picked from commit 3efef5694ee242f0fbeeaaa15c128dfb84418798)
| * fastboot: Add vendor_kernel_bootLucas Wei2022-06-012-1/+6
| | | | | | | | | | | | | | | | Bug: 234474672 Bug: 214409109 Signed-off-by: Lucas Wei <lucaswei@google.com> Merged-In: I8b0baa887e5e2309a1cb4a602fe8f6ca9e22526b Change-Id: I60b7ec0c160d38e01b15ed547d51a2a007bfd7f5
| * Merge changes from topic "fastbootd-reset-fd"Konstantin Vyshetsky2022-03-283-23/+66
| |\ | | | | | | | | | | | | | | | | | | * changes: fastbootd: reset file descriptor on unaligned writes fastbootd: add support to reset fd by handle fastbootd: pass handle in place of fd
| | * fastbootd: reset file descriptor on unaligned writesKonstantin Vyshetsky2022-03-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Writes on file descriptors opened with O_DIRECT will fail if the buffer is not page aligned. This CL will reset the file descriptor without the O_DIRECT flag for such instances. Bug: 225108941 Signed-off-by: Konstantin Vyshetsky <vkon@google.com> Change-Id: I841c84f5d2c0b9435b394c48b1bfcc2d51d771bb
| | * fastbootd: add support to reset fd by handleKonstantin Vyshetsky2022-03-282-9/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are cases where the flags the file descriptor was opened with need to be modified. This CL adds functionality to reset the file descriptor held by a PartitionHandle, reopening with new flags and repositioning file offset to previous. Bug: 225108941 Signed-off-by: Konstantin Vyshetsky <vkon@google.com> Change-Id: I9adb0e7696bc6af74e14dd61a6cb0ef10b4c98c8
| | * fastbootd: pass handle in place of fdKonstantin Vyshetsky2022-03-211-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are cases such as non 4KB aligned buffers which break writes on file descriptors opened with O_DIRECT. Flashing functions need more control over the file descriptor, which is not achievable easily by having only a file descriptor passed. This CL modifies the logic to pass the PartitionHandle in place of the file descriptor during flashing. Bug: 225108941 Signed-off-by: Konstantin Vyshetsky <vkon@google.com> Change-Id: I049d0ffb183c9de1267b7e442488c8ba5002186a
| * | fastboot: Fallback to "raw" partition type if fastboot hal isn't presentLuK13372022-03-021-2/+2
| |/ | | | | | | | | | | | | | | | | Fastboot format fails to wipe any partition that doesn't at least return "raw" partition type. Also both android.hardware.fastboot@1.0-impl.pixel and android.hardware.fastboot@1.1-impl-mock return FileSystemType::RAW so I assume this is fine. Change-Id: I5707bddb1ba32edb6359858853d7b1afbf138b9f
| * fastbootd: Remove all scratch partitions on update-super.David Anderson2022-02-171-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures that the dynamic "scratch" partition is removed when doing a flashall operation. If "scratch" is on /data, disable the partition. Add IsImageDisabled to ImageManager so EnsureScratchMapped can skip mapping it. Also, fix "scratch" not getting unmapped if on /data. Bug: 205987817 Test: adb remount adb sync adb reboot fastboot fastboot flashall --skip-reboot # no errors Test: adb-remount-test.sh Change-Id: I4b9702e1dac15fb663635506fb50a8274e1e10d1
| * Add LOCAL_LICENSE_KINDS to system/coreBob Badour2022-02-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added SPDX-license-identifier-Apache-2.0 to: fastboot/fuzzer/Android.bp fs_mgr/fuzz/Android.bp Bug: 68860345 Bug: 151177513 Bug: 151953481 Test: m all Change-Id: I3bb21e1af846d175a345c2a3a632dc47ecdd62de
| * Allow disabling AVB on special vbmeta partitionsPaweł Grabas2022-02-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | The vbmeta partition might have additional prefix (e.g., guest_vbmeta_a) on some virtual machine environment. Allowing rewriting the disable-verity/ disable-verification bits in the vbmeta image upon flash under such use case. Bug: https://partnerissuetracker.corp.google.com/u/1/issues/181791553 Test: manual tests with different names of vbmeta partition Change-Id: Iacadaf587fce1e1e7fef946f56bbfc7f4e8233d8
| * Merge "fuzzy_fastboot: Add malformed download command test"Keith Mok2022-01-191-0/+23
| |\
| | * fuzzy_fastboot: Add malformed download command testKeith Mok2022-01-191-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a malformed download command test. And add a sparse file test with very large block size Bug: 215236564 Test: bootloader fastboot Change-Id: I1072ba189ac15b2e1eb8f13ffd754f93c967e2d5
| * | Merge "Add a LICENSE file for fastboot"Hridya Valsaraju2022-01-192-3/+28
| |\ \ | | |/ | |/|
| | * Add a LICENSE file for fastbootHridya Valsaraju2022-01-182-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | The BSD license used by some of the files in the project was lacking a license_text file. Bug: 191508821 Test: m fastboot Change-Id: I3bdfdea3de69ceaa28528b72a09d02d2a9535e85
| * | Add checking for sparse file formatKeith Mok2022-01-142-2/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sparse file can come from an untrusted source. Need more checking to ensure that it is not a malformed file and would not cause any OOB read access. Update fuzz test for decoding also. Test: adb reboot fastboot fuzzy_fastboot --gtest_filter=Fuzz.Sparse* fuzzy_fastboot --gtest_filter=Conformance.Sparse* sparse_fuzzer Bug: 212705418 Change-Id: I7622df307bb00e59faaba8bb2c67cb474cffed8e
| * | Merge "fastboot: make init_boot.img optional"Treehugger Robot2022-01-111-1/+1
| |\ \
| | * | fastboot: make init_boot.img optionalDevin Moore2022-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Older devices don't build this image because they don't have a partition for it. Bug: N/A Test: m Change-Id: I56b58c1bc137ce25e426aa4ec6d2303fa7d77ccc
| * | | Merge "Remove win_sdk"Treehugger Robot2022-01-101-1/+1
| |\ \ \ | | |/ / | |/| |
| | * | Remove win_sdkCole Faust2022-01-071-1/+1
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | win_sdk is deprecated, if given on the command line sdk will be build instead. Bug: 212724080 Test: Presubmits Change-Id: Ia92b879fe08f0a1d9ebefc90e369adf1d4aa4112
| * | fastboot: make copy_boot_avb_footer more genericDevin Moore2022-01-071-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | The funciton is now used for init_boot and boot partitions, so the name and the error messages should be more generic. Bug: 203698939 Test: m Change-Id: I168fdcb08accb11b2c9cfc402168744274f59665
| * | Merge changes Ib5a63a7b,If00f581aDevin Moore2022-01-073-3/+9
| |\ \ | | | | | | | | | | | | | | | | | | | | * changes: fastboot: copy AVB footer from init_boot.img to end of partition fastboot: Support flashing init_boot.img into init_boot partition
| | * | fastboot: copy AVB footer from init_boot.img to end of partitionDevin Moore2022-01-062-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to GKI boot.img, init_boot.img is released as a specific size and should be able to be flashed into partitions that have different sizes. So the AVB footer is moved from the end of the init_boot.img to the end of the partition in the case that the partition is larger than the image. Bug: 203698939 Test: m Change-Id: Ib5a63a7bf1b4be4eba4941972750f12e3edb3a17
| | * | fastboot: Support flashing init_boot.img into init_boot partitionDevin Moore2022-01-062-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | init_boot_a and init_boot_b partitions are used in A/B devices. Bug: 203698939 Test: m Change-Id: If00f581ab7ae340d78d7d55eebafd92ac15d2bc1
| * | | fastboot: Add elsk@ to OWNERS fileHridya Valsaraju2022-01-061-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | Also, remove hridya@ from the OWNERS file Test: N/A Bug: N/A Change-Id: I1d5a03ebf9e2e93f555474a6a654e16879b8e96a
| * | Merge changes I75017420,I3612e131Keith Mok2022-01-053-8/+44
| |\ \ | | | | | | | | | | | | | | | | | | | | * changes: Fix userspace fastboot with fuzzy test Fix fuzzy test on too large command
| | * | Fix userspace fastboot with fuzzy testKeith Mok2022-01-042-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add more checking for fastboot to detect malformed requests. Such as checking no control characters in the command send from host. Make sure the download command length is eight bytes. And report FAIL if download length is zero. Test: adb reboot fastboot fuzzy_fastboot --gtest_filter=Fuzz.DownloadInvalid1 fuzzy_fastboot --gtest_filter=Fuzz.DownloadInvalid2 fuzzy_fastboot --gtest_filter=Fuzz.DownloadInvalid7 fuzzy_fastboot --gtest_filter=Fuzz.DownloadInvalid8 Bug: 212628476 Change-Id: I750174205377395b5328923fb00462d078f3310d
| | * | Fix fuzzy test on too large commandKeith Mok2022-01-041-8/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device might return I/O error instead of FAIL message if command send to device is too large. Since maximum command size in fastboto protocol is 64 bytes. The device might only try to read 64 bytes for the bulk transfer, sending data more than that might result in USB I/O error. Do proper handler for that in fuzzy_fastboot and reset the USB if I/O error encounter during the Comman.dTooLarge test Test: adb reboot fastboot fuzzy_fastboot --gtest_filter=Fuzz.CommandTooLarge fuzzy_fastboot --gtest_filter=Fuzz.BadCommandTooLarge Bug: 212628476 Change-Id: I3612e131de02435ee3ed7d18f2b2d20b50ae6c3f
| * | | Merge "Fix typo in fuzzy_fastboot README"Keith Mok2022-01-051-1/+1
| |\| | | | |/ | |/|
| | * Fix typo in fuzzy_fastboot READMEKeith Mok2021-12-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fuzzy_fastboot does not output error with invalid command line argument. Fix typo in README for running with gtest_filter Bug: 212628476 Test: N/A Change-Id: I4a67a84807b59db50f063f1b9cf60dc964c1df20
| * | Merge "fastboot: Add system_dlkm flashing support"Treehugger Robot2022-01-042-1/+5
| |\ \ | | |/ | |/|
| | * fastboot: Add system_dlkm flashing supportRamji Jiyani2021-12-292-1/+5
| | | | | | | | | | | | | | | | | | | | | Bug: 200082547 Test: TreeHugger Signed-off-by: Ramji Jiyani <ramjiyani@google.com> Change-Id: I35e081bbe8674c102324d22d440dcc38493ec25b
| * | fastboot: use health AIDL HALYifan Hong2021-12-064-16/+35
| |/ | | | | | | | | | | Bug: 208543110 Test: fastboot getvar Change-Id: Ib83e7ccd53e49367f7af218ffafb7c0a57a514f6
| * fastbootd: use O_DIRECT for write partitionKonstantin Vyshetsky2021-11-041-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Direct writes for partition flashing significantly increase performance. Use O_DIRECT flag when opening partition for flashing. Additionally use a 4096b aligned buffer which is required for O_DIRECT. Switch from using 8MB write buffer to 1MB write buffer, as the extra allocation has no performance impact. Test: flash locally and reach home screen Bug: 205151372 Signed-off-by: Konstantin Vyshetsky <vkon@google.com> Change-Id: I060f438cf698d0fda1e59e35338bb5dc1cd05b51
| * fastbootd: allow passage of flags to open partitionKonstantin Vyshetsky2021-11-043-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | Allow caller to pass additional flags when opening a partition. Obsolete usage of boolean read, and make previous callers use O_RDONLY instead. Explicitly OR (O_EXCL | O_CLOEXEC | O_BINARY) to keep existing design working as is. Test: flash locally and reach home screen Bug: 205151372 Signed-off-by: Konstantin Vyshetsky <vkon@google.com> Change-Id: I48fbca459a17fcf0b0926ab339585e3bd8e31e35
| * Use HOST_OUT_EXECUTABLES instead of SOONG_HOST_OUT_EXECUTABLESColin Cross2021-10-251-5/+5
| | | | | | | | | | | | | | | | | | | | Soong is installing binaries directly to HOST_OUT_EXECUTABLES instead of SOONG_HOST_OUT_EXECUTABLES, dist from the HOST_OUT_EXECUTABLES location. Bug: 204136549 Test: m checkbuild Change-Id: Iee7ae8d1ed478aa2a0344fc9f54ad2c146841cb0
| * Added fastboot_fuzzerAyushi Khopkar2021-10-146-0/+589
| | | | | | | | | | | | | | Test: ./fastboot_fuzzer Bug: 189053436 Change-Id: Idf9be2f86238eb2c7090402adc54bbb9c0b43582
| * Merge "fastboot: Support casefolding in ext4 partitions."David Anderson2021-08-271-0/+7
| |\
| | * fastboot: Support casefolding in ext4 partitions.David Anderson2021-07-131-0/+7
| | | | | | | | | | | | | | | | | | Bug: 191929411 Test: manual test Change-Id: I9bd0a906fa9a2605d56cc3f37247fcc2a3d5f858
| * | Merge "Include sys/select.h for fd_set"Colin Cross2021-08-171-0/+4
| |\ \
| | * | Include sys/select.h for fd_setColin Cross2021-08-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | socket.cpp fails to compile on musl with a missing definition of fd_set. Include sys/select.h for the definition. Bug: 190084016 Test: m USE_HOST_MUSL=true fastboot Change-Id: I095a56381a85981f42444f4c39ae8e7786d8640f
| * | | Merge "fastboot/README.md: Update response packet max size to 256"Yi-Yo Chiang2021-08-171-6/+6
| |\ \ \ | | |/ / | |/| |
| | * | fastboot/README.md: Update response packet max size to 256Yi-Yo Chiang2021-08-141-6/+6
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is to update the doc to reflect the current state and it doesn't affect the runtime behavior. The max packet size was updated to 256 by aosp/1226715. Bug: 196676392 Test: Presubmit; doc update doesn't affect build Change-Id: I73b0a416730d09fdb24ea81bffe52ddd89534132
| * | Merge "Remove jmgao from OWNERS files."Christopher Ferris2021-08-111-1/+0
| |\ \
| | * | Remove jmgao from OWNERS files.Christopher Ferris2021-08-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Josh no longer works on Android, so remove him from OWNERS files. Test: NA Change-Id: I676cd803b5e3167db1b5175a630d85d1edfcaaaf
| * | | Merge "fastboot: fix --disable-verifiation error message"Treehugger Robot2021-08-111-10/+21
| |\ \ \ | | |/ / | |/| |
| | * | fastboot: fix --disable-verifiation error messageBowgo Tsai2021-08-101-10/+21
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is an unclear error message if we run `fastboot --disable-verification flash boot boot.img` on a AVB-disabled device without a /vbmeta partition. Error message: terminating with uncaught exception of type std::out_of_range: basic_string Aborted This is because the buf->fd of the loaded boot.img is not reset, before returning from function copy_boot_avb_footer(). Also reset some changes in copy_boot_avb_footer() from commit If83f785e235569ee8ef0de2b37f11dbd2a9a71f4, to prevent the unnecessary read of the boot vbmeta if no need to copy the boot image avb footer. Bug: 191903922 Test: `fastboot --disable-verification flash boot boot.img` on a device without /vbmeta and without setting BOARD_AVB_ENABLE to true. Change-Id: If84f08f1b2e12c4c6ded5cafda2bd1d30e75c662
| * / fastbootd: Delete all VAB partitions during "flashall".David Anderson2021-08-091-4/+14
| |/ | | | | | | | | | | | | | | | | | | With VAB we encourage a smaller super partition, so make sure we delete "other" slot partitions during flashing. Otherwise, we may not have enough space in super. Bug: 195930130 Test: set_active, flashall, ensure other slot is deleted Change-Id: Ic6a4f60e8f4c7abb8af7b38228753ad8ed85eedf
| * Merge "Remove --wipe-and-use-fbe option from fastboot"Treehugger Robot2021-06-161-61/+1
| |\
| | * Remove --wipe-and-use-fbe option from fastbootPaul Crowley2021-06-151-61/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | As per the bug, this option has been obsolete for years and only causes confusion. Bug: 167694738 Test: fastboot can still wipe Change-Id: I24a21cb6110d61dec4af800a1fab0bcedc0a3d5c