Commit Graph

42880 Commits

Author SHA1 Message Date
Tom Cherry 018a438ff0 init: use rvalues references for callees of ParseLineSection()
ParseLineSection() provides 'args' as an rvalue reference, so its
callers can and should use it as such.  This saves some copying
overhead and cleans up the code a bit.

Test: boot
Change-Id: Ib906318583dc81de9ea585f5f09fdff35403be1b
2018-10-17 11:30:53 -07:00
Treehugger Robot 4bc53d20af Merge "liblp: Add partitions to the correct group when writing LpMetadata." 2018-10-17 01:54:09 +00:00
Elliott Hughes 86c56953b3 Merge ""utils/Errors.h": include <stdint.h> for `int32_t`." 2018-10-17 00:53:40 +00:00
Treehugger Robot 03ea74aa91 Merge "Adding /odm/usr -> /vendor/odm/usr symlink" 2018-10-17 00:20:07 +00:00
Treehugger Robot 30793ac5fa Merge "liblp: Remove last_logical_sector from LpMetadataGeometry." 2018-10-16 23:41:42 +00:00
David Anderson 875434618f liblp: Add partitions to the correct group when writing LpMetadata.
The group_indices variable was intended to facilitate this, but I forgot
to actually use it.

Bug: 116817738
Test: lpmake, lpdump super_empty.img
Change-Id: Ia0da50b56b6c09e277324ec9d7aea6ce48fdc10a
2018-10-16 15:30:05 -07:00
Tom Cherry 89bf115a70 Merge "init: separate init packaging for mainline" 2018-10-16 20:29:47 +00:00
Elliott Hughes 9fbebc5d55 "utils/Errors.h": include <stdint.h> for `int32_t`.
No need for a Unix/Windows difference here.

Bug: N/A
Test: builds
Change-Id: If7b27f939f9c13ef336d2015608f2a24db8cc96d
2018-10-16 13:17:15 -07:00
Treehugger Robot 618be4c225 Merge "lmkd: increase the soft limit for keyboard" 2018-10-16 20:12:27 +00:00
Srinivas Paladugu 3eb20bc954 lmkd: increase the soft limit for keyboard
lmkd sets the soft limit parameters for Go devices.
The limit for apps in the perceptible group is set to 16M.
However this limit is not sufficient for the keyboard app to
prevent pages from being re-claimed quickly. The mem usage of
the keyboard app is around 55M most cases with some occasional
spikes to 70-80M. Increasing the limit to 64M improves the warm
startup latency for keyboard. It is still lower than the limits
set for foreground and visible apps.

Test: Go device (1G)
Bug: 117517805
Merged-In: Id50e49327cfd76126e41ef6503971845f29196af
Change-Id: Id50e49327cfd76126e41ef6503971845f29196af
2018-10-16 18:58:01 +00:00
Treehugger Robot da915b4af3 Merge "Rename vbmeta_mainline to vbmeta_system." 2018-10-16 18:34:18 +00:00
Tom Cherry 29e5348f18 init: separate init packaging for mainline
With system-as-root, both first and second stage init belong to
system, but without system-as-root, first stage belongs to vendor and
second stage belongs to system.  This change creates two phony
packages to achieve this correctly in the build system.

Bug: 117606184
Test: mainline builds work properly
Change-Id: I19263e76c217c2e70bc06c180be3a460e9144f18
2018-10-16 09:49:00 -07:00
Tom Cherry ce27a5bc0f Merge "init: clarify some text/README about 'critical' services" 2018-10-16 16:38:42 +00:00
Bowgo Tsai 15f872aee4 Adding /odm/usr -> /vendor/odm/usr symlink
Bug: 112880217
Test: build and checks symlink is created
Change-Id: Ib9635fc1cd425664cfa8f79d8f034f3cb615cbbc
2018-10-16 18:24:08 +08:00
Treehugger Robot 379bd47301 Merge "Reset statsd writer to init state after close" 2018-10-16 02:29:27 +00:00
Treehugger Robot 42a2e9eb27 Merge "Add adb_integration_test_device to general-tests" 2018-10-16 02:26:57 +00:00
Treehugger Robot 8e842dd365 Merge "Call markBootAttempt when serice manager available" 2018-10-16 01:45:51 +00:00
Treehugger Robot 1ffe0ccc70 Merge "rootdir: add ccross to OWNERS." 2018-10-16 00:24:41 +00:00
Tom Cherry ad9e7eaf2d init: clarify some text/README about 'critical' services
'Critical' services have rebooted into bootloader, like all other
catastrophic init crashes, for years now.  Update the text to match.

