Commit Graph

58848 Commits

Author SHA1 Message Date
Howard Ro b51a1b7335 Merge "Libstatspull: decrease default pull timeout to 2s" into rvc-dev am: 413668bcf3
Change-Id: I3f85933303129256e3a089b88ef03fff357f6415
2020-05-30 10:18:15 +00:00
Howard Ro 413668bcf3 Merge "Libstatspull: decrease default pull timeout to 2s" into rvc-dev 2020-05-30 09:59:13 +00:00
Tej Singh 00ffb6c77e Libstatspull: decrease default pull timeout to 2s
Decrease the default pull timeout to 2 seconds.

Test: atest LibStatsPullTests
Test: atest libstatspull_test
Bug: 154056912
Change-Id: I8f7660de64e8c74a8c7ce7d252369c0456895e3b
2020-05-29 23:37:21 +00:00
David Anderson 78c6f365cd libdm: Fallback to legacy ueventd logic if running on an older system. am: b2cc8cb2d7
Change-Id: I5050d859e12d3ea85c5bbefaa42f76d3b1ec897a
2020-05-29 22:25:52 +00:00
David Anderson b2cc8cb2d7 libdm: Fallback to legacy ueventd logic if running on an older system.
When delivering single-stage, non-AB OTAs, the updater binary is built
on a newer OS than recovery is compiled with. libdm relies on newer ueventd
behavior which therefore breaks this model. As a workaround, we allow
libdm to fallback to the old ueventd logic if the following conditions
hold true: (1) we're in recovery, (2) the device is not an AB device,
and (3) the release is <= 10.

Since the old ueventd behavior can lead to races in libdm, this fallback
should stay as narrow as possible.

Bug: 156536673
Bug: 155202260
Test: manual test
Change-Id: I7f9da49e4ba8dfe165e0923d9918827d51d090cd
2020-05-29 18:13:48 +00:00
Martijn Coenen 752ed87cc9 Merge changes from topic "fusectl" into rvc-dev am: 6030f2f016
Change-Id: Id351b58f26ed663e79f891a376e03f0e52023805
2020-05-29 14:55:10 +00:00
Martijn Coenen 6030f2f016 Merge changes from topic "fusectl" into rvc-dev
* changes:
  Abort FUSE filesystems during shutdown.
  Abort FUSE filesystem when Zygote restarts.
  Mount fusectl filesystem.
2020-05-29 14:41:20 +00:00
Christopher Ferris 736e7b4afa Fail explicitly on length overflow. am: bff51b88aa
Change-Id: I349be60206e9c1f673d845d07b76b4540d25c2f5
2020-05-29 01:01:59 +00:00
Christopher Ferris bff51b88aa Fail explicitly on length overflow.
Instead of aborting when FileMap::create detects an overflow, detect the
overflow directly and fail the call.

Bug: 156997193

Test: Ran unit tests, including new unit test that aborted before.
Merged-In: Ie49975b8949fd12bbde14346ec9bbb774ef88a51
Change-Id: Ie49975b8949fd12bbde14346ec9bbb774ef88a51
(cherry picked from commit 68604b9c29)
2020-05-28 15:46:51 -07:00
TreeHugger Robot 79c2098ab9 Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev am: 87ee2378de
Change-Id: I56e3d250550cf66a92a69a63c87d89ce4f448c68
2020-05-28 17:29:59 +00:00
Martijn Coenen 860ba64393 Abort FUSE filesystems during shutdown.
To ensure we can shutdown cleanly, and don't hang an outstanding
requests to a FUSE host daemon that has already exited.

Bug: 153411204
Test: inspect logs during shutdown
Change-Id: I8e6479bd54dbc1fc85b087617aa6b16be9f15a3b
2020-05-28 19:11:07 +02:00
Martijn Coenen dd0440f4e5 Abort FUSE filesystem when Zygote restarts.
The FUSE filesystem is implemented by a Zygote child. If Zygote dies,
all of its children die along with it, including the FUSE daemon. The
FUSE filesystem is cleaned up automatically whenever the /dev/fuse file
descriptor of the FUSE daemon is closed. However, due to the way the
binder driver holds on to the 'struct files' of processes in the kernel,
the closing of FDs of all of Zygote's children is serialized.

That in turn means that, if a process has a file with dirty pages on
FUSE, and that FD is closed *before* the FUSE FD, the FUSE kernel driver
will happily issue a request to the FUSE daemon to serve that request.
But since the FUSE userspace daemon is already dead, it will never get
served. And because the closing of all FDs is serialized, we will never
close the FUSE fd to unblock this request.

