Commit Graph

51490 Commits

Author SHA1 Message Date
Steven Moreland c0927e64b1 libutils: remove references to unimplemented func
printWeakPointer isn't implemented anywhere. This also allows us to
remove a forward declaration of TextOutput.

Bug: N/A
Test: N/A
Change-Id: Ie2debdfda17b7cc1d599c431eaf4c362a591e482
2019-07-11 17:50:52 -07:00
Gerry Fan 891a011394 Revert "rootdir / sdcard : Stop creating /data/media/obb."
This reverts commit c6ca823710.
Reason for revert: Q-GSI on Pie devices would crash kernel.

Bug: 136199978

Change-Id: I16a2cb81a1f21627db0cb00324679a322ba42fe0
2019-07-12 00:16:06 +00:00
Steven Moreland e0d94b6493 libadbd_services: remove unused deps
Bug: 137311188
Test: library still builds
Change-Id: I52e110ddfda073c833e86194eaf7a9502b9181a6
2019-07-11 16:13:10 -07:00
David Anderson 4f9d1b15b4 libdm: Fix race conditions in LoopControl::Attach.
This fixes two race conditions in LoopControl::Attach(). The first is
that after LOOP_CTL_GET_FREE, the path is not be available until it has
been processed by ueventd. This can be fixed by adding a timeout
parameter and a call to WaitForFile().

Second, it is possible (albeit unlikely), given that loop devices are
now being used more aggressively, that two processes race when
attempting LOOP_SET_FD. In this case, one process will win, and the
other will fail with EBUSY. We can handle this case by retrying the
operation while respecting the same timeout parameter.

Bug: 135771280
Test: libdm_test gtest
Change-Id: Icf9facc3ca28fdb6ff5c78612d3dc183fa47b1f3
2019-07-11 15:39:53 -07:00
David Anderson 470fe2b5f0 fs_mgr: Remove the timeout parameter to DestroyLogicalPartition.
This is no longer needed as CreateLogicalPartition() ensures the
obtained path will not race with device deletion.

Bug: 135771280
Test: device builds, flashes
Change-Id: I821290aa08fede99d5c51cd68681c351a1ea97bc
2019-07-11 15:39:53 -07:00
David Anderson 924858cd18 libdm: Improve the reliability of dm device paths.
This fixes a race condition where WaitForFile() after
GetDmDevicePathByName appears to succeed, but a subsequent operation on
the path fails. This can happen when CreateDevice() is called
immediately after a call to DeleteDevice (from any process), and the
path is re-used, enqueuing udev events to remove and re-add the block
device.

The fix for this is to introduce a new variant of CreateDevice() that
has a timeout parameter. When the timeout is positive, CreateDevice()
will wait for a /dev/block/mapper/by-uuid symlink to be created, which
signals that ueventd has finished processing the operation.

ueventd will now create these by-uuid symlinks for device-mapper nodes.
Unfortunately, the uuid is only available during "change" events, so we
have to special case device-mapper symlink creation. And since the uuid
is not available during "remove" events, we simply find matching links
to remove them.

This ensures that callers of CreateDevice() can use the device path
knowing that no asynchronous removals are pending. Code that uses the
old CreateDevice+WaitForFile pattern will be transitioned to the new
method.

Note that it is safe to ignore the timeout, or to use the "unsafe"
CreateDevice, if the caller ensures the path by other means. For example
first-stage init has no device removal, and regenerates uevents until
it has acquired all the paths it needs.

Finally, since libdm now inspects sysfs unconditionally, libdm consumers
need r_dir_file perms for sysfs_dm in their sepolicy. Additionally
linking to libdm now requires linking to libext2_uuid.

Bug: 135771280
Test: libdm_test
      device flashes, boots
Change-Id: If5a7383ea38f32a7fbbcf24842dce6a668050a70
2019-07-11 15:39:52 -07:00
Daniel Norman 3f42a767cd Checks the interface inheritance hierarchy in init_rc files.
Bug: 118016875
Test: Added 'interface' lines to an init_rc file and observed errors
when misspelled or missing entire inheritance hierarchy.
Change-Id: I681420f15539742d8415808b2a0dcbf0bf6faaf1
2019-07-11 14:43:11 -07:00
Steven Moreland 6f2eeabbcc Merge "Remove binder dependency in init." am: 4280165ae0
am: 538b50d9d5

