Commit graph

36052 commits

Author SHA1 Message Date
Mark Salyzyn
cfed5e795a Merge "init+bootstat: reduce last reboot reason to canonical alias"
am: 613a5a97e0

Change-Id: I3217fe94b0b3637521ef3a9f455124155001dd0d
2017-10-10 19:26:14 +00:00
Mark Salyzyn
613a5a97e0 Merge "init+bootstat: reduce last reboot reason to canonical alias" 2017-10-10 19:18:19 +00:00
Mark Salyzyn
6290982ee3 init+bootstat: reduce last reboot reason to canonical alias
To make parsing easier for last reboot reason.  This also ensures that
last boot reason matches the content that is typically returned by the
bootloader or in turn landed in the canonical system boot reason.

Simplify parsing in bootstat.  Adjust and fix boot_reason_test.sh for
new reality.  Allow boot reason tests battery and kernel_panic to pass
if device does not support pstore (empty before and after the test).
If device somehow landed in fastboot mode while waiting for the
display, issue a fastboot reboot to move the test along.  Some cleanup
and standardization changes to the test script.

Test: system/core/bootstat/boot_reason_test.sh
Bug: 63736262
Change-Id: I97d5467c0b4a6d65df3525f1a2d0051db813d5ad
2017-10-10 09:37:59 -07:00
Nick Kralevich
7e772f8194 Merge "set O_CLOEXEC on /dev/ashmem"
am: be729702ae

Change-Id: Ib308d27bd05d9d824772ab76564b2ed1487e09d3
2017-10-09 22:59:32 +00:00
Treehugger Robot
be729702ae Merge "set O_CLOEXEC on /dev/ashmem" 2017-10-09 22:39:47 +00:00
Nick Kralevich
30046acdb2 set O_CLOEXEC on /dev/ashmem
Ensure FDs don't leak across exec() boundaries.

Test: builds and boots. No obvious issues.
Change-Id: I00347b489ddb146b9d33442626f0e89a6cf26551
2017-10-09 13:19:36 -07:00
Jeffrey Vander Stoep
ceb5dea905 Merge "Allow redeclaring typeattributes"
am: f8bc6cee3f

Change-Id: I119e687a3aaf397ac38365728f6bf9e7c24c1067
2017-10-08 04:08:45 +00:00
Jeffrey Vander Stoep
f8bc6cee3f Merge "Allow redeclaring typeattributes" 2017-10-08 04:02:55 +00:00
Jeff Vander Stoep
5e9ba3c50b Allow redeclaring typeattributes
Allows partners to add a new attribute definition to their public
policy without causing a compatibility failure with the AOSP system
image.

Bug: 67092827
Bug: 37915794
Test: build and boot aosp_sailfish with a new type declared in public
    policy.

Change-Id: I3899065affb6806ae9080e1a7dfa5a6f368370f0
2017-10-06 17:04:28 -07:00
James Hawkins
add19af4f7 Merge "libmetricslogger: Fix the out-of-sync proto IDs for boot reason."
am: 732003429e

Change-Id: Id6db3ff466099d18698c49d8452df44dec3d27b5
2017-10-06 21:41:54 +00:00
James Hawkins
732003429e Merge "libmetricslogger: Fix the out-of-sync proto IDs for boot reason." 2017-10-06 21:33:58 +00:00
James Hawkins
f01dbc30ef libmetricslogger: Fix the out-of-sync proto IDs for boot reason.
Long-term fix is to generate from proto directly. b/65625014

Bug: 67508816
Test: None
Change-Id: Ifa671fa5d3816807836fd18cd66a12a7caebb5a1
2017-10-06 14:30:08 -07:00
Tom Cherry
2f5b8bb3f0 Merge "init: use ro.init.subcontexts_enabled to enable subcontexts"
am: 99016bce92

Change-Id: If410f650dd67577957d653ecd0b1a1e5a45dd14a
2017-10-06 20:27:05 +00:00
Tom Cherry
99016bce92 Merge "init: use ro.init.subcontexts_enabled to enable subcontexts" 2017-10-06 20:12:53 +00:00
Mark Salyzyn
fc3f7ec5c3 Merge "bootstat: system_boot_reason does not handle reboot_<reason> case"
am: 0f058759b0

Change-Id: I455b85ffe3af699d5206a577931f87a2777a5779
2017-10-06 18:13:11 +00:00
Mark Salyzyn
0f058759b0 Merge "bootstat: system_boot_reason does not handle reboot_<reason> case" 2017-10-06 18:07:55 +00:00
Tom Cherry
79193a42e7 init: use ro.init.subcontexts_enabled to enable subcontexts
As SEPolicy is developed, use this property to enable/disable
subcontexts.

