Commit graph

38396 commits

Author SHA1 Message Date
Juho Ha
fea13b8501 Make libbinderwrapper available in /vendor partition
Some modules in /vendor partition need to use this
library.

Bug: 77626538
Test: Build docs, test_suites_arm64, test_suites_x86_64
      in Android Things branch

Change-Id: Iec50a4dd9af7cd3b426e5d34d0dd1bf923ece627
2018-04-06 08:41:21 +09:00
Elliott Hughes
bd7b2dcaca Merge "Remove the "needs_erase" workaround." 2018-04-05 23:23:17 +00:00
Treehugger Robot
fa1f191ad9 Merge "adbd: configure jemalloc to not immediately purge." 2018-04-05 22:14:05 +00:00
Josh Gao
218f766e21 adbd: configure jemalloc to not immediately purge.
Profiling of adb_benchmark revealed that something like half of the CPU
time was being spent in malloc and free, which was odd because the
benchmark repeatedly mallocs and frees allocations of the same size. It
turns out that our default configuration of jemalloc will purge after
every free. Configure jemalloc to not do this, for gains of over 100%
on adb_benchmark, and up to 25% (on walleye USB3) in real-life.

Test: adb_benchmark
Change-Id: I602dd1645c3d21709c7f6a78903511ce4d576558
2018-04-05 15:13:30 -07:00
Treehugger Robot
5e5509e8fc Merge "Allow vendor-init-actionable for wlan.driver.status and init.svc.surfaceflinger" 2018-04-05 21:25:02 +00:00
Elliott Hughes
59efd440eb Remove the "needs_erase" workaround.
This workaround shouldn't be necessary now we're using mke2fs.

Bug: http://b/25429933
Test: `fastboot -w flashall`
Change-Id: I577ad445a02a448102fb49674360a732aa3d153c
2018-04-05 14:24:00 -07:00
Tom Cherry
09daaa4991 Merge "Remove vendor Wifi and BT entries from fs_config.cpp" 2018-04-05 17:39:53 +00:00
Jaekyun Seok
167ec7f1d2 Allow vendor-init-actionable for wlan.driver.status and init.svc.surfaceflinger
They are being used as action triggers in some devices including Pixels.
So vendor-init-actionable should be allowed for them.

Bug: 74266614
Test: building succeeded and tested on a Pixel with
PRODUCT_COMPATIBLE_PROPERTY=true

Change-Id: I713c5c1a50053f8d64e1cecd1f7ab5dc18201da1
2018-04-05 21:20:59 +09:00
Treehugger Robot
243be559a1 Merge "Remove emergency from the fastboot reboot completions." 2018-04-05 02:36:19 +00:00
Treehugger Robot
3810f0076b Merge "Add newer partitions to the fastboot flash completions." 2018-04-05 02:24:34 +00:00
Treehugger Robot
8daf742900 Merge "Revert "Revert "adb: add transport benchmark.""" 2018-04-05 01:49:38 +00:00
Treehugger Robot
52cd10fed6 Merge "Consistently use - rather than _ in fastboot option tab completion." 2018-04-04 23:11:47 +00:00
Elliott Hughes
eace8e2e53 Merge changes I50e27f46,I0b7cd983,I3639fdee
* changes:
  Remove lock_bootloader/unlock_bootloader.
  Remove `reboot emergency`.
  Clean up fastboot help:
2018-04-04 22:57:17 +00:00
Josh Gao
9c59649e0b Revert "Revert "adb: add transport benchmark.""
This reverts commit 2ef56a1174.

host_supported is broken in cc_benchmark on Mac, but we probably don't
actually too much about the host benchmarks, so just delete the line.

