Commit graph

12 commits

Author SHA1 Message Date
Hridya Valsaraju
47658caae4 Interface with health HAL to read battery voltage
Bug: 78793464
Test: fastboot getvar battery-voltage
Change-Id: Ie0763e4f08327ec7649c5629066eb73e8142e0e6
2018-09-28 14:28:49 -07:00
Hridya Valsaraju
bf9f8d1a64 Integrate with fastboot HAL to get partition type
Bug: 79480454
Bug: 78793464

Test: fastboot getvar partition-type:userdata

Change-Id: Ib096ee8061568b8503f3a3f2dbb7e19a932162c4
2018-09-07 12:22:00 -07:00
Dan Willemsen
822465a930 Fix the mac fastboot build
The Carbon framework isn't on the list of libraries that Soong allows
linking against, so this broke the Mac build. This compiles just fine
without Carbon though, and I don't see any references to Carbon in the
code.

Test: mma
Change-Id: I83044d244f7cec778c8b8b6132249c0f016c10fc
2018-08-30 18:26:11 -07:00
Dan Willemsen
ab971b5e7e Convert fastboot to Soong
Also fix adb's version number to match.

See build/soong/README.md for more information.

Test: cd system/core/fastboot; mma
Test: fastboot --version
Test: adb --version
Test: out/host/linux-x86/nativetest/fastboot_test/fastboot_test
Test: out/host/linux-x86/nativetest64/fastboot_test/fastboot_test
Change-Id: I65ea39af9183c602e84f3bc0e4a0d066a30fc464
2018-08-30 11:28:18 -07:00
Aaron Wisner
a5ad20aecc Fix mac build breakage due to missing usb_osx.cpp in
Android.cpp file for libfastboot2

https://android-review.googlesource.com/c/platform/system/core/+/722153

Test: Build on osx
Change-Id: I6151e37581ac332e4d5cfb5e40feb3ea0e3093df
2018-08-24 10:53:04 -05:00
David Anderson
0d4277d7b3 fastbootd: Add commands for logical partitions.
This patch adds the following new commands to fastbootd:

    getvar is_logical:<partition>
    create-logical-logical-partition <partition> <size>
    delete-logical-partition <partition>
    resize-logicallogical-partition <partition> <size>

All of these commands operate on logical partitions only, and require a
properly configured "super" partition to operate.

Bug: 78793464
Test: fastboot create-logical-partition example 4096
      fastboot create-logical-partition example 4096 returns error
      fastboot getvar is-logical:example returns "yes"
      fastboot getvar partition-size:example returns "1000"
      fastboot resize-logicalpartition example 8000
      fastboot getvar partition-size:example returns "2000"
      fastboot delete-logical-partition example
      fastboot getvar is-logical:example returns error
      fastboot getvar is-logical:system_a returns "no"

Change-Id: Iff323eabcf5c559fa04c7c92574650b01803eb1f
2018-08-09 15:06:52 -07:00
David Anderson
88ef0b1f25 fastbootd: Add support for flashing logical partitions.
When flashing logical partitions, we read the "super" partition metadata
corresponding to the current slot. We then temporarily create a
device-mapper device for that partition, and immediately destroy the
device after all operations are complete. We do not mount partitions
ahead of time, or keep them mounted, because a fastboot operation may
change the layout of the logical partition table (or change which slot
is current).

Bug: 78793464
Test: fastboot flash a logical partition under "super"
Change-Id: Id2a61d3592decabeebfd283c4fd6e6cbe576a18c
2018-08-09 11:15:23 -07:00
David Anderson
12211d163e fastbootd: Enable erase and flash commands for physical partitions.
Bug: 78793464
Test: adb reboot fastboot && fastboot flashall

Change-Id: Ibe802c36f6efe20111a2315616ef34d3a027950f
2018-08-09 09:58:37 -07:00
Tao Bao
b71eedf912 fastboot: fastbootd uses libadbd.so.
The size of `fastbootd` goes down from 64088-byte to 38488-byte
(aosp_taimen-userdebug) after the change.

Bug: 78793464
Test: `m -j installclean && m -j fastbootd`. Check that
      $OUT/recovery/root/system/lib64/libadbd.so exists and
      $OUT/recovery/root/system/bin/fastbootd depends on that.
Change-Id: Ic36c98da1a0dda4e0d86e671f858c42578f53f90
2018-08-08 15:54:48 -07:00
Hridya Valsaraju
31d2c26409 fastbootd: Implement the getvar command.
This implements basic "fastboot getvar" support, including commands supported
by IBootControl.

Bug: 78793464
Test: fastboot getvar <fastboot variable>

Change-Id: Iee1a7b3f43dea46f80dcdf73c45034e2ffe4727d
2018-08-08 11:41:53 -07:00
Hridya Valsaraju
dea91b4b53 Add fastbootd.
Fastbootd is started by recovery, and communicates
over usb with the fastboot protocol.

Add additional fastboot commands to move in and out of
fastbootd. "fastboot reboot recovery" and "fastboot reboot fastboot"

Bug: 78793464
Test: fastboot reboot recovery, fastboot reboot fastboot
Change-Id: Iffb77b2d3ceefb7335c38aa9fba7bd17821484f0
2018-08-02 09:43:23 -07:00
Aaron Wisner
db511207ed Refactor libfastboot
This change creates a nice and clean API for issuing
fastboot commands without using the fastboot tool itself.

Test: fastboot tool itself (now using libfastboot2)
on sailfish, walleye, and other devices.
Test: flash bootloader bootloader.img
Test: flash radio radio.img
Test: -w update img.zip
Test: Manually getvar and reboot commands.

Bug: 111126621
Change-Id: I0022536b204ce0c5ad8329367fd522fa3c57877d
2018-07-19 15:16:47 -05:00