Commit Graph

42416 Commits

Author SHA1 Message Date
Aaron Wisner 794fb0107b Merge "Minor fixes to fastboot_driver"
am: 8cf510ff81

Change-Id: I358512c168fbe19c164bb201cf57accdb613f1a3
2018-08-02 17:49:30 -07:00
Treehugger Robot 8cf510ff81 Merge "Minor fixes to fastboot_driver" 2018-08-03 00:41:16 +00:00
Josh Gao fbe62c5aaf Merge "adb: delete hellish hodgepodge."
am: acc0a90869

Change-Id: I966ae7f468885ca2c9d1d633ef40def3a3e8627a
2018-08-02 17:06:35 -07:00
Treehugger Robot acc0a90869 Merge "adb: delete hellish hodgepodge." 2018-08-02 23:46:50 +00:00
Elliott Hughes a55c033d92 Remove dead gglFastDivx.
Bug: http://b/112155920
Bug: https://www.viva64.com/en/b/0579/
Test: builds
Change-Id: Ia55245ce4484d5376abef16c9863015b0a0ca2b1
2018-08-02 16:18:24 -07:00
Josh Gao 2784b0a6bd Merge "adbd: when rebooting, don't close socket before pausing."
am: 9c16700e36

Change-Id: Id83a13aa4ad09de0cd9b6f63d0135b0c25132503
2018-08-02 16:13:36 -07:00
Aaron Wisner c771ae0fd4 Minor fixes to fastboot_driver
- Make RCString() static
- Add clearer error message for 0 length upload error
- Fix regex hex matching for partition-size
- Move ZLP packet checking to SparseWriteCallback()

Test: build fastboot on glinux
Change-Id: I51a040e07b9698a41f64b35a9e2baa8d575527a9
2018-08-02 17:47:38 -05:00
Treehugger Robot 9c16700e36 Merge "adbd: when rebooting, don't close socket before pausing." 2018-08-02 22:21:43 +00:00
Josh Gao 3b4de3c355 adb: delete hellish hodgepodge.
This code was unreachable, since all of the callers were calling
register_socket_transport with foo.c_str() as the serial. Lift this
assumption into the type system by switching from char* to std::string
for the argument type.

Bug: http://b/112147760
Bug: https://www.viva64.com/en/b/0579/
Test: mma
Change-Id: I5a6ee265feee6b83bc933a64d895eed39fce68e7
2018-08-02 14:51:05 -07:00
Josh Gao 6fb9461103 adbd: when rebooting, don't close socket before pausing.
An accidental side-effect of the change to unique_fd was that we
started closing the reboot service socket before pausing and waiting
for our death. This results in the client immediately returning, which
means they might get a chance to run other commands before we actually
manage to reboot.

Bug: http://b/112104037
Test: adb reboot; adb devices
Change-Id: Id61321da0c08ebd1ab57f1ce926bafd9109dd9c2
2018-08-02 12:52:26 -07:00
Tom Cherry 106e66e475 Merge "ueventd: require opt-in for modalias handling"
am: d52b17ff0a

Change-Id: Id827bf76f889ebd996954448648365d20350ca01
2018-08-02 12:32:55 -07:00
David Anderson 0bade5b848 Merge changes from topic "liblp-blocksize"
am: d0e5bcc13f

Change-Id: I95e14110705740db955800fc05ff9b1371226cc1
2018-08-02 12:31:15 -07:00
Tom Cherry 40acb379cd Move watchdogd out of init
We're moving past a world where static executables are needed,
including watchdogd, so treat this like any other executable and place
it in /system/bin.

Bug: 73660730
Test: watchdogd still runs
Change-Id: I1f7508fd55dce6e9ee72a6ab7a085011a76c0053
2018-08-02 12:25:58 -07:00
Tom Cherry d52b17ff0a Merge "ueventd: require opt-in for modalias handling" 2018-08-02 19:22:13 +00:00
Treehugger Robot d0e5bcc13f Merge changes from topic "liblp-blocksize"
* changes:
  liblp: Require block-aligned partition sizes.
  liblp: Simplify GrowPartition().
