Commit graph

46732 commits

Author SHA1 Message Date
Josh Gao
d659bb49be Merge "adbd: cleanups in remount/verity."
am: 98efc485de

Change-Id: Ideadb9d6633d5529710932e849bdf3a4bc9a9999
2019-03-06 18:37:26 -08:00
Josh Gao
98efc485de Merge "adbd: cleanups in remount/verity." 2019-03-07 02:32:42 +00:00
Sudheer Shanka
5a8d603d9d Merge "Allow callers to pass a flag to not link obb dirs of multiple users."
am: 0c8b8af74a

Change-Id: I49f1f35d1033655664a5b335351921f6a286d9e7
2019-03-06 16:46:51 -08: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
9130f5c950 Merge "mkbootimg: extract to 'second' if size not 0"
am: a3d394e9bb

Change-Id: I0c4fdf31f94e841cdfb00df12845157d9ac750b8
2019-03-06 14:53:04 -08:00
Tao Bao
a3d394e9bb Merge "mkbootimg: extract to 'second' if size not 0" 2019-03-06 22:43:33 +00:00
Mark Salyzyn
492ae86814 Merge changes I3506c8e7,I198c0e8c,I8a5d4e36
am: 6bd04c1570

Change-Id: If0bf047ecc94463415455ad48e82390dbef6b8a4
2019-03-06 14:40:21 -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
Jiyong Park
7c8576d435 Merge "Access apex sysprops via the generated API"
am: 51deeb569f

Change-Id: I7424032df0258fae058ee87faeb52b672cb8bc1b
2019-03-06 09:51:44 -08:00
Treehugger Robot
51deeb569f Merge "Access apex sysprops via the generated API" 2019-03-06 17:38:46 +00:00
Florian Mayer
7e345a00a1 Merge "Fix copy / move behaviour of Maps object."
am: 30c898f1ca

Change-Id: I7912a4c29393b7e0fb0e1e26c09160989f8544f2
2019-03-06 08:46:39 -08: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
e4c58c492c Merge "Use distinct GateKeeper userids when running a GSI."
am: 5a465412b1

Change-Id: Ic4e18aa3253a6b5d00e441a47b025e1a2b09cf24
2019-03-05 19:22:10 -08:00
David Anderson
5a465412b1 Merge "Use distinct GateKeeper userids when running a GSI." 2019-03-06 02:40:03 +00:00
Matthew Maurer
71e96ea355 Merge "Clang-format before updating storage proxy"
am: 2d85880b49

Change-Id: I4326644ebc3f14c72c97c9fdb279026d97aee0ac
2019-03-05 17:25:11 -08:00
Treehugger Robot
2d85880b49 Merge "Clang-format before updating storage proxy" 2019-03-06 00:53:25 +00:00
David Anderson
461c245b2e Merge "Support FiemapWriters that extend across multiple files."
am: 925c78b7e8

Change-Id: I669d3955b3fd704ad14d6cb276120d0f3d0c8f11
2019-03-05 16:38:06 -08:00
David Anderson
90c7e99998 Merge "Add more filesystem support to libfiemap_writer."
am: 79a43cf135

Change-Id: Ib3c6d2515ae45aaf28db18a1bc1729bf0a074a66
2019-03-05 16:29:45 -08:00
Suren Baghdasaryan
efcab54b55 Merge "Add min_score_adj into LmkKillOccurred event"
am: a953ae0546

Change-Id: Ib1a35290221974736f86eda9db57e27e831a4813
2019-03-05 15:11:38 -08: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
Jim Blackler
962e0442d1 Add start time to LmkKillOccurred
This is to measure an application's behavior with respect to being LMKed
(the longer an app lives before being LMKed, the better).

Bug: 119854389
Test: Manual
Change-Id: I4ef6433391c8758626334731d2b5de038e4468ae
Merged-In: I4ef6433391c8758626334731d2b5de038e4468ae
(cherry picked from I4ef6433391c8758626334731d2b5de038e4468ae)
2019-03-05 11:53:17 -08:00
Rajeev Kumar
2bc24f88ca Read memory stats from /proc/pid/stat file.
(cherry pick from commit 0301683e49)
Bug: 117333340
Test: Manual testing using alloc-stress tool
Merged-In: Ie555933aafa6a6b7aa1dbf5518ebe804376e0afd