Bug: http://b/77585931
Test: treehugger
Change-Id: I8898b4037a3faf8e8dee2a99498a6f84e642b92b
2018-04-04 14:26:39 -07:00
Treehugger Robot
e21b764eb6 Merge "make_f2fs: specify sector size for target image size and missing options" 2018-04-04 21:26:11 +00:00
Elliott Hughes
bd1e2dd67d Remove emergency from the fastboot reboot completions.
Bug: N/A
Test: N/A
Change-Id: Ia22f51061c845ea19a697e86ac109c02960251fa
2018-04-04 13:51:54 -07:00
Elliott Hughes
f0b9c7ccd2 Add newer partitions to the fastboot flash completions.
Bug: N/A
Test: `fastboot flash \t`
Change-Id: I1f33c90b8c26b18b9984102ac084b8865d72ff06
2018-04-04 13:51:24 -07:00
Elliott Hughes
b2b90154a8 Consistently use - rather than _ in fastboot option tab completion.
(fastboot actually supports both, but only barbarians use underscore.)

Bug: N/A
Test: `fastboot \t`
Change-Id: I52166d8b0e91285d16bcf65ad51de20f57a00ad1
2018-04-04 13:43:56 -07:00
Elliott Hughes
2e9b779d42 Remove lock_bootloader/unlock_bootloader.
These were implemented on Nexus 5X/6P, but the infrastructure for the
challenge-response system isn't available.

Bug: N/A
Test: N/A
Change-Id: I50e27f469ea7c668de1af314f83f5171376ccda4
2018-04-04 13:36:44 -07:00
Elliott Hughes
2cb9075b63 Remove reboot emergency.
This isn't in the bootloader requirements doc, and the internet implies
that you actually need to use `fastboot oem edl` or `fastboot oem
reboot-edl` anyway.

Bug: N/A
Test: N/A
Change-Id: I0b7cd9839fbd06fc104d029e92d5986dc3c6eda3
2018-04-04 13:31:30 -07:00
Elliott Hughes
9c8c03896e Merge "Move adb/fastboot bash completion into adb/fastboot." 2018-04-04 19:44:37 +00:00
Christopher Ferris
c692ff9043 Merge "Add a MemoryOfflineBuffer object." 2018-04-04 17:39:13 +00:00
Jaegeuk Kim
e2596bfed5 make_f2fs: specify sector size for target image size and missing options
The total sectors that we want to format is used in different meanings from
various users. This notifies its size based on 4096 bytes explicitly.

Bug: 76407663
Change-Id: I4e00f2e2289c1381f0238d2a4acb606a0ab551a9
Merged-In: I4e00f2e2289c1381f0238d2a4acb606a0ab551a9
Reported-by: katao@xiaomi.com
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-04-04 09:24:24 -07:00
Elliott Hughes
fbfa0e8781 Move adb/fastboot bash completion into adb/fastboot.
Bug: http://b/74443706
Test: bash completion still works.
Change-Id: I9da3a0ae748a202407652f513c990e9d05f8b01a
2018-04-04 08:33:33 -07:00
David Brazdil
3876e37319 Merge "Revert "adb: add transport benchmark."" 2018-04-04 11:42:39 +00:00
David Brazdil
2ef56a1174 Revert "adb: add transport benchmark."
This reverts commit d78f59ca53.

Reason for revert: Breaks aosp-master renderscript and sdk_mac:
  error: system/core/adb/Android.bp:199:19: unrecognized property "host_supported"

Change-Id: Ifd75921dcdf5dce57f98833a913540914984b293
2018-04-04 10:32:08 +00:00
Josh Gao
3f6ef0d2d2 Merge "adb: add transport benchmark." 2018-04-04 07:02:07 +00:00
Josh Gao
60c6023902 Merge "adb: don't abort when connecting to the same address twice." 2018-04-04 07:02:00 +00:00
Christopher Ferris
6633b0ca09 Add a MemoryOfflineBuffer object.
Use this for offline stack data so that it's not necessary to
copy any data around.

Add unit tests for the new object.

Bug: 77258731
Bug: 74354410

Test: Ran libunwindstack/libbacktrace unit tests.
Change-Id: I9b0f25d9520c96e64aedef5f295423c60ddb3488
2018-04-03 18:37:52 -07:00
Josh Gao
d78f59ca53 adb: add transport benchmark.
Add some basic benchmarks for the underlying transport.