2018-08-02 19:20:58 +00:00
David Anderson 4d9c7459c4 liblp: Require block-aligned partition sizes.
DM_TABLE_LOAD will reject dm-linear entries if their size is not a
multiple of the backing device's logical block size. For example, a
partition of 10GiB+512 bytes will fail to map in device-mapper if the
logical block size is 4096 bytes. To address this, this patch adds a
few changes to liblp:

The block size given to lpmake is now recorded in LpGeometryMetadata.
The block size must be a multiple of the sector size. In addition,
partiton sizes are now aligned to the block size, and the super
partition must have enough free space to allocate at least one block (in
addition to storing metadata).

GrowPartition now has multiple checks that the block-size invariant is not
violated, to ensure that no invalid partition tables will be created.

Bug: 79173901
Test: liblp_test gtest
Change-Id: I484aac1f9b90ebd92dc1c89ce1e09cd89bbb441e
2018-08-02 10:33:41 -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
David Anderson de1daa72aa liblp: Simplify GrowPartition().
The partition resize algorithm duplicates a lot of logic because it
handles the final free interval separately from other free intervals.
This is unnecessary and makes it harder to change the actual algorithm.

This change makes GrowPartition() treat the final free space region the
same as free gaps in between partitions. It does this by converting the
extent list into a gap list, and then adds a final gap for the remainder
of the free space. The resize function no longer has to treat the end of
the disk separately.

This patch does not change the way partitions are allocated, it is
purely a refactoring.

Bug: 79173901
Test: liblp_test gtest
Change-Id: I4780f20b23fe021eac62de874b061857712c04fe
2018-08-02 09:14:47 -07:00
David Anderson 432a51dcdc Merge "liblp: Add a ResizePartition helper to MetadataBuilder."
am: ddcee93c01

Change-Id: I187c1aba212a754d282f3ec7a65f3fda549f6e28
2018-08-02 09:13:02 -07:00
Treehugger Robot ddcee93c01 Merge "liblp: Add a ResizePartition helper to MetadataBuilder." 2018-08-02 16:01:24 +00:00
Suren Baghdasaryan 8d56d5f965 Merge "liblog: Add functions to reset log context"
am: 2d5c1b56d2

Change-Id: I5b152fe9b6647f0e36b9c4e604bfa053778c69d2
2018-08-01 19:55:13 -07:00
Treehugger Robot 2d5c1b56d2 Merge "liblog: Add functions to reset log context" 2018-08-02 02:45:55 +00:00
Suren Baghdasaryan bb20b9e6b8 liblog: Add functions to reset log context
Add android_log_parser_reset and android_log_reset to reset reader/writer
log context. This allows to generate multiple log messages of the same
format without context reallocation.

Change-Id: Icb0f15855378aa4e66fc671ffefd15d9df6fee1e
2018-08-02 00:55:01 +00:00
David Anderson 2e755e38af liblp: Add a ResizePartition helper to MetadataBuilder.
This change is to assist with implementing the fastbootd "resize-partition"
command. The GrowPartition and ShrinkPartition functions are now
private.

Bug: 78793464
Test: N/A
Change-Id: Ic66a3052359e2558663272ff6e014704206b197e
2018-08-01 17:41:29 -07:00
Luis Hector Chavez d4ee791365 Merge "fs_mgr: Always mount tmpfs with MS_NOEXEC"
am: 8f2a34a89b

Change-Id: I80ac903329f24756ef8a3d9bade11f446b2e1c31
2018-08-01 16:16:27 -07:00
Treehugger Robot 8f2a34a89b Merge "fs_mgr: Always mount tmpfs with MS_NOEXEC" 2018-08-01 22:41:56 +00:00
Tom Cherry 780d80b5a6 Merge "init: run fsck for early mount partitions"
am: 6e05552e35