Change-Id: I8ab08606dba7de2f65711204453067dbfbdcbdd8
2019-03-05 11:53:14 -08:00
Mark Salyzyn
14fea4f7a2 Merge "fs_mgr: remount: add partition argument list"
am: 4c46285e2e

Change-Id: I343332051ac7a99822d940e5e3d69af12d541c0b
2019-03-05 10:20:12 -08:00
David Anderson
79a43cf135 Merge "Add more filesystem support to libfiemap_writer." 2019-03-05 18:14:53 +00:00
Suren Baghdasaryan
a953ae0546 Merge "Add min_score_adj into LmkKillOccurred event" 2019-03-05 18:06:46 +00:00
Mark Salyzyn
4c46285e2e Merge "fs_mgr: remount: add partition argument list" 2019-03-05 17:49:30 +00:00
Florian Mayer
3d67d347f5 Fix copy / move behaviour of Maps object.
Currently, moving or copying a Maps object leads to double free of MapInfo.

Even moving a Maps object  did not prevent this, as after a move
the object only has to be in an "unspecified but valid state", which can
be the original state for a vector of raw pointers (but not for a vector
of unique_ptrs).

Changing to unique_ptrs is the most failsafe way to make sure we never
accidentally destruct MapInfo.

Test: atest libuwindstack_test
      Failed LocalUnwinderTest#unwind_after_dlopen which also fails at master.

Change-Id: Id1c9739b334da5c1ba532fd55366e115940a66d3
2019-03-05 13:05:36 +00:00
Suren Baghdasaryan
ec5e4c6eb1 Add min_score_adj into LmkKillOccurred event
Log min_score_adj when lmkd kills a process to determine the oom_score
levels that lmkd considers during the kill.

Bug: 123024834
Change-Id: I986ae8f2808199b1654bc8d2a32dd88046c79aa3
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-03-05 09:51:06 +00:00
Jiyong Park
8502ed308d Access apex sysprops via the generated API
Bug: 125549215
Test: m
Change-Id: Ie9b0aa5eec5931da3512d77613b034e5bd760f3e
2019-03-05 16:22:55 +09:00
Jiyong Park
a192ff7ad3 Merge changes from topic "apex_earlymount_base"
am: c676cca4f6

Change-Id: I417eb7fffbaa2c495b8dc1c1c10e5683ebafcc84
2019-03-04 23:03:13 -08:00
Jiyong Park
854c5bc218 mount /apex during first_stage init
am: 4ba548d845

Change-Id: I2f86489449b0a81c4173981a8ffe1bcb945df129
2019-03-04 23:02:24 -08:00
Treehugger Robot
c676cca4f6 Merge changes from topic "apex_earlymount_base"
* changes:
  Activate system APEXes early
  mount /apex during first_stage init
2019-03-05 06:49:02 +00:00
Jiyong Park
dcbaf9f41b Activate system APEXes early
Summary: Boot sequence around apexd is changed to make it possible for
pre-apexd processes to use libraries from APEXes. They no longer need to
wait for the apexd to finish activating APEXes, which again can be
done only after /data/ is mounted. This improves overall boot
performance.