Change-Id: I570719645f98326c76e1943573686e044b48723b
2019-07-11 14:40:12 -07:00
Steven Moreland 538b50d9d5 Merge "Remove binder dependency in init."
am: 4280165ae0

Change-Id: I54ee7ce313210ff47c62ad417c96da40a03cbb29
2019-07-11 14:32:21 -07:00
Steven Moreland 4280165ae0 Merge "Remove binder dependency in init." 2019-07-11 20:56:12 +00:00
Sam Protsenko 4d35f2e59c init: Write the reason in BCB on "reboot recovery"
Without this change "adb reboot recovery" leads to normal boot.

Change-Id: I361d0a1f6f6f2c57f3dc80102c21970b462c9b9c
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
2019-07-11 11:25:28 +00:00
Justin Yun 7cc7b64a44 Merge "Rename product_services to system_ext" am: 6da50e319c
am: e0b1eb8d65

Change-Id: I3a1cdb36df2789452ce6e00dbfaba792a565c09b
2019-07-11 00:24:07 -07:00
Justin Yun e0b1eb8d65 Merge "Rename product_services to system_ext"
am: 6da50e319c

Change-Id: If9eaecca2382b3ace74ae721e80d51c79bb9b0fb
2019-07-11 00:15:28 -07:00
Xin Li 5099e52608 [automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master" am: 7c2e6f4e6f -s ours
am: 73d8b8a13d -s ours
am skip reason: subject contains skip directive

Change-Id: I83fac4d48f9b14d0b3a07005635c2b42300c1957
2019-07-10 22:45:15 -07:00
Justin Yun 6da50e319c Merge "Rename product_services to system_ext" 2019-07-11 05:36:23 +00:00
Xin Li 669355e850 [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master am: 3fd963ed5e -s ours
am: 0a383c73ee -s ours
am skip reason: subject contains skip directive

Change-Id: Ie6999139d5e8c46f94d13b294c1a0348765ba575
2019-07-10 22:18:01 -07:00
Xin Li 73d8b8a13d [automerger skipped] Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master"
am: 7c2e6f4e6f -s ours
am skip reason: subject contains skip directive

Change-Id: I735db5e09c5aa3a4eb99b0a995901225aecee974
2019-07-10 21:48:44 -07:00
Xin Li 0a383c73ee [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master
am: 3fd963ed5e -s ours
am skip reason: subject contains skip directive

Change-Id: I80f36310a9716bce77e85ab5f0e13e8c7530e970
2019-07-10 21:22:44 -07:00
Treehugger Robot 7c2e6f4e6f Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master" 2019-07-11 03:52:57 +00:00
Mark Salyzyn 8cf2103083 fs_mgr: overlay: do not allow sub-mounts to be overridden
Prevent sub-mounts from being candidates for overlayfs overrides.
We move them temporarily to hold the references, then move them back
after overlayfs mount.

There is a race condition that can not be solved where the content
of the sub-mount is temporarily unavailable.  This operation occurs
in first stage init (no problem) and during the first adb remount or
adb disable-verity that causes the backing storage to be setup.
Workaround will be to time the adb remount/disable-verity so that the
device-specific problems do not surface.

Test: adb-remount-test.sh and manual device configs
Bug: 130131892
Bug: 135647457
Change-Id: I8782d09b7b389d899aed07b3e6c528280af2d6c8
2019-07-10 14:32:05 -07:00
Tom Cherry 3ceea099f3 Add reserved AID ranges for all partitions
With Treble and Mainline, each partition needs to be able to
independently define its own set of AIDs and therefore needs its own
AID range to not conflict with updates made to other partitions.

This includes the system partition in the case of vendors making
additions to it.  Bionic will always have the hardcoded list of
platform AIDs in its own reserved list.

Bug: 73062966
Test: can load AIDs from partitions other than vendor
Test: bionic-unit-tests

Change-Id: I6509acc555cd28b421b9edaf3f8006bad6c56125
2019-07-10 13:45:53 -07:00
Mark Salyzyn d7931f1149 init: powerctl support and propagate longer canonical reboot reasons.
init: Received sys.powerctl='reboot,userrequested,recovery,ui' ... (/system/bin/recovery)
init: powerctl: unrecognized command 'reboot,userrequested,recovery,ui'

Test: manual & boot_reason_test.sh
Bug: 63736262
Bug: 135078366
Bug: 133326470
Change-Id: I931daf8dc4b74db5ee114c59ee215b1ba54bc31d
2019-07-10 13:06:57 -07:00
Tom Cherry 7c1d87e490 init: fix clang-tidy performance issues
Test: boot, init unit tests
Change-Id: Iccf34d2fedfa543dd9f29e010cbb6d8fe9cf5983
2019-07-10 12:59:02 -07:00
Steven Moreland 4ee27039e0 Remove binder dependency in init.
- unused
- using binder requires twoway calls (since getting a service from
    servicemanager requires two calls)

Bug: 135768100
Test: N/A
Change-Id: Idc41f487bad2d8343e99ded98812f3a84e2b8e37
2019-07-10 17:01:31 +00:00
Elliott Hughes f46b1efcbd Merge "grep is now toybox grep." am: d543c8ca11
am: 41d4639318

Change-Id: Ie1367fafd33df1fea7ab3a01a50cab2b0e2febe8
2019-07-10 08:47:19 -07:00
Elliott Hughes 41d4639318 Merge "grep is now toybox grep."
am: d543c8ca11

Change-Id: Ie2ace15b034fad308666f0bfabec24cc7a55695c
2019-07-10 08:41:23 -07:00
Elliott Hughes d543c8ca11 Merge "grep is now toybox grep." 2019-07-10 15:19:58 +00:00
Tom Cherry 820333dce4 Add noexcept to missing places in expected.h
These move and assignment operations are conditionally noexcept, so
add that to their definitions.  This is a performance issue as well as
correctness, since std containers will copy instead of move during
resize if these operations are not noexcept.

Test: build
Change-Id: I148f7eb3489e7f1dd68cc0fb0e555b56470e42da
2019-07-09 17:06:08 -07:00
Xin Li 3fd963ed5e DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master
Bug: 136196576
Change-Id: I127ae61add2e34184b3c65ca64693cccf62b8a6d
2019-07-09 17:00:47 -07:00
Justin Yun 7eaf9b58ec Rename product_services to system_ext
Update ld.config.txt and init.

Bug: 134359158
Test: make && check boot and ld.config.txt file
Change-Id: Ie1dce42e690414fb45b26759506ea7f64d06740d
2019-07-09 23:34:17 +00:00
Florian Mayer 1051600430 Merge "Fix missing load bias." am: 3f407fcc37
am: 186b6bbdd5

Change-Id: I7c2ccd4d5ac96b2f7ae889ed0ffab6ed7327ade0
2019-07-09 15:02:25 -07:00
Florian Mayer 186b6bbdd5 Merge "Fix missing load bias."
am: 3f407fcc37

Change-Id: I5986c44d75d35090f093667da4ecfa25725efd27
2019-07-09 14:49:19 -07:00
Florian Mayer 3f407fcc37 Merge "Fix missing load bias." 2019-07-09 21:30:47 +00:00
Tom Cherry df10261262 Merge "Remove an ancient spam-busting hack from logd." am: e05c799c47
am: b0bfb3bb07

Change-Id: I57019a259c7a83e8e1de0d09a568e63ee5162eb3
2019-07-09 14:23:10 -07:00
Tom Cherry 52a2b8e4da Merge "Don't implement our own remove_cvref_t." am: a93e09f834
am: 10d5983b42

Change-Id: I99a5e704cb554d712808d5f2f246f280b37694c2
2019-07-09 14:11:52 -07:00
Tom Cherry b0bfb3bb07 Merge "Remove an ancient spam-busting hack from logd."
am: e05c799c47

Change-Id: I3a964569fa96eba1d3c8815b0831bbe7031b1a97
2019-07-09 14:11:35 -07:00
Josh Gao ad5c63c26d Merge changes from topic "fdevent_refactor" am: 88d23135d2
am: d057fb5345

Change-Id: I2ba5e7e6b2de552f70bd7999cea7c5f24de4d2de
2019-07-09 13:58:58 -07:00
Josh Gao 6cb7252495 adb: fdevent: extract Create/Destroy from fdevent_context_poll. am: 33944a2742
am: 77e1372ad9

Change-Id: I40a3778f85c2402b8d1738f66de66254de4b359b
2019-07-09 13:58:54 -07:00
Josh Gao 5d9d263b35 adb: fdevent: move TerminateLoop to fdevent_context. am: ebaa348d32
am: 296977fed9

Change-Id: I550fa1a594de19e81d0e1d96491b93d0a3e40979
2019-07-09 13:58:50 -07:00
Josh Gao cc15151d59 adb: fdevent: move CheckMainThread logic to fdevent_context. am: 2c95bf73a5
am: 57c060a4b8

Change-Id: I55c5d414b1fc6f23142747458f2e5b41e5a4a8cc
2019-07-09 13:58:45 -07:00
Josh Gao b076011fba adb: fdevent: delete FDE_CREATED. am: e546f6816e
am: f46ca64f08

Change-Id: Idd725386074bc7c3d89c80122a150e05de091e84
2019-07-09 13:58:41 -07:00
Josh Gao 48df96979f adb: fdevent: move run queue to fdevent_context. am: 95eef6b097
am: 3f06c2ba19

Change-Id: I44072d380ac4b54fc098775c5abe81032ab3d96f
2019-07-09 13:58:37 -07:00
Josh Gao 6b501064b9 adb: implement fdevent_reset by constructing a new context. am: 7adca93fe9
am: 8935c1c89f

Change-Id: Ie6123ea0f85e57464ceb4006d420fcd5e56cbdaa
2019-07-09 13:58:19 -07:00
Josh Gao a0ea245fc5 adb: move fdevent implementation out to a separate file. am: 95068bbd9a
am: e62c2c2485

Change-Id: I548984657281eac96f007c3f8a718e5c2500cb5e
2019-07-09 13:58:15 -07:00
Josh Gao e7be4e5623 adb: de-globalize fdevent context. am: c2cf121174
am: b0168bcb04

Change-Id: I7515b05158a1e3a5efc21544769c0ffb4815364b
2019-07-09 13:58:10 -07:00
Josh Gao 6860ff07cc adb: move fdevent to its own folder. am: 57e09b16ca
am: 261569d533

Change-Id: If15c91a2eb1382e83f7dca89e96056c90d84f3b9
2019-07-09 13:58:06 -07:00
Josh Gao a12d4eca7c [automerger skipped] adb: add superfluous include. am: 2d03ad42ed -s ours
am: 4158a6714b -s ours
am skip reason: change_id If73b81ca73ba4d64763cf49c1bbe42de81fa1cb6 with SHA1 7eeda6ba03 is in history

Change-Id: I3823b3dcab1e4206306590017381f5116a69ebcc
2019-07-09 13:58:02 -07:00
Tom Cherry 10d5983b42 Merge "Don't implement our own remove_cvref_t."
am: a93e09f834

Change-Id: I97e9f98b6ac10261220983bf25653987f515b2eb
2019-07-09 13:57:56 -07:00
Josh Gao d057fb5345 Merge changes from topic "fdevent_refactor"
am: 88d23135d2

Change-Id: I5871b36885fbeb5db594d5bb60b043dbd41ff3bb
2019-07-09 13:38:26 -07:00
Josh Gao 77e1372ad9 adb: fdevent: extract Create/Destroy from fdevent_context_poll.
am: 33944a2742

Change-Id: Ie999135e7a60d01848e3ccee13d93135ab2170e8
2019-07-09 13:38:10 -07:00