Change-Id: I6b44584616557ef3c58039eff6ce7eaf3c2d7623
2018-08-01 14:11:19 -07:00
Tom Cherry 6e05552e35 Merge "init: run fsck for early mount partitions" 2018-08-01 21:02:35 +00:00
Hridya Valsaraju cb10dca496 Merge "Flash super partition with fastboot flashall"
am: 10601fd512

Change-Id: Ibd1b1ba6ccd16ff82c7c050fb6bdf0121e851268
2018-08-01 13:57:11 -07:00
Elliott Hughes 51c5ef24d6 Merge "Move back to BSD grep, and make it available for recovery too."
am: af7e4567a3

Change-Id: I2dc4b70c11a74c436cfa9a4651fc3251ccc6790c
2018-08-01 13:49:23 -07:00
Treehugger Robot 10601fd512 Merge "Flash super partition with fastboot flashall" 2018-08-01 20:47:53 +00:00
Tom Cherry 457e28f129 ueventd: require opt-in for modalias handling
Some devices have modules.alias and modules.dep for modprobe and other
purposes but do not want to opt into ueventd auto loading their
modules.  Therefore we add a flag that can be added to ueventd
configuration files to opt into this behavior.

Bug: 111916071
Bug: 112048758
Test: check that modules are loaded with this opt-in
Test: check that modules are not loaded without this opt-in
Change-Id: Ifb281b273059b4671eea1ca5bc726c9e79f3adfb
2018-08-01 13:29:05 -07:00
Elliott Hughes af7e4567a3 Merge "Move back to BSD grep, and make it available for recovery too." 2018-08-01 20:28:27 +00:00
Hridya Valsaraju 94943ee331 Flash super partition with fastboot flashall
Bug: 111763923
Test: fastboot flashall
Change-Id: I9b89825bac00d1237972a61715da05f933ac35ce
2018-08-01 18:30:36 +00:00
Elliott Hughes 8100d05778 Move back to BSD grep, and make it available for recovery too.
Bug: http://b/111849261
Bug: https://bugs.exim.org/show_bug.cgi?id=2294
Test: manual
Change-Id: Ia4f67b9f803c4f039d170f6d015a1bd2bb0ef23d
2018-08-01 10:35:46 -07:00
Tomasz Wasilczyk c9c3128ac5 Merge "Remove unused logging symbols."
am: 081b710b2e

Change-Id: I580bffd9688446839d30bcbd225de59885daf7f2
2018-08-01 09:44:49 -07:00
Tomasz Wasilczyk 081b710b2e Merge "Remove unused logging symbols." 2018-08-01 16:37:38 +00:00
Spencer Low d9de068a8a Merge "adb: win32: fix Unicode console output"
am: 52126a414b

Change-Id: I7b4cdacb43d8a1ef03572caa315c72afcb4b4122
2018-07-31 22:35:44 -07:00
Treehugger Robot 52126a414b Merge "adb: win32: fix Unicode console output" 2018-08-01 05:25:09 +00:00
Josh Gao eded388d64 Merge changes Ib55d304d,I6fa078ea,I18e9213d,Ife58f0aa,Iccc55557
am: 24f9fc7fee

Change-Id: Ie8289b0df453c3326a12ae8959724ece738024f3
2018-07-31 21:23:58 -07:00
Treehugger Robot 24f9fc7fee Merge changes Ib55d304d,I6fa078ea,I18e9213d,Ife58f0aa,Iccc55557
* changes:
  adb: disable ReconnectHandler in adbd.
  adb: fix error message for `adb {forward,reverse}`
  adb: more immediately try to reconnect connections.
  adb: don't pass time_point::max to condition_variable::wait_until.
  adb: move list-forward, kill-forward back into handle_forward_request.