Test: n/a
Change-Id: Icfc41bf3e383958f14ecfaab9ca187e2c3dc7fd9
2018-10-15 17:21:48 -07:00
Ryan Prichard c394f7f7ac Merge "Change ZipArchiveHandle from void* to ZipArchive*" 2018-10-15 23:23:29 +00:00
Yao Chen 763e3aee42 Reset statsd writer to init state after close
Bug: 117796113
Test: locally tested and verified stats logs can write to statsd again.
Change-Id: I33b006199d23f851ff1a6e49445fb16d74223062
2018-10-15 16:12:48 -07:00
Daniel Rosenberg 6156b9b8ba Call markBootAttempt when serice manager available
This causes adds a call the fucntion to decrement the
checkpoint's retry count as soon as service manager is
available.

Test: vdc setCheckpoint 2 then reboot 3 times checking state
Bug: 112901762
Change-Id: Ie0a78b1eb05b340718e76175509d1ebefae68017
2018-10-15 22:16:19 +00:00
David Anderson 166bfef4e6 Rename vbmeta_mainline to vbmeta_system.
Bug: 116859651
Test: fastboot flash vbmeta_system
Change-Id: Ice65b6f5141ec6da3e1c91d6a3aac58533dc2314
2018-10-15 14:48:00 -07:00
Elliott Hughes 4b38722c12 rootdir: add ccross to OWNERS.
Bug: N/A
Test: N/A
Change-Id: I285f66a69fa86e03cfc213abc2fe85e938f849df
2018-10-15 14:18:04 -07:00
Treehugger Robot 83093e7ef8 Merge "init: clarify multiple 'interface' keyword use" 2018-10-15 21:10:43 +00:00
Treehugger Robot 0df9231dfd Merge "llkd: Do not check apexd by default for stack" 2018-10-15 20:33:42 +00:00
Suren Baghdasaryan 79e5b550ce Merge "lmkd: Implement pid purge command to clear old pids when zygote restarts" 2018-10-15 19:47:54 +00:00
Steven Moreland 48aed8f02d init: clarify multiple 'interface' keyword use
This keyword can (and should) be used multiple times when multiple
services are served together. I've documented this here.

Bug: N/A
Test: N/A
Change-Id: Ie986c9cac486db346555f359e9ccbed93d8d1d22
2018-10-15 18:00:36 +00:00
Tom Cherry 6e52c23a3e Merge "logd: rework logic for LogTimeEntry" 2018-10-15 17:57:06 +00:00
Suren Baghdasaryan e3b6047e0d lmkd: Implement pid purge command to clear old pids when zygote restarts
lmkd keeps a list of pids registered by ActivityManager, however on rare
occasions when framework restarts and lmkd survives that list has to be
purged. Implement a command that can be used to clear the pid list.

Bug: 116801366
Test: locally by killing zygote process
Change-Id: I71d6012f86bb83a73edd5b687e05a0848e0569b1
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-10-15 16:22:17 +00:00
Nick Kralevich 5390b9add4 llkd: Do not check apexd by default for stack
apexd is now blocked by sepolicy, so skip checking it to
prevent an avc warning.

See system/sepolicy commit ac097ac4c7718f8593f2b6b96a93a776984ec7c4

Addresses the following SELinux denial:

type=1400 audit(0.0:386): avc: denied { ptrace } for comm="llkd" scontext=u:r:llkd:s0 tcontext=u:r:apexd:s0 tclass=process permissive=0

Test: manual
Change-Id: Iad24447c8200e915ac8397a8f84923feebc20613
2018-10-15 09:17:40 -07:00
Christopher Ferris 6853a187e3 Merge "Fix up the definition of Elf::GetInfo." 2018-10-13 17:47:18 +00:00
Christopher Ferris 9074871af2 Merge "Fix problem adding too many frames." 2018-10-13 17:47:12 +00:00
Tom Cherry 4f22786cc9 logd: rework logic for LogTimeEntry
LogTimeEntry's lifecycle is spread out in various locations.  It
further seems incomplete as there is logic that assumes that its
associated thread can exit while the underlying LogTimeEntry remains
valid, however it doesn't appear that that is actually a supported
situation.

This change simplifies this logic to have only one valid state for a
LogTimeEntry: it must have its thread running and be present in
LastLogTimes.  A LogTimeEntry will never be placed into LastLogTimes
unless its thread is running and its thread will remove its associated
LogTimeEntry from LastLogTimes before it has exited.

This admittedly breaks situations where a blocking socket gets issued
multiple commands with different pid filters, tail lines, etc,
however, I'm reasonably sure that these situations were already
broken.  A check is added to close the socket in this case.

Test: multiple logcat instances work, logd.reader.per's are cleaned up
Change-Id: Ibe8651e7d530c5e9a8d6ce3150cd247982887cbe
2018-10-12 18:28:59 -07:00
Christopher Ferris 9d0ad238ca Fix problem adding too many frames.
When adding a frame with a dex pc, two frames will be added total. However,
if there is only enough room for a single frame, two get added any way.

