Commit graph

38416 commits

Author SHA1 Message Date
Elliott Hughes
0b539f3bcb Build /vendor/bin/logwrapper too.
Bug: https://issuetracker.google.com/77284669
Test: builds
Change-Id: Iaafc856f2a7441d318f7b9376caa6629e02a8e23
2018-04-11 08:28:37 -07:00
Treehugger Robot
20d2159803 Merge "Minimal changes to build fastboot as a library." 2018-04-10 14:38:50 +00:00
Elliott Hughes
11ff345979 Minimal changes to build fastboot as a library.
Bug: http://b/77809061
Test: builds
Change-Id: I0c388334d643a0a2abf0c03a29f336dc3af2f83f
2018-04-09 20:40:45 -07:00
Treehugger Robot
9e8e19a722 Merge "Fix fastboot dist to be compatible with adb" 2018-04-10 02:58:55 +00:00
Dan Willemsen
94e4dc26bb Fix fastboot dist to be compatible with adb
We've got an internal target 'static_sdk_tools' that attempts to ensure
that both adb and fastboot are distributed as artifacts. It's
essentially a loop calling dist-for-goals on
$(HOST_OUT_EXECUTABLES)/{adb,fastboot}.

The dist-for-goals macro has de-duplication checks, but both the src and
dest needs to be identical. Currently adb is using the installed
executable, fastboot is using the built executable, and static_sdk_tools
is trying to use the installed versions of both.

This causes an overriding commands for target warning, which I recently
turned into a warning.

Maybe everything should be converted over to using the built
executables, but that requires a bunch more checks everywhere, and most
places are already using the installed version.

Bug: 77775726
Test: check treehugger, fastboot is dist
Test: m BUILD_HOST_static=1 static_sdk_tools dist
Change-Id: If45fb9706fa75a812610224708b5f95f65b1f1bf
2018-04-09 14:26:23 -07:00
Treehugger Robot
7ff06150c1 Merge "base: kernel logging get pre-opened /dev/kmsg from environment" 2018-04-09 19:26:36 +00:00
Elliott Hughes
09f2af48fe Merge "Add fastboot --os-version and --os-patch-level." 2018-04-09 18:40:04 +00:00
Elliott Hughes
577e8b44b6 Add fastboot --os-version and --os-patch-level.
Also move -c to --cmdline to match the python mkbootimg tool. Remove
the short options for these rarely-used options.

Remove #if 0 cruft from <bootimg/bootimg.h>.

Bug: http://b/77340848
Test: manual testing (need to fix http://b/77809061 for unit tests)
Change-Id: Ieaa795566611bd89ba3fee39a1d9f6ad0713a587
2018-04-09 18:37:39 +00:00
Mark Salyzyn
2507a048ab base: kernel logging get pre-opened /dev/kmsg from environment
If the environment has an instance of /dev/kmsg pre-opened, pick up.
This happens when an init script has 'file w /dev/kmsg' in the
daemon's recipe.

libcutils android_get_control_file operations are open-coded to
prevent a dependency on libcutils itself.  Also check that /dev/kmsg
file descriptor is valid and open'd for write only.

Test: check to make sure init() kernel logging still works
Bug: 77541952
Bug: 77661605
Change-Id: I007553acd594ef0815d23f32f8aa2867518570ba
2018-04-09 07:19:33 -07:00
David Anderson
0289f35b83 Merge "storaged: remove unused includes" 2018-04-06 20:08:50 +00:00
Mark Salyzyn
7ee579f6ea Merge "lmkd: only mlockall() if enabled" 2018-04-06 14:21:08 +00:00
Juho Ha
c593147991 Merge "Make libbinderwrapper available in /vendor partition" 2018-04-06 07:47:10 +00:00
David Anderson
6d65f7c61a storaged: remove unused includes
Bug: 35323867
Test: N/A
Change-Id: I21c0b62765dbd27a462288c5e7577905240720f0
2018-04-05 18:55:08 -07:00
Elliott Hughes
6eb9248cb3 Merge "Support /odm and /product in "adb remount" and "adb sync"." 2018-04-06 01:16:04 +00:00
Treehugger Robot
44f78bed19 Merge "adb: Correctly drop caps when ambient capabilities are used" 2018-04-06 01:05:29 +00:00
Treehugger Robot
b69cb7071d Merge "lmkd: test: access /sys/module/lowmemorykiller/ as u:r:shell:s0" 2018-04-06 00:31:14 +00:00
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
Luis Hector Chavez
daacf4f6f3 adb: Correctly drop caps when ambient capabilities are used
This change splits the capability-dropping step of adbd into two. This
is more robust when ambient capabilities are being used, since minijail
cannot currently handle that case.

Bug: 77146512
Test: grep Cap /proc/`pidof adbd`/status
      CapInh: 0000000000000000
      CapPrm: 0000000000000000
      CapEff: 0000000000000000
      CapBnd: 00000000000000c0
      CapAmb: 0000000000000000

Change-Id: I0476a8d80f7a2497600196932542045f3bc87537
2018-04-05 15:34:05 -07: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
57e97cb7aa Support /odm and /product in "adb remount" and "adb sync".
Bug: http://b/77587036
Test: `adb remount` and `adb sync` still work on hikey
Change-Id: I960ae75099edf147f857a67d906b6bc133f817a7
2018-04-04 13:14:59 -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