Commit Graph

44613 Commits

Author SHA1 Message Date
Josh Gao 3c99b0f94f adb: make root/unroot wait for the device to come back.
Test: manually unplugged a device after adb root
Change-Id: I588283a666cc5e19d809d7ce81b5300398e8be2d
2019-03-11 15:59:09 -07:00
Treehugger Robot 2009e32008 Merge "Support zero-length mapped files" 2019-03-11 22:49:56 +00:00
Treehugger Robot 22ff8e1909 Merge "adbd: properly handle FUNCTIONFS_BIND without ENABLE." 2019-03-11 22:48:46 +00:00
Josh Gao 007a4dc7a6 adbd: properly handle FUNCTIONFS_BIND without ENABLE.
If a device is unplugged, a BIND will happen without an ENABLE until the
device is plugged in, which would previously result in adbd crashing
every 5 seconds due to an attempt to join a thread that hadn't been
started.

Bug: http://b/128255355
Test: manually observed adbd via serial cable while unplugged
Change-Id: I90d6384e7e829df1ffaf73a95f2418a2ff97fb03
2019-03-11 13:06:17 -07:00
Christopher Ferris fdfb9a0113 Merge "Add unistd.h to includes in Regs.h" 2019-03-09 21:21:27 +00:00
Treehugger Robot 71c084d07e Merge "init: use PLOG rather than strerror." 2019-03-09 02:04:56 +00:00
Treehugger Robot f3762004a3 Merge "Set cg_file_data_ to null when initialization failed" 2019-03-09 00:15:05 +00:00
Treehugger Robot 34e1b402a6 Merge "Change mini-keyctl command format." 2019-03-08 23:17:01 +00:00
Casey Dahlin 0e113851a5 Add unistd.h to includes in Regs.h
This is required to use pid_t, but by luck nobody noticed its absence
until the Fuchsia build.

Test: Code now builds inside Fuchsia
2019-03-08 15:04:48 -08:00
Elliott Hughes 076305e4fb init: use PLOG rather than strerror.
Test: builds
Change-Id: Ifdba8e7fa4cd5c852946bb0f398382f2d64674cd
2019-03-08 12:34:53 -08:00
Josh Gao e6413fcd94 Merge "Restrict scanning port range, not emulator count" 2019-03-08 19:29:43 +00:00
Wei Wang d71d30179c Set cg_file_data_ to null when initialization failed
Cannot really do calls if initialization failed.
Also fix LOG usage.

But: 124774415
Test: Build
Change-Id: Ifd7db90cfee51ba5830e1d4db8f8d19b5bc9feba
2019-03-08 10:18:06 -08:00
Xiaoyong Zhou b29b27ec7f Change mini-keyctl command format.
This CL change the mini-keyctl tool to make it compitable with libkeyctl
tool to make it more useful.

Bug: 112038861
Test: mini-keyctl padd asymmetric 'desc' .fs-verity < /path/to/cert.der
Test: mini-keyctl unlink <key_id> <keyring_id>
Test: mini-keyctl restrict_keyring <keyring_id>

Change-Id: I950f07c7718f173823ce5a5cd08e0d1a0e23a007
2019-03-08 09:59:42 -08:00
Mark Salyzyn 6c5c085e41 Merge "fs_mgr: overlay: preserve errno android::gsi::IsGsiRunning()" 2019-03-08 17:05:03 +00:00
Roland Levillain ecef987a35 Merge "Fix a typo in linker configuration comments." 2019-03-08 11:48:43 +00:00
Tao Bao b778c44c07 Merge "mkbootimg: print addresses and offsets in hex" 2019-03-08 06:31:05 +00:00
Treehugger Robot f97193d96f Merge "Revert "Revert "adbd: switch the default USB implementation.""" 2019-03-08 03:29:41 +00:00
Dongwon Kang fc6e441a1a Merge "allow_all_shared_libs for media namespace in ld.config.legacy.txt" 2019-03-08 02:46:06 +00:00
Pirama Arumuga Nainar 5d7f84144d Support zero-length mapped files
Bug: http://b/119818070 "app crashes when reading asset of zero length"

Add support for zero-length mappings for the Windows code path as well.