Only add a single frame in this case, and add a unit test for this case.

Test: Passes unit tests.
Change-Id: If320584b126967a042c623d8fdf3f51dbc1c2251
2018-10-12 16:36:35 -07:00
Evgenii Stepanov b3bc842750 Merge "Export HWASAN_OPTIONS when SANITIZE_TARGET:=hwaddress" 2018-10-12 21:45:56 +00:00
Suren Baghdasaryan 1f149d8d2a Merge "lmkd: Fix an invalid access to a pointer after it's freed" 2018-10-12 21:22:38 +00:00
Julien Desprez 618f0e11d6 Add adb_integration_test_device to general-tests
Run some more tests for adb.

Test: tradefed.sh run template/local_min --template:map test=atest --include-filter adb_integration_test_device --log-level VERBOSE --log-level-display verbose
Bug: 112104122
Change-Id: I44b5a2aed8d86ab2dca62081d5b3b05f6e01cabd
2018-10-12 13:48:14 -07:00
Treehugger Robot 0730260a6a Merge changes Ib244a98f,Ib173f251
* changes:
  liblp: Don't store BlockDeviceInfo separately in MetadataBuilder.
  liblp: Move backup sectors to the start of the partition.
2018-10-12 20:28:37 +00:00
David Anderson db29503b4d liblp: Remove last_logical_sector from LpMetadataGeometry.
Now that backup metadata is stored at the start of the super partition,
this field is no longer needed. In actuality, it was not needed even
before then: both it and first_logical_sector exist for convenience,
since they can be re-derived at any time given an LpMetadataGeometry.

Bug: 116802789
Test: liblp_test gtest
      device with dynamic partitions flashes and boots

Change-Id: I259a443097e689a0a9db7f822bbf1a52d40076dc
2018-10-12 13:05:12 -07:00
David Anderson a520c5e28b liblp: Don't store BlockDeviceInfo separately in MetadataBuilder.
There's no reason to do this, since the fields are already in
LpMetadataGeometry. Removing this also simplifies multiple-block-device
support.

Bug: 116802789
Test: liblp_test gtest
Change-Id: Ib244a98fdd9d36c94a2dffd81bef68a1d5644ab9
2018-10-12 13:05:12 -07:00
David Anderson 06f7a967be liblp: Move backup sectors to the start of the partition.
Previously, metadata backups were stored at the end of the partition to
make them easy to locate. On older devices where the super partition
could span system/vendor partitions, we may want to leave the end of
each partition free to store an AVB footer. To allow this, we now store
geometry and metadata backups near the start of the partition instead.
They are still positioned at a fixed offset.

Bug: 116802789
Test: device boots after flashing new metadata
Change-Id: Ib173f251a4a13e290adcc4ac5cfbeb030eacda30
2018-10-12 13:05:11 -07:00
Treehugger Robot 5c61dbd12c Merge "fs_mgr: overlay drop redundant check" 2018-10-12 19:51:11 +00:00
Christopher Ferris a2f38f1bde Fix up the definition of Elf::GetInfo.
The function should have returned a bool, so now it does.
Also use a different lighter weight function for validating the elf
in one place that didn't need to keep the max size value.

Test: Unit tests pass.
Change-Id: Ibde674e608091ba04abf22fad2fdc4dbdb2c6e73
2018-10-12 11:29:06 -07:00
Suren Baghdasaryan 0106327486 lmkd: Fix an invalid access to a pointer after it's freed
pid_remove() frees a structure representing registered process and the
pointer can't be used anymore. This change fixes an instance when pointer
was used after it was freed. pid_remove() is moved to the end of the
function and comments are added to prevent similar situation in the future.

Bug: 117625315

Change-Id: I6a922952a31232497b3f9caf87d5a21bd402db94
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-10-12 11:28:33 -07:00
Treehugger Robot c53a0e9158 Merge "liblp: Add a gtest for sparse image creation." 2018-10-12 15:18:47 +00:00
Minchan Kim d37dd4a6f0 Merge "export dumpstatez into stable_properties" 2018-10-12 07:23:23 +00:00
Josh Gao 58d5906be3 Merge "Revert "adb: don't close sockets before hitting EOF."" 2018-10-12 06:38:55 +00:00
Josh Gao faf1328a64 Revert "adb: don't close sockets before hitting EOF."
This reverts commit ffc11d3cf3.

Reason for revert: DeviceIdleFreqCheckTest failing

Bug: http://b/117630047
Change-Id: Ia51a4a30e785bc5b2526695de3f442aac298198f
2018-10-12 05:08:45 +00:00
Treehugger Robot 11cbf7d711 Merge "adb: add reboot-fastboot command" 2018-10-12 03:38:05 +00:00