Test: adb_benchmark
Change-Id: I6475a66eb5a43a241c907046c23fea68263db945
2018-04-03 16:54:51 -07:00
Josh Gao
c251ec55d3 adb: don't abort when connecting to the same address twice.
When connecting to an address, we construct a transport first, and then
check whether we've already connected to that address. The consequent
destruction of the BlockingConnectionAdapter attempts to join threads
that haven't been started, which aborts.

Make it safe to destruct a BlockingConnectionAdapter without calling
Start on it first, to solve this.

Bug: http://b/69137547
Test: nc -l 12345 & (adb connect localhost:12345; adb connect localhost:12345)
Test: python test_adb.py
Change-Id: I6cb968a62dbac6332907e06575893d764905ee62
2018-04-03 13:58:21 -07:00
Elliott Hughes
b76188ffc1 Clean up fastboot help:
After:

  usage: fastboot [OPTION...] COMMAND...

  flashing:
   update ZIP                 Flash all partitions from an update.zip package.
   flashall                   Flash all partitions from $ANDROID_PRODUCT_OUT.
                              On A/B devices, flashed slot is set as active.
                              Secondary images may be flashed to inactive slot.
   flash PARTITION [FILENAME]
                              Flash given partition only.

  basics:
   devices [-l]               List devices in bootloader (-l: with device paths).
   getvar NAME                Display given bootloader variable.
   reboot [bootloader]        Reboot device.

  locking/unlocking:
   flashing lock|unlock       Lock/unlock partitions for flashing
   flashing lock_critical|unlock_critical
                              Lock/unlock 'critical' bootloader partitions.
   flashing get_unlock_ability
                              Check whether unlocking is allowed (1) or not(0).

  advanced:
   erase PARTITION            Erase a flash partition.
   format[:FS_TYPE[:SIZE]] PARTITION
                              Format a flash partition.
   set_active SLOT            Set the active slot.
   oem [COMMAND...]           Execute OEM-specific command.

  boot image:
   boot KERNEL [RAMDISK [SECOND]]
                              Download and boot kernel from RAM.
   flash:raw PARTITION KERNEL [RAMDISK [SECOND]]
                              Create boot image and flash it.
   -c CMDLINE                 Override kernel command line.
   --base ADDRESS             Set kernel base address (default: 0x10000000).
   --kernel-offset            Set kernel offset (default: 0x00008000).
   --ramdisk-offset           Set ramdisk offset (default: 0x01000000).
   --tags-offset              Set tags offset (default: 0x00000100).
   --page-size BYTES          Set flash page size (default: 2048).
   --header-version VERSION   Set boot image header version.

  Android Things:
   stage IN_FILE              Sends given file to stage for the next command.
   get_staged OUT_FILE        Writes data staged by the last command to a file.

  options:
   -w                         Wipe userdata.
   -u                         Do not erase partition first when formatting.
   -s SERIAL                  Specify a USB device.
   -s tcp|udp:HOST[:PORT]     Specify a network device.
   -i VENDOR_ID               Filter devices by USB vendor id.
   -S SIZE[K|M|G]             Use sparse files above this limit (0 to disable).
   --slot SLOT                Use SLOT; 'all' for both slots, 'other' for
                              non-current slot (default: current active slot).
   --set-active[=SLOT]        Sets the active slot before rebooting.
   --skip-secondary           Don't flash secondary slots in flashall/update.
   --skip-reboot              Don't reboot device after flashing.
   --disable-verity           Sets disable-verity when flashing vbmeta.
   --disable-verification     Sets disable-verification when flashing vbmeta.
   --wipe-and-use-fbe         Enable file-based encryption, wiping userdata.
   --unbuffered               Don't buffer input or output.
   --verbose, -v              Verbose output.
   --version                  Display version.
   --help, -h                 Show this message.

Bug: N/A
Test: `fastboot --help`