Test: ran libbase_test on Windows under wine.
Change-Id: Iccb65fa800c636444100c9369f41e36d24a53a99
2019-03-07 16:12:55 -08:00
Matthew Maurer 2ba61b775a Merge "Add support for RPMB over VirtIO Serial" 2019-03-07 21:30:56 +00:00
Mark Salyzyn 27c5047313 fs_mgr: overlay: preserve errno android::gsi::IsGsiRunning()
Resulted in remount reporting an mount_all failure.

Test: adb-remount-test.sh
Bug: 126256072
Change-Id: Ib9567748e5c12b047e38869c07755eb741308df4
2019-03-07 13:07:17 -08:00
David Anderson e9223204d3 Merge "Add write support to SplitFiemap." 2019-03-07 19:55:48 +00:00
Roland Levillain e51c87634a Fix a typo in linker configuration comments.
Test: n/a
Change-Id: I3fa36094cf3eb45b0e1400712f22b8477a096b59
2019-03-07 19:06:57 +00:00
Dongwon Kang 787e09a1de allow_all_shared_libs for media namespace in ld.config.legacy.txt
This is a temporal fix. With this change, the extractor plug-ins uses
unstable libs under /system/lib[64]. The right resolution is being
discussed.

Test: applied the same change to ld.config.txt and checked
      the memory map of media.extractor on cuttlefish.
Bug: 127791685

Change-Id: Ifd5b79831f27ef4017bb8aa774671aa9b2c5264e
2019-03-07 10:14:02 -08:00
David Anderson 1c1850fad2 Merge "Create /metadata/password_slots during boot." 2019-03-07 16:20:01 +00:00
Treehugger Robot e820afdadb Merge "Don't defer zygote" 2019-03-07 13:59:17 +00:00
Jiyong Park 1a789db2e3 Don't defer zygote
Removing 'updatable' from zygote as zygote is started after apexd. All
APEXes are guaranteed to be activated at the moment.

Sequence of actions:
1) /data mounted. post-fs-data is triggered.
2) apexd starts. APEXes are activated. Init does not execute more
commands until the activation finishes.
3) all post-fs-data sections from other *.rc are executed.
4) zygote-start is triggered.

Bug: 123404717
Bug: 126555629
Bug: 125549215
Test: device boots
Test: no following message on the logcat log
Could not restart 'zygote': Cannot start an updatable service 'zygote' before configs from APEXes are all loaded. Queued for execution.

Merged-In: Ib4d0716ed5225b6ade3adaa247ff6140a9b2b9d5
Change-Id: Ib4d0716ed5225b6ade3adaa247ff6140a9b2b9d5
(cherry picked from commit 3bddd540dd)
2019-03-07 22:21:32 +09:00
Tim Baverstock 25173c808a Restrict scanning port range, not emulator count
Our servers can comfortably run more than 16 emulators, and this is
much easier than messing with hypervisors or docker port allocation.

Assumes you know how to avoid clashes with Google Wear's default port.

Test: manual - still registers emulators.

Change-Id: I47cfd28725a550de0bd77fd11fcd94cdd11d2cc2
2019-03-07 12:28:31 +00:00
Yuvraj Saxena bc5a0ecd8a mkbootimg: print addresses and offsets in hex
Change-Id: Ia8a8d68acd8d68750f9ae49ccd341f0f4d3f4e9c
2019-03-07 05:06:09 +00:00
Treehugger Robot 96dc80f97a Merge "Make /apex on ramdisk" 2019-03-07 05:03:05 +00:00
David Anderson 6b4b265abf Add write support to SplitFiemap.
This adds few new methods to introduce write support to SplitFiemap:

(1) Write(), which has an internal cursor to stream data into the split
    files. As the end of one file is reached, the next is opened.
(2) Flush(), which calls fsync() on each internal FiemapWriter.
(3) HasPinnedExtents(), which calls the same on each internal
    FiemapWriter.

Included are some tests for edge cases in Write().

Bug: 126230649
Test: fiemap_writer_test gtest
Change-Id: I9fd509215975dbbb20a44b020315d3c1b287d1a0
2019-03-06 19:32:20 -08:00
Josh Gao 98efc485de Merge "adbd: cleanups in remount/verity." 2019-03-07 02:32:42 +00:00
Jiyong Park e5dc674a95 Make /apex on ramdisk
Bug: 127576519
Bug: 127653919
Test: build hikey, check ramdisk has /apex directory
Change-Id: I4e844caa032c0717bd36d323675852ce3681fb01
2019-03-07 11:17:44 +09:00
Sudheer Shanka 0c8b8af74a Merge "Allow callers to pass a flag to not link obb dirs of multiple users." 2019-03-07 00:34:59 +00:00
Tao Bao a3d394e9bb Merge "mkbootimg: extract to 'second' if size not 0" 2019-03-06 22:43:33 +00:00
Treehugger Robot 6bd04c1570 Merge changes I3506c8e7,I198c0e8c,I8a5d4e36
* changes:
  fs_mgr: remount: automatically disable verity
  fs_mgr: remount: pull root device from fstab
  fs_mgr: test: track device active slot throughout
