Commit graph

44739 commits

Author SHA1 Message Date
David Anderson
f9134aa1d5 libfiemap_writer: Fix bugs in vfat handling.
FIBMAP returns block numbers, whereas fiemap_writer was treating them as
byte offsets.

Bug: 126230649
Test: gsi_tool install to vfat works
Change-Id: Ice80128213425aa9601e381d0fbe53f9581bf596
2019-03-11 19:17:01 -07:00
Treehugger Robot
8a1fb91e14 Merge "Add missing override keyword" 2019-03-11 23:56:30 +00:00
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
Casey Dahlin
6e96f68cf3 Add missing override keyword
Fuchsia builds with Clang, and it's a bit pickier about always using
override when it's appropriate.

Test: None
2019-03-11 12:35:41 -07:00
The Android Open Source Project
4d916a1ece DO NOT MERGE - Merge PPRL.190305.001 into master
Bug: 127812889
Change-Id: I16a546dc24d3cf980ad7ab09895c0d97ee436224
2019-03-11 11:57:28 -07:00
Jayant Chowdhary
a229d3e23e Special case init for android_is_in_vendor_process.
Init is executed without ld.config.<ver>.txt loaded (since sysprop
service isn't up in order for it to read ro.vndk.version and know <ver>). It uses the hard-coded
namespaces in the linker and therefore, does not know about the vndk namespace. That does not mean
it is not a system process.

Bug: 124128212

Test: Boot up device with selinux enforced, use camera to take pictures/ record videos (sanity)
Test: Watch movies on youtube (sanity)

Change-Id: If8701af2ee5dfa3bb36d0ce0a17a23808d184d9f
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2019-03-11 11:18:06 -07:00
Mark Salyzyn
6fc0829c5a bootstat: add recovery,quiescent and reboot,quiescent to known set
Reserve recovery,quiescent and reboot,quiescent to known reboot
reasons.

Test: none
Bug: 120624642
Change-Id: I78c52f6db447c9d3980a3f2007471bc7aa60e25f
2019-03-11 10:08:05 -07:00
Jooyung Han
55063b1444 Revert "Mark libs as double_loadable"
This reverts commit c624621554.

Reason for revert: These libs are no longer used by libmediandk(aosp/915075)

Change-Id: I5533a3c22263afb21f4053a569c4a646c9766404
2019-03-11 14:10:34 +00:00
Hans Boehm
029b12ebde Fix wp and sp comparison bugs
Make clear() actually clear wp m_refs, so that nulls compare equal.

Make equality consistent with < and >, ensuring that a weak pointer
cannot be both equal to and greater than another.

Don't rely on the built-in < and > operators to correctly order
different objects. The standard does not guarantee that, and there is
a risk of compiler relying on that lack of guarantee.

Remove unnecessary comparison overloads, especially those
comparing a wp<> to an sp<>.

Change the remaining wp<> to sp<> comparisons to check for equivalence
of the mRefs pointer instead of the object address, thus eliminating
the dubious equal comparison result for a dead wp<> and an sp<> that
happen to point to the same object address.

Add comparison tests.

Test: Treehugger, boot AOSP, atest RefBase
Bug: 126922090
Change-Id: I15911150e0fc85ace2c4b77d337826e12793c690
2019-03-09 21:41:37 -08: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
android-build-team Robot
5d1d32dcbf Snap for 5240760 from 20ac1203a3 to pi-platform-release
Change-Id: I6bbede2f8c74a9f344df6f3c713de709eb79cd26
2019-03-08 18:40:29 +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
Kiyoung Kim
4639f6946a Add product apk support from libnativeloader
Currently libnativeloader appends vendor lib path if apk is from vendor
partition. Similar to this we should add product lib path if apk if from product partition.

Bug: 124705551
Test: m -j && tested from crosshatch with product apps (such as Wallpaper)
Change-Id: I8c3473f1f70b1c22dcaed7eb2d5f9c3deee9e1a5
Merged-In: I8690167ca8098015c8ae4bbb4f028404c5e94dc0
2019-03-07 15:01:52 +09: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
Tao Bao
5747e228f7 healthd: Add charger.recovery module.
This CL splits out healthd_mode_charger_nops for building
charger.recovery. It doesn't change the functionality of the charger
module under recovery, i.e. a) it still doesn't do much work other than
reporting the battery status periodically; b) it keeps calling
device-specific healthd functions (healthd_board_init and
healthd_board_battery_update) via the statically linked HAL.

Previously `charger -r` was used to indicate starting charger under
recovery mode. This CL makes it a noop since we've changed the caller in
recovery.

Bug: 73660730
Bug: 114042635
Test: Boot into charger mode on walleye. Check that charger UI works.
Test: Boot into recovery mode on walleye. Check that /system/bin/charger
      keeps working.
Test: Run charger_test on walleye.
Change-Id: Id91acfcc77ec315c2382392dc54e36c3e85de2eb
2019-03-06 14:41:47 -08:00
Tao Bao
f2455d8068 healthd: charger uses shared libraries.
With the change in [1], /sbin/charger always gets included into
system.img (as opposed to ramdisk) and started by second-stage-init. It
no longer needs to be statically linked. This CL switches it to use
shared libraries, and moves it to /system/bin/charger.

With this change, charger no longer gets installed into recovery image,
which will be handled by a follow-up CL.

[1] https://android-review.googlesource.com/c/platform/build/+/728287

Bug: 73660730
Test: Boot into charger mode on taimen. Check that charger UI works.
Test: Run charger_test on taimen.
Change-Id: Idff70cfad09c825cdba4d35a471ff7ecd5f8a8f7
2019-03-06 14:36:59 -08: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