Change-Id: I3639fdee68de544f12e75004ccbb03b8386e64ed
2018-04-03 13:30:18 -07:00
Treehugger Robot
a10d40e2b2 Merge "Add a header-version argument to fastboot" 2018-04-03 18:33:57 +00:00
Josh Gao
b9b967e2fc Merge changes Iff1ec14b,I32123c51,I517dbcba,Ic215c7fe
* changes:
  adb: try harder to fill our test sockets.
  adb: don't set has_write_error on success.
  adb: move ownership of the fdevent thread into FdeventTest.
  adb: guarantee that fdevent_run_on_main_thread happens last.
2018-04-03 01:44:14 +00:00
Elliott Hughes
be5332d236 Merge "Improve fastboot verbose output." 2018-04-03 00:58:33 +00:00
Hridya Valsaraju
7d824136ae Add a header-version argument to fastboot
The argument would set the boot header
version for flash:raw and boot
commands when they are used for boot
image creation.

Bug: 77154616
Test: Dumped the created boot image and checked
the header version using unpack_bootimg

Change-Id: I2c458996817615f4351db102b4234984108d47c0
Merged-In: I2c458996817615f4351db102b4234984108d47c0
(cherry picked from commit 88de5556ec)
2018-04-02 16:00:59 -07:00
Elliott Hughes
855cdf82f5 Improve fastboot verbose output.
Move some verbose messages so they're only output with -v.