Solve this particular case by manually aborting the FUSE filesystem when
Zygote restarts. Because we now explicitly close the FUSE fd, the FUSE
filesystem will be cleaned up, all outstanding requests to it will be
cancelled, and new ones will be skipped.

Bug: 153411204
Test: kill zygote manually
Change-Id: I2cb6c1a03cc1a932461ff33558894a428ff35180
2020-05-28 19:11:01 +02:00
TreeHugger Robot 87ee2378de Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" into rvc-dev 2020-05-28 17:05:49 +00:00
Martijn Coenen 959dcf106d Mount fusectl filesystem.
To allow us to manually abort FUSE filesystems.

Bug: 153411204
Test: inspect /sys/fs/fuse/
Change-Id: I150597635d62932aa70ee696b4d978c822e6ea8d
2020-05-28 16:25:45 +02:00
Alistair Delva c631f94c77 Add ro.boot.fstab_suffix and modify mount_all to use it
Currently the ReadDefaultFstab function, which calls GetFstabPath,
makes some assumptions about what the fstab will be called and where
it is located. This is being used by vold to set up userdata encryption
and for gsid, and is even used in the default boot control HAL, so it
has become quite baked.

The original way for a board to specify things to mount was to use the
"mount_all /path/to/fstab" command in init.rc. However, due to the
above functionality, the path after mount_all is no longer very useful,
as it cannot differ from the inferred path, or userdata encryption and
other features will be broken.

On Cuttlefish, we have an interest in being able to test alternative
userdata configurations (ext4 vs f2fs, encryption on/off, etc.) and
currently the only way to achieve this is to either a) modify the
ro.hardware or ro.hardware.platform properties, which breaks a bunch
of things like default HAL filenames, or regenerate our odm.img or
vendor.img filesystems. We can't simply install another fstab and
point to it with "mount_all".

This change allows the fstab path to be omitted from "mount_all", and
adds another property which overrides the existing checks for
fstab.${ro.hardware} and fstab.${ro.hardware.platform}. Specifying
${ro.boot.fstab_suffix} will cause fstab.${ro.boot.fstab_suffix}
to be checked first.

Bug: 142424832
Test: booted cuttlefish with 'mount_all ${ro.hardware} --late'
Test: booted cuttlefish with 'mount_all --late'
Test: booted cuttlefish with 'mount_all --late' and fstab_suffix=f2fs
Test: partially booted cuttlefish with 'mount_all ${ro.hardware}'
Test: partially booted cuttlefish with 'mount_all'
Change-Id: I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c
Merged-In: I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c
2020-05-28 00:07:05 +00:00
Chen Zhu db08cf228d Merge "Add test config to libstatspull_test and libstatssocket_test" into rvc-dev am: f584432c90
Change-Id: I6a0a0058fb97d97b6896bef1e0c3a6b0ac070f5b
2020-05-27 07:54:27 +00:00
Chen Zhu f584432c90 Merge "Add test config to libstatspull_test and libstatssocket_test" into rvc-dev 2020-05-27 07:47:03 +00:00
TreeHugger Robot 5c79d3cca4 Merge changes I1118f2e2,I6c039b32 into rvc-dev am: d4c8a20d4b
Change-Id: I583e3c8a22de90f3fb0d42d547271cca6dd70633
2020-05-27 05:47:36 +00:00
TreeHugger Robot d4c8a20d4b Merge changes I1118f2e2,I6c039b32 into rvc-dev
* changes:
  adb: only submit USB writes on the worker thread.
  adbd: don't use libc++_static.
2020-05-27 05:15:55 +00:00
Paul Crowley de8f3470b0 Merge "emmc_optimized means stable_inodes" into rvc-dev am: c05e7c0236
Change-Id: Id0a268cce7f7081be2decd8a1cd9a7a343f13373
2020-05-23 22:38:07 +00:00
Paul Crowley c05e7c0236 Merge "emmc_optimized means stable_inodes" into rvc-dev 2020-05-23 22:20:06 +00:00
Paul Crowley e96d6a9067 emmc_optimized means stable_inodes
If the emmc_optimized filesystem flag is set, then like
inlinecrypt_optimized, we have to ensure that stable_inodes is set
on the filesystem.

Bug: 144046242
Test: Cuttlefish, ext4: set the flag in fstab, check for the
    stable_inodes flag using tunefs -l
Cherry-Picked-From: c2f37683bc
Merged-In: Id7f906564457c240ddf6677dd536698881385385
Change-Id: Id7f906564457c240ddf6677dd536698881385385
2020-05-21 15:20:51 -07:00
Josh Gao 6da375fdc9 adb: only submit USB writes on the worker thread.
After USB disconnection, io_submit will block until the endpoint comes
back up. We handle this in the worker thread by sending it a signal to
break it out of io_submit when we notice that USB has gone down, but
opportunistic writes from the main thread can get stuck in this scenario
as well. Submitting the writes only on the worker thread doesn't have a
measurable impact on performance, so avert this scenario by only
submitting writes from the worker thread.