Bug: 62875318
Test: boot device with/without subcontexts
Change-Id: Ieb879836a71c72d4de1bb16514d083d52480bf9a
2017-10-06 10:37:09 -07:00
Christopher Ferris
791af78e96 Merge "Use Unwinder object for unwind tool."
am: 283ca30651

Change-Id: I33b8576799671c8ccc3923eaebfa95cbf6286df4
2017-10-06 17:17:01 +00:00
Christopher Ferris
283ca30651 Merge "Use Unwinder object for unwind tool." 2017-10-06 17:08:30 +00:00
Christopher Ferris
ae3b136506 Use Unwinder object for unwind tool.
Test: Ran unwind on arm and arm64 processes.
Change-Id: I8a2a3ed31482044fe51d7e0d8c7f5588d5aad81c
2017-10-05 16:05:44 -07:00
Mark Salyzyn
0af71a5327 bootstat: system_boot_reason does not handle reboot_<reason> case
Heuristic would translate reboot_<reason> to reboot._<reason>. Add
checking/squashing for leading comma (,) _or_ underscore (_).

Test: compile
Bug: 63736262
Change-Id: I7ef4930ec8c064a8151183ac08d292931a8584c8
2017-10-05 14:42:08 -07:00
Christopher Ferris
18d4e59725 Merge "Update the Unwinder object and add tests."
am: 9e6c11da18

Change-Id: I5f4ee3b7e87421d3c329b211d939ab054c72e3e1
2017-10-05 20:55:01 +00:00
Christopher Ferris
9e6c11da18 Merge "Update the Unwinder object and add tests." 2017-10-05 20:46:01 +00:00
Jaegeuk Kim
eacc9cd637 Merge "init/reboot: call MNT_FORCE at the last umount(2)"
am: 4e008547be

Change-Id: Ief5e62e385cf83198ad3c9de65131dace0a7c4ae
2017-10-05 20:38:10 +00:00
Jaegeuk Kim
4e008547be Merge "init/reboot: call MNT_FORCE at the last umount(2)" 2017-10-05 20:32:14 +00:00
Lorenzo Colitti
ebef33b85a Merge "Stop depending on libnl."
am: 445674ab7c

Change-Id: I1c8a454890cf33b4d04643db9efbea11570809a5
2017-10-05 09:47:03 +00:00
Treehugger Robot
445674ab7c Merge "Stop depending on libnl." 2017-10-05 09:41:23 +00:00
Lorenzo Colitti
e439ffc762 Stop depending on libnl.
We only use it for trivial functions. Replace them and drop the
dependency.

Bug: 67345547
Test: bullhead builds, boots
Test: CtsOsTestCases android.os.cts.StrictModeTest passes
Change-Id: I36254962284babdd1a55a32a76dd0dc92d85420c
2017-10-05 14:56:44 +09:00
Jaegeuk Kim
0f04f72c2d init/reboot: call MNT_FORCE at the last umount(2)
The last one will avoid errors=panic in ext4.

Test: Build
Bug: 63981945
Bug: 65481582
Change-Id: I9c86afcce441767e24fc43668ab1ff6230155a9f
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2017-10-04 19:30:49 -07:00
Christopher Ferris
f6f691b63c Update the Unwinder object and add tests.
Changes:
- Remove unused GetReturnAddressFromDefault function and tests.
- Modify the unwinder to stop when a pc/sp in a device map.
- Modify the unwinder to skip initial frames based on map names.
- Unit tests that exercise all of the paths in the unwinder code.
- Move the test Elf/ElfInterface objects into their own file.
- Update RegsFake to handle extra cases.
- Modify libbacktrace code to use this unwinder.

The new unwinder does not implement the ignore frame functionality since
this is not used very often and is better implemented using a skip frames
in named libraries functionality.

Test: Ran new unit tests, ran backtrace tests.
Change-Id: Ifd65e9acd66ac5e2d0e04bd32a9ad870b54610ff
2017-10-04 14:40:14 -07:00
Mark Salyzyn
8b8fc5cfae Merge "base: chrono_utils: supported in linux"
am: 142303b9d9

Change-Id: I30a7f0d41fbb48032d2c4133d34c185fedc292a5
2017-10-04 16:12:33 +00:00
Mark Salyzyn
142303b9d9 Merge "base: chrono_utils: supported in linux" 2017-10-04 15:55:56 +00:00
Jayant Chowdhary
b637860732 Merge "Make liblog headers compile stand-alone."
am: fe3551e9dc

Change-Id: I20b97d38d356f720c74954200f40b8315cdd0c21
2017-10-04 00:55:47 +00:00
Treehugger Robot
fe3551e9dc Merge "Make liblog headers compile stand-alone." 2017-10-04 00:49:55 +00:00
Tom Cherry
5c00898944 Merge "init: log failures if a service cannot start during class_start"
am: 533fbd62ab