2019-03-06 21:53:52 +00:00
Josh Gao 3ed90b75da adbd: cleanups in remount/verity.
1. Don't clear O_CLOEXEC on an fd we're duping to stdin/out/err: dup2
   does that for us if oldfd != newfd, and we know the fd can't be
   stdin/out/err.
2. Use unique_fd.
3. Remove gotos by breaking the remount logic into its own function.

Test: mma
Change-Id: If9929e7f20de445322fd498e1379a2d4e572cb52
2019-03-06 13:03:30 -08:00
Treehugger Robot 51deeb569f Merge "Access apex sysprops via the generated API" 2019-03-06 17:38:46 +00:00
Florian Mayer 30c898f1ca Merge "Fix copy / move behaviour of Maps object." 2019-03-06 16:31:10 +00:00
Mark Salyzyn 6a26b4b74d fs_mgr: remount: automatically disable verity
Disable verity even if -R flag is not supplied.

Test: adb-remount-test.sh
Bug: 127494168
Change-Id: I3506c8e7d5525ca1d0685004c1fb7e26448fa648
2019-03-06 08:25:36 -08:00
Mark Salyzyn 3babd8488b fs_mgr: remount: pull root device from fstab
For devices that do not support overlayfs that are system as root,
need to pull /dev/root device from / mount point in fstab.

Test: adb-remount-test.sh
Bug: 126256072
Change-Id: I198c0e8c60770508737318afde95db2966294ff5
2019-03-06 08:25:36 -08:00
Mark Salyzyn 448fc9783c fs_mgr: test: track device active slot throughout
Report any discrepancy in the active slot.

Fix a problem with problematic error propagation for adb_cat()

Test: adb-remount-test.sh
Bug: 126256072
Change-Id: I8a5d4e364945c5e60d252333886987b8dca0cfb3
2019-03-06 08:25:36 -08:00
Yuvraj Saxena ff5e99a6cd mkbootimg: extract to 'second' if size not 0
Change-Id: I5f6804be6372371d51d5757f6a5700c07ed5e57f
2019-03-06 14:23:02 +00:00
David Anderson 0664f31dd0 Create /metadata/password_slots during boot.
This directory is used to store the Weaver/GateKeeper slot map so GSIs
do not overwrite host keys in secure storage.

Bug: 123716647
Test: /metadata/password_slots exists after boot
Change-Id: Ib0ca13edec38e68cba1fc2124465571feedc4be7
2019-03-05 22:18:14 -08:00
David Anderson 5a465412b1 Merge "Use distinct GateKeeper userids when running a GSI." 2019-03-06 02:40:03 +00:00
Matthew Maurer 57ba8c58fc Add support for RPMB over VirtIO Serial
In order to test Trusty gatekeeper automatically, the storage proxy
needs to be active inside the emulator. This patch allows storageproxyd
to speak a length-framed RPMB to an external RPMB daemon.

For a concrete example of a daemon speaking this protocol, see rpmb_dev
in the Trusty tree.

Bug: 124277696
Test: Launch storageproxyd with -t virt, use Trusty test infra
Change-Id: I391d4768976f0eb1f3b8df58eefd58fc3a9409cd
2019-03-05 17:25:57 -08:00
Treehugger Robot 2d85880b49 Merge "Clang-format before updating storage proxy" 2019-03-06 00:53:25 +00:00
David Anderson 925c78b7e8 Merge "Support FiemapWriters that extend across multiple files." 2019-03-05 23:06:19 +00:00
Sudheer Shanka cabc52646a Allow callers to pass a flag to not link obb dirs of multiple users.
Bug: 110960295
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ExternalStorageHostTest.java
Change-Id: I738e7e6365fb4917f1172c578281e1835a5012c2
2019-03-05 14:41:54 -08:00
David Anderson 79a43cf135 Merge "Add more filesystem support to libfiemap_writer." 2019-03-05 18:14:53 +00:00