Bug: http://b/157078255
Test: test_device.py
Change-Id: I1118f2e2a70d13f15592eb996e7084033ed5cb9d
(cherry picked from commit 962551000b)
2020-05-21 14:55:46 -07:00
Josh Gao 2081cf31b3 adbd: don't use libc++_static.
We have dependencies that use libc++_shared, which results in ODR
violation manifesting as host adbd crashing on launch in libc++ locale
initialization.

Bug: http://b/151056300
Test: adbd on host
Change-Id: I6c039b325308fb8c36dfe5c1d090ff4ebe9e3433
(cherry picked from commit d5d5ba1644)
2020-05-21 14:55:38 -07:00
Chen Zhu c724fb670f Add test config to libstatspull_test and libstatssocket_test
and apply mainline module test controller to it so that

the tests will only be run when statsd apex is found on device.

Bug: 154845935
Test: m mts && mts-tradefed run mts-statsd
Change-Id: I8939e68b4d4c3772e248c1960b74c0f1bd6a21a6
2020-05-21 14:51:59 -07:00
TreeHugger Robot b1d65993eb Merge "fastbootd: Support TCP protocol." into rvc-dev am: de933e859e
Change-Id: Ifbd08e4062d9f12389c05fc1033b224428600c5f
2020-05-20 16:43:30 +00:00
TreeHugger Robot de933e859e Merge "fastbootd: Support TCP protocol." into rvc-dev 2020-05-20 16:31:18 +00:00
David Anderson 0f095bc9ad Merge "libsnapshot_test: Fix running on DSUs." into rvc-dev am: a0e4932ccb
Change-Id: If690258af8cbea30465fb12980d564ddd9fc9470
2020-05-20 00:23:00 +00:00
David Anderson a0e4932ccb Merge "libsnapshot_test: Fix running on DSUs." into rvc-dev 2020-05-20 00:06:14 +00:00
Mark Salyzyn 5e6c5f3fe4 Merge "init: support wait timeout with more precision" into rvc-dev am: 7a6a01a09f
Change-Id: I6066c6765975539514b405c36c879f841254f624
2020-05-19 23:05:42 +00:00
Mark Salyzyn 7a6a01a09f Merge "init: support wait timeout with more precision" into rvc-dev 2020-05-19 22:48:29 +00:00
Howard Ro c0537a386f Merge "Remove statsd enable check when logging" into rvc-dev am: 48d5b6fd03
Change-Id: I91e6918c03847e3cbe33fc04a52048decd483b4f
2020-05-19 22:11:08 +00:00
Howard Ro 48d5b6fd03 Merge "Remove statsd enable check when logging" into rvc-dev 2020-05-19 21:58:10 +00:00
Howard Ro 516b632ff4 Remove statsd enable check when logging
statsd should now be enabled on all devices and this check is
unnnecessarily adding a check for each time there's a call into the
socket, which is inefficient.

Bug: 157082130
Test: make, statsd_test
Change-Id: I0bb0ae0c93516c3a02cb971742c3eba602668a09
2020-05-19 21:52:14 +00:00
TreeHugger Robot a2ffe95f50 Merge changes I2fcd093e,I24210426 into rvc-dev am: 9113e7be95
Change-Id: I8ec30ad23896c4cfb0464f7bedf223db823e8a4a
2020-05-19 20:25:46 +00:00
Alex Buynytskyy 4586511ac5 Incremental install mode for install-multi. am: f1e187be01
Change-Id: Ie0982882de740a8d0bf4c618dcf71ff2a7393971
2020-05-19 20:25:44 +00:00
Mark Salyzyn 61de0d226d init: support wait timeout with more precision
A one second timeout is so coarse and can affect boot time when
the possibility that the file does not exist.  Switch to accepting
a floating point number for seconds for the wait for file command.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 151950334
Test: wait_for_file sleep 0.05 reports an appropriate delay
Change-Id: I8d8ed386519ab54270b05ce91663d0add30f12e7
2020-05-19 13:25:07 -07:00
TreeHugger Robot 9113e7be95 Merge changes I2fcd093e,I24210426 into rvc-dev
* changes:
  Optimizing install-multi-package to use ABB.
  Incremental install mode for install-multi.