Detail: This change fixes the problem that processes that are started
before apexd (so called pre-apexd processes) can't access libraries
that are provided only by the APEXes but are not found in the system
partition (e.g. libdexfile_external.so, etc.). Main idea is to activate
system APEXes (/system/apex/*.apex) before /data is mounted and then
activate the updated APEXes (/data/apex/*.apex) after the /data mount.

Detailed boot sequence is as follows.

1) init prepares the bootstrap and default mount namespaces. A tmpfs is
mounted on /apex and the propagation type of the mountpoint is set to
private.

2) before any other process is started, apexd is started in bootstrap
mode. When executed in the mode, apexd only activates APEXes under
/system/apex. Note that APEXes activated in this phase are mounted in
the bootstrap mount namespace only.

3) other pre-apexd processes are started. They are in the bootstrap
mount namespace and thus are provided with the libraries from the system
APEXes.

4) /data is mounted. init switches into the default mount namespace and
starts apexd as a daemon as usual.

5) apexd scans both /data/apex and /system/apex, and activate latest
APEXes from the directories. Note that APEXes activated in this phase
are mounted in the default namespaces only and thus are not visible to
the pre-apexd processes.

Bug: 125549215
Test: m; device boots
Change-Id: I21c60d0ebe188fa4f24d6e6861f85ca204843069
2019-03-05 09:47:49 +09:00
Mark Salyzyn
bc0887add7 Merge "adb: use /system/bin/remount command"
am: d458066bc7

Change-Id: I0276c6488dd5d57475e6b73cf1fef5a00a2e75b8
2019-03-04 14:41:21 -08:00
Mark Salyzyn
d458066bc7 Merge "adb: use /system/bin/remount command" 2019-03-04 22:27:19 +00:00
Mark Salyzyn
f4e7422c65 fs_mgr: remount: add partition argument list
Can supply a specific partition to remount.  Partitions can be
specified by name or mount point.  Some extra work to differentiate
an unknown partition, invalid partition, or one that is covered by
overlayfs.

Test: adb-remount-test.sh
Bug: 122602260
Change-Id: Iab6f51c2b5ebe01f1cea3fb235445d5e2f495365
2019-03-04 11:13:05 -08:00
Mark Salyzyn
2f6c180749 adb: use /system/bin/remount command
Replace direct logic in support for 'adb remount' with an exec out to
/system/bin/remount to do the heavy lifting.  Remount success and
failure strings are reported by the adb remount service in response
to the various reported errors, freeing up the remount command itself
from the legacy of script expectations.

Test: adb-remount-test.sh
Bug: 122602260
Change-Id: I686fa465f463b881bbb38f709d780a95e463be80
2019-03-04 11:12:54 -08:00
David Anderson
f344d63222 Support FiemapWriters that extend across multiple files.
This introduces a new SplitFiemap class that will divide an allocation
request across multiple FiemapWriters. This is primarily useful on
filesystems that have onerous restrictions on maximum file sizes. Vfat,
for example, supports a maximum of 4GiB, which is too small to satisfy
larger userdata size requests.

Bug: 126230649
Test: fiemap_writer_test gtest
Change-Id: I3c95d341e4e94e0c44bbf0e8553c34ccfdcd155b
2019-03-04 10:08:55 -08:00
Felix
7334915cf5 Merge "ld.config: Permit legacy /system/vendor paths"
am: 6521bf3c98

Change-Id: If01c6a02f530b60167c1d29c5bf3c75befa531c9
2019-03-04 05:07:39 -08:00
Treehugger Robot
6521bf3c98 Merge "ld.config: Permit legacy /system/vendor paths" 2019-03-04 12:58:11 +00:00
Jiyong Park
4ba548d845 mount /apex during first_stage init
/apex is not mounted via init.rc but directly by the first_stage init
before the mount namespaces are configured.

This allows us to change the propagation type for /apex mount point to
private to isolate APEX activatesions across post- and pre-apexd
processes.

Bug: 125549215
Test: m; device boots to the UI

Change-Id: I10e056cd30d64cb702b6c237acd8dab326162884
2019-03-04 16:22:41 +09:00
Felix
9e40e12cea ld.config: Permit legacy /system/vendor paths
Because /vendor is a symlink to /system/vendor on devices without a
dedicated /vendor partition, /system/vendor/lib/* needs to be added to
the permitted paths whereever /vendor/lib/* is permitted.

Reasoning:
Legacy devices are forced to use ld.config.legacy.txt, which is very
permissive. We can prolong support for them and enable them to use the
VNDK if we extend the search paths to include the resolved symlink dirs.

Change-Id: I6b3bb7b86ed82395345a16bdc857353b1b15c704
2019-03-03 14:31:37 +01:00
Petri Gynther
05e32cf544 Merge "toolbox: make "r" available for /vendor"
am: bc6372103a

Change-Id: Ib55339d168808e2593748efe1aea573a56b3beb5
2019-03-02 23:30:27 -08:00
Petri Gynther
bc6372103a Merge "toolbox: make "r" available for /vendor" 2019-03-03 07:20:04 +00:00