Commit Graph

52589 Commits

Author SHA1 Message Date
Christopher Ferris d128dccddf Fix unwind_reg_info tool.
I was using the pc as the offest into the elf. That is obviously not
correct. Added an optional OFFSET argument like in unwind_info along
with this change.

Test: Verified that with no offest works, verified with a zero offset
Test: works, verified with a non-zero offset results in a bad elf
Test: on an elf without an offset.
Change-Id: I4b6d02609627288e9f8a0eb26988d03adf95cb1f
2019-08-27 13:41:50 -07:00
Haibo Huang f4c3471d22 Include chrono.h
Upstream merged time.h into chrono.h

Test: build
Change-Id: Iadbdfa4902ddd2dd38ee1dba51ef59def54130e4
2019-08-27 20:38:14 +00:00
Alessio Balsini 29b30cba04 Merge "libsnapshot: use DeleteDeviceIfExists() when required"
am: f8d80b7d56

Change-Id: I1a8f2509fd8390e5656b09a3ac1c6dc16bf4c11e
2019-08-27 13:16:06 -07:00
Treehugger Robot f8d80b7d56 Merge "libsnapshot: use DeleteDeviceIfExists() when required" 2019-08-27 19:59:13 +00:00
Paul Lawrence 1f3a8c4fc7 Merge "Fix ext4/metadata/udc issue"
am: 8c8ce02e2e

Change-Id: Ic1dd99dfdf886e36f0e1de2638202ca406354267
2019-08-27 08:44:55 -07:00
Paul Lawrence 8c8ce02e2e Merge "Fix ext4/metadata/udc issue" 2019-08-27 15:21:58 +00:00
Tom Cherry f7e1b1ebd4 liblog: only allow one transport for reading
liblog has left over code from local_logger that allows for reading
from multiple sources and merging the contents.  Since we've already
removed local_logger, this change removes the rest of this code.

Test: liblog-unit-tests
Change-Id: I5685ad6c1e7cbcaa0a660ed10f47714784a40791
2019-08-26 19:50:32 -07:00
Paul Crowley 88dc450050 Merge changes I1c1445ba,Ic0c8b163
am: 309d6dde31

Change-Id: I692405863f30006ff23c339efc0469d4ac71fd48
2019-08-26 19:33:00 -07:00
Paul Crowley 309d6dde31 Merge changes I1c1445ba,Ic0c8b163
* changes:
  Straighten out do_mkdir
  Convert fscrypt_set_directory_policy to C++
2019-08-27 02:26:25 +00:00
Yifan Hong 7309acb536 Merge "init: Add first-stage init support for snapshot-based partitions."
am: 8d168c3321

Change-Id: I7d1adcbb55f842b3bba0eee4caa4345b747a903d
2019-08-26 19:21:04 -07:00
Yifan Hong 2a7592bfb8 Merge "libsnapshot: Add helper for first-stage init mounting"
am: ee9b49d729

Change-Id: Id35392b3366503bf6f2e25974e132e8c78323fd1
2019-08-26 19:20:57 -07:00
Yifan Hong 8d168c3321 Merge "init: Add first-stage init support for snapshot-based partitions." 2019-08-27 01:56:41 +00:00
Yifan Hong ee9b49d729 Merge "libsnapshot: Add helper for first-stage init mounting" 2019-08-27 01:56:41 +00:00
Inseob Kim a0ff368b61 [automerger skipped] Merge "Implement sysprop_library API stability check"
am: f3204cbd27 -s ours
am skip reason: change_id I6b95eebafaf88ad326be5d7c890e000cbdb79cb5 with SHA1 34114e3df3 is in history

Change-Id: Ie71c39a4079057391068ec375ba6eafa54194381
2019-08-26 18:14:44 -07:00
Paul Crowley fa7d1f9e3e Merge "Move fscrypt_init_extensions into system/core"
am: e3cd3badbd

Change-Id: I56a5b30770ffec8a1a0af4f6f93c2597c5bd1564
2019-08-26 18:03:08 -07:00
Paul Crowley e7812e6787 Merge "Create the rollback directories in init"
am: 7a0948f6c4

Change-Id: Iee1c67c81b5809c645c35211431f5c003c07b167
2019-08-26 17:50:47 -07:00
Treehugger Robot f3204cbd27 Merge "Implement sysprop_library API stability check" 2019-08-27 00:44:34 +00:00
Tom Cherry 8efca4bbb3 Reland: "init: run property service in a thread"
It's been a long standing issue that init cannot respond to property
set messages when it is running a builtin command.  This is
particularly problematic when the commands involve IPC to vold or
other daemons, as it prevents them from being able to set properties.

This change has init run property service in a thread, which
eliminates the above issue.

This change may also serve as a starting block to running property
service in an entirely different process to better isolate init from
handling property requests.

