Commit graph

51323 commits

Author SHA1 Message Date
Mark Salyzyn
61c7cc6d88 Merge "bootstat: power_on* handling"
am: 91338a6aa2

Change-Id: Ia3cccc615dbb49c3624e73ea248b9e3c5d0ad61d
2019-07-15 08:59:33 -07:00
Mark Salyzyn
91338a6aa2 Merge "bootstat: power_on* handling" 2019-07-15 15:47:04 +00:00
Tom Cherry
e1f381603d Merge "Add noexcept to missing places in expected.h"
am: a8b0517108

Change-Id: I414d6976260249be40b9c8e99dc8a8798089b6d6
2019-07-15 08:42:29 -07:00
Tom Cherry
a8b0517108 Merge "Add noexcept to missing places in expected.h" 2019-07-15 15:12:46 +00:00
David Anderson
8c3c846cf3 Merge "fs_mgr: Remove the timeout parameter to DestroyLogicalPartition."
am: cd22e3a6f6

Change-Id: Ia3e60d52b9a6e6f9549ed0d9b07aee80dcba16d2
2019-07-13 11:18:07 -07:00
David Anderson
cd22e3a6f6 Merge "fs_mgr: Remove the timeout parameter to DestroyLogicalPartition." 2019-07-13 18:02:05 +00:00
David Anderson
92c53170f3 Merge "libdm: Improve the reliability of dm device paths."
am: c9b797ac25

Change-Id: I30a3bf89f71269b0072dad4f73e6b74273ea031a
2019-07-12 16:24:39 -07:00
David Anderson
c9b797ac25 Merge "libdm: Improve the reliability of dm device paths." 2019-07-12 23:03:41 +00:00
Suren Baghdasaryan
771882633e Merge "lmkd: Prevent non-main threads being registered or killed by lmkd"
am: e0b729d214

Change-Id: I11738b8c2c7acfa4947976e8b12ac9b94e7fc8ac
2019-07-12 13:39:47 -07:00
Suren Baghdasaryan
e0b729d214 Merge "lmkd: Prevent non-main threads being registered or killed by lmkd" 2019-07-12 20:13:35 +00:00
Tom Cherry
fcbc44a371 Merge "init: fix clang-tidy performance issues"
am: 8a779ee959

Change-Id: Ifeba3b1a962c33cf355fa897a7177845630be16a
2019-07-12 12:00:56 -07:00
Mark Salyzyn
bdd1ce8538 Merge "fs_mgr: overlay: do not allow sub-mounts to be overridden"
am: bde9fc1787

Change-Id: I115026d227ceb9950020ebc97694d72c1fc04329
2019-07-12 12:00:19 -07:00
Tom Cherry
8a779ee959 Merge "init: fix clang-tidy performance issues" 2019-07-12 18:49:49 +00:00
Treehugger Robot
bde9fc1787 Merge "fs_mgr: overlay: do not allow sub-mounts to be overridden" 2019-07-12 18:38:39 +00:00
Daniel Norman
08c1556641 Merge "Checks the interface inheritance hierarchy in init_rc files."
am: 4b505fe3a8

Change-Id: Ic479fb46d293260589154c6ce0bf844952c8dd26
2019-07-12 11:32:48 -07:00
Daniel Norman
4b505fe3a8 Merge "Checks the interface inheritance hierarchy in init_rc files." 2019-07-12 18:01:46 +00:00
Tom Cherry
da80b0debc Merge "init: Write the reason in BCB on "reboot recovery""
am: e7a010de01

Change-Id: I3c627e207396e754b56a00d6919ef5a8c2b459b7
2019-07-12 10:54:42 -07:00
Mark Salyzyn
3efb204d73 Merge "init: powerctl support and propagate longer canonical reboot reasons."
am: 5c296a0003

Change-Id: Ief8ece1dd4dda9315bc3d0b0213c518a1af2f721
2019-07-12 10:42:02 -07:00
Tom Cherry
e7a010de01 Merge "init: Write the reason in BCB on "reboot recovery"" 2019-07-12 17:39:32 +00:00
Treehugger Robot
5c296a0003 Merge "init: powerctl support and propagate longer canonical reboot reasons." 2019-07-12 17:37:25 +00:00
Steven Moreland
4f8a4b095d Merge "libutils: remove references to unimplemented func"
am: 67a0dd4e27

Change-Id: I5d7f1e8f3fa31054338973f1c66f2d56fddc1428
2019-07-12 10:11:35 -07:00
Steven Moreland
1c9abb85cb Merge "libadbd_services: remove unused deps"
am: a1821e13f3

Change-Id: I8ebee3fde274c70f60b3419c3dc920de51a87213
2019-07-12 10:10:55 -07:00
Steven Moreland
67a0dd4e27 Merge "libutils: remove references to unimplemented func" 2019-07-12 16:48:04 +00:00
Steven Moreland
a1821e13f3 Merge "libadbd_services: remove unused deps" 2019-07-12 16:36:16 +00:00
Suren Baghdasaryan
0082ef15cf lmkd: Prevent non-main threads being registered or killed by lmkd
Only thread group leaders should be registered with lmkd. Add a check to
ignore any non-leader TIDs and generate an error if such condition is
detected. Run the same check before killing a process to detect cases of
non-leader TIDs being used to kill a process. This might happen if PIDs
overflow and previously registered PID gets reused for a non-leader
thread in the following scenario:

1. pid X is a thread group leader and is registered with lmkd
2. pid X dies without lmkd knowing it and pid gets recycled
3. process Y creates a thread with tid X
4. lmkd kills pid X which results in process Y being killed

Bug: 136408020
Test: lmkd_unit_test
Change-Id: I46c5a0b273f2b72cefc20ec59b80b4393f2a1a37
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-07-12 15:11:54 +00:00
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
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
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
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
e0b1eb8d65 Merge "Rename product_services to system_ext"
am: 6da50e319c

Change-Id: If9eaecca2382b3ace74ae721e80d51c79bb9b0fb
2019-07-11 00:15:28 -07:00
Justin Yun
6da50e319c Merge "Rename product_services to system_ext" 2019-07-11 05:36:23 +00: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
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
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
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
b0bfb3bb07 Merge "Remove an ancient spam-busting hack from logd."
am: e05c799c47

Change-Id: I3a964569fa96eba1d3c8815b0831bbe7031b1a97
2019-07-09 14:11:35 -07:00