2018-08-01 04:19:16 +00:00
Dario Freni 586282a771 Merge "Add product-services.img for `fastboot flashall`."
am: 8b8d7d67f2

Change-Id: I698a75c06e6041ddf403aba2ae5e894308bce2c3
2018-07-31 19:15:00 -07:00
Treehugger Robot 8b8d7d67f2 Merge "Add product-services.img for `fastboot flashall`." 2018-08-01 02:00:40 +00:00
Josh Gao def91c0abf adb: disable ReconnectHandler in adbd.
Previously, when a TCP connection was disconnected from adbd, we were
registering it with ReconnectHandler, which led to the transport
sticking around after the socket was closed. Due to the naming of
TCP transports in adbd (host-<fd number>), this results in incoming
connections being immediately closed if their file descriptor number
ends up being the same as a TCP transport that had previously
disconnected.

Guard all of the reconnect logic with ADB_HOST, to fix this.

Bug: http://b/112054041
Test: while true; do adb connect <device>; adb connect <device>; adb shell true; done
Change-Id: Ib55d304d7e07d6d744e8321d34671bb6d4b91afe
2018-07-31 18:28:32 -07:00
Tomasz Wasilczyk 3b70eedfa0 Remove unused logging symbols.
Bug: 35361699
Test: flash sailfish, it boots
Change-Id: Ie545145789faa299e1228b6c91566e0767f7ea79
2018-07-31 16:33:38 -07:00
Dario Freni c7ea1afe90 Add product-services.img for `fastboot flashall`.
This CL is largely and adaptation of
Ifd119650dd3316508870df0dfc770099e95ae1d1

Bug: 80741439
Test: Successfully built product-services.img with one module in it, and
flashed on device. Also successfully built image with
/system/product-services and no dedicated /product-services partition.

Change-Id: I204a831e052d018018ab124d70ad1ff1610ee007
2018-08-01 00:08:52 +01:00
Josh Gao 258d4a91c9 adb: fix error message for `adb {forward,reverse}`
Test: `adb reverse`
Change-Id: I6fa078ea7a0e019df5c6309df99ffdf2a3219194
2018-07-31 15:57:52 -07:00
Josh Gao e445a6d8a2 adb: more immediately try to reconnect connections.
Most disconnects we're likely to encounter are cases where either we
notice immediately and can start reconnecting almost immediately (adbd
restarting because of `adb root`, etc.), or where we won't notice for a
while anyway, so a 10 second sleep is somewhat meaningless.

Test: adb root; time adb wait-for-device shell
Change-Id: I18e9213dc4e84d735e9240118a368dcb38f21c78
2018-07-31 15:57:49 -07:00
Josh Gao 95af641bd6 adb: don't pass time_point::max to condition_variable::wait_until.
libstdc++ implements wait_until by calculating the offset between its
default clock and the clock that it's given by calling now() on each
and subtracting, and then adds that offset to the time_point argument.
When time_point::max is used, this overflows, resulting in the
reconnection thread spinning.

Test: wine adb.exe server nodaemon
Change-Id: Ife58f0aad14bc44c0804483d3ff2351c28b3d576
2018-07-31 15:56:31 -07:00
Josh Gao 1906243017 adb: move list-forward, kill-forward back into handle_forward_request.
The daemon-side reverse functions depended on handle_forward_request:
move them back instead of duplicating the logic we had in
handle_host_request. Accomplish what we originally wanted to do in this
change by changing the transport argument of handle_forward_request to a
std::function that acquires a transport, either via
acquire_one_transport or immediately returning a value that we already
have.

As a side effect, fix a bug where we would emit spurious errors for host
service requests.

Bug: http://b/112009742
Test: echo "001chost:connect:127.0.0.1:5555" | nc localhost 5037
Test: python test_device.py
Test: python test_adb.py
Change-Id: Iccc555575df6dbd7de10382854c4ea2c6f4beeaa
2018-07-31 15:36:55 -07:00