Change-Id: I7a05ae9f806a23d04d649fb230e2875633b2caee
2017-10-03 22:42:51 +00:00
Elliott Hughes
510552149c Merge "Set $HOSTNAME in adbd."
am: 2364d7ccc5

Change-Id: I40ef480380f250540d6c2856721540400c599111
2017-10-03 22:32:13 +00:00
Treehugger Robot
533fbd62ab Merge "init: log failures if a service cannot start during class_start" 2017-10-03 22:03:33 +00:00
Elliott Hughes
2364d7ccc5 Merge "Set $HOSTNAME in adbd." 2017-10-03 21:57:49 +00:00
Mark Salyzyn
1f9fa7e907 base: chrono_utils: supported in linux
Tried to use this on host executable, and it always read back zero
for duration.  Expanded code to support any linux build.

Test: works on host
Bug: 38446744
Bug: 66912053
Change-Id: I4a2cbbfff3e7739b54cb6c6e877898de4d3d2296
2017-10-03 14:53:26 -07:00
Jayant Chowdhary
12f56a00d3 Make liblog headers compile stand-alone.
Test: process liblog headers individually with header-abi-dumper.

Test: mm -j64

Bug: 66971285

Change-Id: If7dec611b84eb9fa8e1e5a974b444d4ddf54759a
2017-10-03 14:06:33 -07:00
Tom Cherry
20acdef816 init: log failures if a service cannot start during class_start
Test: boot system with this logging and see appropriate failures
Change-Id: I312dca89f6215afe05b10b2539258a212a0c1ae2
2017-10-03 13:16:00 -07:00
Jayant Chowdhary
1511cbb439 Merge "Hide implementation details of log_time struct"
am: 541428a13b

Change-Id: I170a1f983e7752bb318973a30d761376ecff7f05
2017-10-03 20:05:15 +00:00
Jayant Chowdhary
541428a13b Merge "Hide implementation details of log_time struct" 2017-10-03 20:01:13 +00:00
Jiyong Park
0d047642eb Hide implementation details of log_time struct
In the future, the sizes of tv_sec and tv_nsec (or even the size of
log_time struct itself) can change due to the 32-bit overflow expected
to happen in the year 2138. In order to hide such implementation details
to the clients of liblog, the two macros LOG_TIME_SEC and LOG_TIME_NSEC
are introduced.

Furthermore, vendors are provided with a simplified version of log_time.h
without C++ APIs. In doing so, log_time.h no longer includes time.h.
This breaks several modules that implicitly relied on the hidden
dependency, which should be fixed.

Bug: 37629934
Test: build with BOARD_VNDK_VERSION=current

Merged-In: If213fc291395554fd8de5f5d1fb005ceaaa5ca57
Change-Id: I01b36078c1d8f3f44824be20ae769ba1465b6feb
(cherry picked from commit 98c0d030c9)
2017-10-03 17:45:17 +00:00
Elliott Hughes
ba4d9fd933 Set $HOSTNAME in adbd.
bash sets this itself, but mksh doesn't.

This also makes interactive and non-interactive adb shells more similar,
because when we set this in mkshrc that wouldn't affect non-interactive
shells. (I'm not sure whether this is an improvement or not.)

This is certainly _cheaper_ than doing this in mkshrc by calling out to
getprop though.

Bug: N/A
Test: `adb shell printenv` and `adb shell`, `printenv`
Change-Id: I3ff724f19a5098313df83836253f1f7e7872d6a4
2017-10-03 08:44:27 -07:00
Dan Willemsen
348a082469 Merge changes from topic "linux_glibc"
am: 7b3d4da91a

Change-Id: I1cb69992882db5a265234ac808d408f1f136f0e5
2017-10-03 03:03:52 +00:00
Dan Willemsen
0a3b1d31ab Move host flags from linux -> host
am: cd58088ccf

Change-Id: If60258b3bf78cd9ed1c9b9dcbfb2d7bfa650d10d
2017-10-03 02:58:52 +00:00
Dan Willemsen
7b3d4da91a Merge changes from topic "linux_glibc"
* changes:
  Rename target.linux[_x86[_64]] to target.linux_glibc[_x86[_64]]
  Move host flags from linux -> host
2017-10-03 02:30:06 +00:00
Tom Cherry
71b2c17ba7 Merge "init: fix subcontext SELinux strings"
am: 60bd9ca592

Change-Id: I084da99db1fdc90aa0db276dd5bc755179b83713
2017-10-03 02:05:50 +00:00
Treehugger Robot
60bd9ca592 Merge "init: fix subcontext SELinux strings" 2017-10-03 01:57:38 +00:00