Remove some misleading verbose messages altogether (such as "wiping
userdata...").

Properly log all the commands sent and responses received. Example:

  $ fastboot -v flashall
  ...
  Sending sparse 'system' 2/2 (443712 KB)
  fastboot: verbose: sending command "download:1b1500d0"
  fastboot: verbose: received DATA 1b1500d0
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (165596160 bytes)
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (267762688 bytes)
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (20978688 bytes)
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (7168 bytes)
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (3072 bytes)
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (3072 bytes)
  fastboot: verbose: sending data (1024 bytes)
  fastboot: verbose: sending data (3072 bytes)
  fastboot: verbose: sending data (208 bytes)
  fastboot: verbose: received OKAY
  OKAY [ 13.871s]
  Writing sparse 'system' 2/2
  fastboot: verbose: sending command "flash:system"
  fastboot: verbose: received OKAY
  OKAY [  3.228s]
  Rebooting
  fastboot: verbose: sending command "reboot"
  fastboot: verbose: received OKAY

  Finished. Total time: 36.939s

Bug: http://b/30953083
Bug: http://b/74444116
Test: `fastboot -v flashall`
Change-Id: I2cca198daa062fd1fb732218343263803b111e38
2018-04-02 14:28:18 -07:00
Josh Gao
7651eb9ef7 adb: try harder to fill our test sockets.
On platforms that implement sockets via underlying sockets (e.g. Wine),
a socket can appear to be full, and then become available for writes
again without read being called on the other end. Add a sleep after
each write to give the underlying implementation time to flush.

This doesn't help us if the buffer size is smaller than MAX_PAYLOAD,
but at least in the case of Wine, that doesn't seem to be the case.

Test: adb_test
Test: wine adb_test.exe
Change-Id: Iff1ec14bbf318b9742ec7e2fb72e34e3d6bbe6ad
2018-04-02 14:18:50 -07:00
Josh Gao
954e1280d7 adb: don't set has_write_error on success.
Whoops.

Test: adb_test
Change-Id: I32123c51446a22d4423eef0753b0a0b00b500a90
2018-04-02 14:18:27 -07:00
Elliott Hughes
194e27bf5e Merge "Modernize fastboot output format." 2018-04-02 20:47:53 +00:00
Elliott Hughes
f238d8751b Modernize fastboot output format.
After:

  --------------------------------------------
  Bootloader Version...: 0.5
  Baseband Version.....: 0.5
  Serial Number........: serialv1.0
  --------------------------------------------
  Checking product                                   OKAY [  0.032s]
  Sending 'boot' (9962 KB)                           OKAY [  0.350s]
  Writing 'boot'                                     OKAY [  0.143s]
  Sending 'dts' (14 KB)                              OKAY [  0.068s]
  Writing 'dts'                                      OKAY [  0.048s]
  Sending sparse 'system' 1/2 (460796 KB)            OKAY [ 14.383s]
  Writing sparse 'system' 1/2                        OKAY [  4.138s]
  Sending sparse 'system' 2/2 (443712 KB)            OKAY [ 13.871s]
  Writing sparse 'system' 2/2                        OKAY [  3.246s]
  Rebooting
  Finished. Total time: 36.962s

For a failure:

  extracting android-info.txt (0 MB) to RAM...
  --------------------------------------------
  Bootloader Version...: 0.5
  Baseband Version.....: 0.5
  Serial Number........: serialv1.0
  --------------------------------------------
  Checking product                                   FAILED

  Device product is 'hikey960'.
  Update requires 'marlin' or 'sailfish'.

  fastboot: error: requirements not met!

This change also adds a -v/--verbose flag, but doesn't make much use of
it yet (http://b/30953083 will need it).

Bug: N/A
Test: manual
Change-Id: I7d19f5775859ffad5f3be5707b37dcb6e180917f
2018-04-02 11:01:48 -07:00
Tao Bao
b7ba61ffc5 Merge "Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr." 2018-03-31 17:03:25 +00:00
Jayant Chowdhary
478c7c1eaf Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr.
Bug: 74763691

Test: m -j libmkbootimg creates libmkbootimg.so.lsdump.

Test: make -j64

Change-Id: I8d716c560467aaf090f4f7ee9cfbc53a9405f05d
(cherry picked from commit 4cc755dce5)
2018-03-31 07:13:33 -07:00
Josh Gao
7ab55713cc adb: move ownership of the fdevent thread into FdeventTest.
Previously, each of the tests was spawning the fdevent thread manually,
in order to be able to set up listeners and such before running
fdevent_loop. Now that we have a way to run arbitrary code on the
fdevent thread, switch to having a generic fdevent thread and running
setup code via fdevent_run_on_main_thread.

Test: adb_test
Test: wine adb_test.exe
Change-Id: I517dbcbad31067b45087d9fbed67a75b75a75aec
2018-03-30 14:57:09 -07:00
Josh Gao
fa30bf3932 adb: guarantee that fdevent_run_on_main_thread happens last.
Make it so that we handle run_on_main_thread calls after regular socket
events, so that we can use it as a way to ensure we've processed all
pending socket events.

Test: adb_test
Test: wine adb_test.exe
Change-Id: Ic215c7fed19a8e1699e759970658b3775aa08c45
2018-03-30 14:38:25 -07:00
Josh Gao
e6ae06e687 Merge changes I06ccca30,Iee86b058
* changes:
  adb: fix FdeventTest.invalid_fd on Windows.
  adb: extract the sleep in socket_test to its own function.
2018-03-30 21:38:16 +00:00
Treehugger Robot
14da8f607f Merge "Support Speck encryption." 2018-03-30 20:51:14 +00:00
Paul Crowley
e640bc1b88 Support Speck encryption.
Test: Modified Pixel to support and use Speck encryption, booted.
Bug: 77227248
Change-Id: I6ec272db5e4f16e9dd4f759203c14ad2a8772cd1
Merged-In: I6ec272db5e4f16e9dd4f759203c14ad2a8772cd1
2018-03-30 10:18:46 -07:00
Logan Chien
602af1c488 Merge "Allow VNDK-SP extensions to use vendor lib" 2018-03-30 07:14:51 +00:00
Josh Gao
05fb45be17 adb: fix FdeventTest.invalid_fd on Windows.
Bail out immediately in our poll emulation if we have any invalid file
descriptors, instead of actually calling WSAPoll (which might block
forever).

Test: wine adb_test.exe
Change-Id: I06ccca305783ee7a1721b1585ddf73e022bd02d7
2018-03-29 14:24:03 -07:00