Test: CF boots, walleye boots, properties are set appropriately
Change-Id: I13b8bf240c9fcb1d2d5890a8be2f0ef74efd4adf
2019-08-26 17:08:41 -07:00
Treehugger Robot e3cd3badbd Merge "Move fscrypt_init_extensions into system/core" 2019-08-26 23:24:54 +00:00
Treehugger Robot 7a0948f6c4 Merge "Create the rollback directories in init" 2019-08-26 23:24:49 +00:00
Tom Cherry 60cc6b2126 Merge "liblog: enable tests accidentally disabled"
am: a033693a9e

Change-Id: I426c9e3b777f0db978333053b2cf7a5960115b78
2019-08-26 15:50:14 -07:00
Tom Cherry 8180b48c4c init: send property_set failures to the audit netlink socket
Bug: 139816248
Test: see audit messages for failed property set during property file
      reading

Change-Id: I2b6a0448aa4cb494e924070928b0fd0eb5d5c998
2019-08-26 14:53:18 -07:00
Tom Cherry a033693a9e Merge "liblog: enable tests accidentally disabled" 2019-08-26 21:08:32 +00:00
Tom Cherry 80d537b704 Merge "Revert "init: run property service in a thread""
am: eb94026231

Change-Id: Id97fd03b7b00f089075681e0077f1536ae830932
2019-08-26 12:58:54 -07:00
Tom Cherry eb94026231 Merge "Revert "init: run property service in a thread"" 2019-08-26 19:47:02 +00:00
David Anderson 707454af45 Merge "liblp: Expose MockPropertyFetcher for liblp-dependent tests."
am: e0b2b759fa

Change-Id: I0e876e82241d9ad3a8d4b7c66025d30d40bbe81c
2019-08-26 12:34:01 -07:00
David Anderson e0b2b759fa Merge "liblp: Expose MockPropertyFetcher for liblp-dependent tests." 2019-08-26 19:13:49 +00:00
Paul Crowley 1b4e7328ad Straighten out do_mkdir
Use lstat(), and then make only the system calls needed to fix the
directory up.

Bug: 140027478
Test: boots twice, no worrying log messages.
Change-Id: I1c1445baae3ec1c1ce17626ede388aa04d5f7781
2019-08-26 12:06:59 -07:00
Yifan Hong cedf283ddf Merge changes from topic "liblp_test_static_rename"
am: 8d0c132ab9

Change-Id: Icca40abffe60cd4b634be703b61d34048533fe21
2019-08-26 12:02:41 -07:00
Paul Crowley 285e5d6d08 Convert fscrypt_set_directory_policy to C++
Bug: 140027478
Test: compiles, boots
Change-Id: Ic0c8b163fe37b11787cab49cc2eea38a1de377e9
2019-08-26 11:55:36 -07:00
Yifan Hong 8d0c132ab9 Merge changes from topic "liblp_test_static_rename"
* changes:
  rename liblp_test_static to vts_kernel_liblp_test.
  Add liblp_test to presubmit.
2019-08-26 18:35:45 +00:00
Paul Crowley 052f31c678 Move fscrypt_init_extensions into system/core
Bug: 140027478
Test: treehugger
Change-Id: I9f8b76a501be0b261b6fdd1da98447601e0fd32b
2019-08-26 10:33:17 -07:00
Tom Cherry f451426205 Revert "init: run property service in a thread"
This reverts commit 26f5e7da3a.

Reason for revert: bluecross boot stability issue

Bug: 140009641
Change-Id: I7ddb9509dfb2c6f644037129aa9d3fb9ff1740aa
2019-08-26 16:33:40 +00:00
Tom Cherry e54366ebb1 Merge "logd: Allow setDropped() to be called on already dropped messages"
am: 2f6d4edaf7

Change-Id: Ibf3fc183241816be2687fe95da4d024cbc929f62
2019-08-26 08:51:50 -07:00
Tom Cherry 2f6d4edaf7 Merge "logd: Allow setDropped() to be called on already dropped messages" 2019-08-26 15:27:45 +00:00
Paul Crowley 8184d7c2a5 Create the rollback directories in init
Init sets the encryption policy on these directores when created.

Bug: b/139193659
Test: Boot device without this, then try to boot with it without wiping.
Cherrypicked-From: 7bf42f148a
Change-Id: I6b26710674b51d62fa4a07b06e06c539571fb7ac
Merged-In: I6b26710674b51d62fa4a07b06e06c539571fb7ac
2019-08-25 11:24:40 -07:00
Christopher Ferris fa6964252c Merge "Add ReadMapFileAsyncSafe function."
am: db6f3945a9

Change-Id: Id4c86eb1828cbca5704468b16824b571ff8dd35b
2019-08-24 01:22:18 -07:00
Hridya Valsaraju 7415da6a05 Merge "Do not access ext_csd register in debugfs from storaged"
am: 3e80af1d12

Change-Id: I5c8aee6b4e98211758e32898362e0675ca213286
2019-08-24 01:21:24 -07:00
Christopher Ferris db6f3945a9 Merge "Add ReadMapFileAsyncSafe function." 2019-08-24 04:12:42 +00:00
Treehugger Robot 3e80af1d12 Merge "Do not access ext_csd register in debugfs from storaged" 2019-08-24 01:04:34 +00:00
Tom Cherry 1bc130184c liblog: enable tests accidentally disabled
Some tests were meant to be run with logd only and were ifdef'ed based
on USING_LOGGER_DEFAULT.  Unfortunately a previous change removed the
appropriate #define, so these tests weren't being run at all.  They
passed multiple times on CF, so they should still be stable.