2020-05-19 20:12:04 +00:00
Hongguang Chen 7516ebe63b fastbootd: Support TCP protocol.
The current fastbootd only supports USB protocol. But some Android TV
devices are built without USB port. The fastbootd cannot be used on
those ATV devices due to it.
This change adds TCP protocol for such devices and fastbootd.protocol
property is added to control which protocol to use.

BUG: 152544169
BUG: 155198345
Test: manual test.
Change-Id: Idc391e677eb6a1880036419ba5f6c4160e8dbcbc
Merged-In: Idc391e677eb6a1880036419ba5f6c4160e8dbcbc
2020-05-19 19:11:25 +00:00
David Anderson 42d676db47 libsnapshot_test: Fix running on DSUs.
Because DSUs mount userdata via a fiemap, libfiemap has trouble creating
additional fiemaps on top of it. The complex stacking of dm-linear is
not supported. For other libfiemap tests we've hacked around this
limitation. If LpMetadata is in a folder named "test", we allow the
backing device search to stop at a dm node, whereas otherwise it would
need to stop at a physical device.

However this was not quite enough for vts_libsnapshot_test, because (1)
the test folder was not included in the pattern match, and (2)
CreateLogicalPartition() could not handle device-mapper names, as it
expects a named physical partition. Addressing both of these allows the
tests to pass on DSUs.

Bug: 156713441
Test: vts_libsnapshot_test on DSU
Change-Id: Ie7ee70e31dff0809a5f0c402ed132d80dd03d9b1
Merged-In: Ie7ee70e31dff0809a5f0c402ed132d80dd03d9b1
2020-05-19 18:48:10 +00:00
TreeHugger Robot 129bef9c26 Merge "init: failed to set sys.usb.controller" into rvc-dev am: 5b07f4f322
Change-Id: I9817c2239b059747b7946f27d7f8b049313457ab
2020-05-19 14:01:40 +00:00
TreeHugger Robot 5b07f4f322 Merge "init: failed to set sys.usb.controller" into rvc-dev 2020-05-19 13:48:39 +00:00
Steve Muckle 462912a84c add API to get hash descriptor am: b510d2bff3
Change-Id: I2c4efdaffa5dec1804330e30912b9145b8e0bd89
2020-05-19 05:22:22 +00:00
Alex Buynytskyy 61f4ab89a2 Optimizing install-multi-package to use ABB.
Bug: 150803885
Test: atest adb_test adbd_test
Test: adb install-multi-package Picsart_9.30.5.apk Pinterest_6.54.0.apk
Change-Id: I2fcd093e61afdd16d481194e1d5f8f66acf6a66c
Merged-In: I2fcd093e61afdd16d481194e1d5f8f66acf6a66c
2020-05-19 04:26:42 +00:00
Alex Buynytskyy f1e187be01 Incremental install mode for install-multi.
Bug: 150803885
Test: atest adb_test adbd_test fastdeploy_test
Change-Id: I242104267273bac21ab41390d3e77a434ffa565d
Merged-In: I242104267273bac21ab41390d3e77a434ffa565d
2020-05-18 21:26:10 -07:00
Steve Muckle b510d2bff3 add API to get hash descriptor
The GKI verification VTS test will need to examine the boot partition's
hash descriptor, so add support to access this descriptor.

Bug: 148800209
Test: atest AvbTest#Boot
Change-Id: I92e32f61a265671ae0940c44147391f73776e66a
Merged-In: I92e32f61a265671ae0940c44147391f73776e66a
2020-05-18 12:38:18 -07:00
Jooyung Han 802417697f Merge "backtrace: Set min_sdk_version" into rvc-dev am: 8de46ae39d
Change-Id: I5d28cc28fdde08b4f5f8a1a7c98aeb6c01ccda4a
2020-05-18 06:49:49 +00:00
Jooyung Han 8de46ae39d Merge "backtrace: Set min_sdk_version" into rvc-dev 2020-05-18 06:34:01 +00:00
Jooyung Han 148f7b32d7 backtrace: Set min_sdk_version
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.

For now setting min_sdk_version doesn't change build outputs.
But build-time checks will be added soon.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 152655956
Test: m
Merged-In: I9ff06ca47c8bc2cc5632ffb3494e4fb8eb79d5a3
Change-Id: I9ff06ca47c8bc2cc5632ffb3494e4fb8eb79d5a3
(cherry picked from commit bc62a19448)
2020-05-18 06:33:37 +00:00
TreeHugger Robot 59e0da7287 Merge "fastbootd: copy AVB footer on boot image to end of block device" into rvc-dev am: 56c1c590ac
Change-Id: Ieff1bf5a5285bd32185c30d3fe6290af7fcfd7ee
2020-05-18 04:43:29 +00:00