Except for one test for __android_log_event_list.  We removed that
struct, so this change removes the test as well.

Test: liblog-unit-tests on CF (5 runs)

Change-Id: Ifaf3dbfdc5c714aead3f26c333e9cf19a1ed86c6
2019-08-23 15:28:17 -07:00
Tom Cherry be0f4abfaf logd: Allow setDropped() to be called on already dropped messages
rprichard@ pointed out a bug where LogBufferElement::setDropped()
reallocates mMsg to the size of mMsgLen in the case where getTag() !=
0.  However, mMsgLen is in a union with mDroppedCount and
mDroppedCount is the value used when a message is already dropped.
Therefore, it's possible that logd uses the wrong value and allocates
much more memory than intended.

We do call setDropped() on elements that have already been dropped in
LogBufferElementLast::coalesce(), so this is not a superfluous issue.

To simplify this even more, this code puts an mTag in a union with
mMsg, such that if mDropped is true, there will never be an allocated
message; mTag will be directly referred to instead.  This also reduces
the number of allocations needed very slightly.

Test: logd/liblog/logcat unit tests.
Change-Id: Ia1bfba076439fe31c745a243283d41902bca45ac
2019-08-23 14:58:14 -07:00
David Anderson cd7a635dc7 liblp: Add an attribute to indicate that a partition has been updated.
When the bootloader (or fastbootd) flashes the super partition, we need
to make sure that init doesn't re-map any snapshot or snapshot-merge targets.
A simple way to do this is to introduce an attribute that is only added
by update_engine. When this flag is present, we know the partition has
not been flashed.

This bumps the minor version of LpMetadata. To make this as uninvasive
as possible, the new minor version is only used when MetadataBuilder
detects the new attribute. The new liblp can read older metadata, but will
reject it if it contains an illegal attribute set.

Bug: 139154795
Test: liblp_test gtest
Change-Id: I5ae15d11219b41575a9f71d7dbdb43cbf07a3529
2019-08-23 14:44:52 -07:00
David Anderson 9966699af7 liblp: Expose MockPropertyFetcher for liblp-dependent tests.
Bug: 139154795
Test: liblp_test_static builds
Change-Id: I22b15523a32272ed67a8fe16e386f41b3fcf0bb0
2019-08-23 14:44:51 -07:00
David Anderson 9267c3f5c4 libsnapshot: Add helper for first-stage init mounting
With this patch, init can mount snapshots in the first stage by
performing the following operations:
 1. First, check if SnapshotManager::kBootIndicatorPath exists.
 2. If so, call SnapshotManager::NewForFirstStageMount.
 3. If NeedSnapshotsInFirstStageMount returns true,
 4. Call CreateLogicalAndSnapshotPartitions().

When called, this replaces any calls to CreateLogicalPartitions().

Rather than split this into multiple functions (to generate uevents as
needed), we instead use major:minor strings for device-mapper tables.
This means we don't have to wait for paths to resolve.

Bug: 139204329
Test: libsnapshot_test gtest
Change-Id: Ia7ec196a62e51748d6f01a66fe4e9eef25f2898f
2019-08-23 14:42:05 -07:00
Yifan Hong 3a136e58e3 rename liblp_test_static to vts_kernel_liblp_test.
Test: builds
Change-Id: I708ecef257b806c29a7f1e6108d91f52b2ed4241
2019-08-23 13:58:47 -07:00
Yifan Hong fd659bdfed Add liblp_test to presubmit.
Create a new test binary, liblp_test, that can run on presubmit.

Bug: 138328907
Test: TH
Test: atest liblp_test

Change-Id: I968ff84078524e5733da9b009d9a7222aad299bd
2019-08-23 13:58:47 -07:00
Christopher Ferris 3bae40b279 Add ReadMapFileAsyncSafe function.
This is a function designed so that it doesn't do any allocations.
It's purpose is for testing allocation related code where doing an
allocation can disturb the test.

Added unit tests for the new code that disable memory allocations
before running.

Also, made the tests run in isolation mode since I added a bunch of
tests and this will keep the total runtime about the same as
before.

Bug: 137795072

Test: All unit tests pass.
Change-Id: I7645f1e9f88cdfbc57c8eebce80199b9cfae64c1
2019-08-23 10:07:44 -07:00
Xin Li d62c31d3ac DO NOT MERGE - Merge build QP1A.190711.019 into stage-aosp-master
Bug: 139893257
Change-Id: Ib69c986e30b903cc48ca835fb307acf569930806
2019-08-23 06:45:26 +00:00
Xin Li 750fac4ed5 DO NOT MERGE - Merge build QP1A.190711.001 into stage-aosp-master history
Bug: 139893257
Change-Id: Iec16ca66c6149d2502f0a3f5777e5137d5c52a99
2019-08-23 06:42:12 +00:00