Commit graph

36341 commits

Author SHA1 Message Date
Josh Gao
ef35aa5d40 unwindstack: rename Memory::Read to ReadFully.
Rename Memory::Read to ReadFully to match its semantics with that of
android::base. ReadPartially will be renamed to Read in a follow up
commit, kept intentionally separate so that there aren't any callers
accidentally switched from ReadFully to Read.

Test: treehugger
Change-Id: I7d845ac5244c3025d92c8512e960e5d0d1da05af
2017-11-15 15:38:13 -08:00
Josh Gao
29c5378e91 unwindstack: add Memory::ReadPartially.
Add a way to read while allowing for partial reads.

Test: new tests added to libunwindstack_test, ran 32/64 on hikey960, sailfish
Test: ran unwind on hikey960/sailfish
Change-Id: I8b11d9230fcd3122148ef3f980863ac1404ad70a
2017-11-15 15:38:13 -08:00
Treehugger Robot
37eb97d911 Merge changes from topic "b69050941"
* changes:
  Allow a service to override another.
  Move service name duplication lookup to EndSection
  EndSection returns Result<Success>
  Fix out of date SectionParser comment.
2017-11-15 21:30:56 +00:00
yaochen
68f2c85354 Merge changes from topic "stats_log"
* changes:
  Register an event logtag for stats logs.
  Create stats buffer in logd.
2017-11-15 19:16:12 +00:00
Steven Moreland
6f5333a4a9 Allow a service to override another.
For instance, on vendor.img:
service foo /vendor/bin/nfc
    ...

And then on odm.img:
service foo /odm/bin/super-nfc
    override

Allows a service on ODM to override a HAL on vendor.

Bug: 69050941
Test: boot, init_tests
Change-Id: I4e908fb66e89fc6e021799fe1fa6603d3072d62a
2017-11-15 10:39:29 -08:00
Steven Moreland
5e1bea30b9 Move service name duplication lookup to EndSection
This is paving the way to allow an "override" tag
in init services. This also means that errors for
part of a service definition in its section will
be shown in addition to the fact that the service
is duplicated.

Bug: 69050941
Test: boot, init_tests
Change-Id: Ic1ea8597789f45ead1083451b3e933db1524bdc9
2017-11-15 10:39:29 -08:00
Steven Moreland
7d0a5c3656 EndSection returns Result<Success>
Allow it to fail. When there is an error for a section ending,
print the error pointing to the line where the section starts.

Bug: 69050941
Test: boot, init_tests
Change-Id: I1d8ed25f4b74cc9ac24d38b8075751c7d606aea8
2017-11-15 10:39:29 -08:00
Yao Chen
c6eafeb5bf Register an event logtag for stats logs.
Bug: 69323063
Test: manual
Change-Id: I244aa15c74ad70ba228c2128a3cdc829537ce5e2
2017-11-14 16:24:13 -08:00
Stefan Lafon
701a0658e6 Create stats buffer in logd.
Bug: 69323063
Test: ran unit tests.
Change-Id: Icfb827ab4674172c26b4bbfe1a9b3bffc03dc24b
(cherry picked from commit 1b1b6f50c7)
2017-11-14 16:20:00 -08:00
Steven Moreland
b480d441ac Fix out of date SectionParser comment.
It has since been refactored with different
return types.

Bug: 69050941
Test: boot, init_tests
Change-Id: I54c0e6745640136f060ba1876b2f26d95bddc9d6
2017-11-14 13:47:59 -08:00
Jeff Sharkey
b77ecd04d8 Merge "Better, consistent definition of AID_SHARED_GID." 2017-11-14 16:49:30 +00:00
Jeff Sharkey
53d37ba23f Better, consistent definition of AID_SHARED_GID.
AID_SHARED_GID is a GID shared by a specific app across all users on
the same device.  Bring the UserHandle and multiuser.c implementations
into agreement, and copy/paste the unit tests that verify that both
behave identically.

This fixes a regression where multiuser_get_shared_gid() was applying
per-user isolation when it shouldn't have.

Test: adb shell /data/nativetest64/libcutils_test/libcutils_test64
Bug: 34151068, 64548938
Change-Id: I491dd79d23a214425a68865d1d0f8269916aad4c
2017-11-13 16:49:26 -07:00
Jaegeuk Kim
21d3840eb3 Merge "fastboot: support f2fs format" 2017-11-13 22:37:34 +00:00
Treehugger Robot
d0406316fe Merge "Fix logcatd dependency in logpersist." 2017-11-13 22:15:24 +00:00
Treehugger Robot
c437e14c17 Merge "PRODUCT_TREBLE_LINKER_NAMESPACES for ld.config.txt" 2017-11-13 21:06:34 +00:00
Calvin On
24e7a25836 Fix logcatd dependency in logpersist.
This change ensures that the logcatd binary is properly
included into builds which contain logpersist. logcatd
is required for logpersist to actually work.

Bug: 69171565
Test: make checkbuild
Test: verified that logcatd binary is present in build
Change-Id: I78161998763a4694ba88af43113fef39a5fbd8c8
2017-11-13 12:22:47 -08:00
Elliott Hughes
2736aec411 Merge "Remove dead dlmalloc stubs." 2017-11-13 17:22:20 +00:00
Treehugger Robot
6b07ee9fb5 Merge "DO NOT MERGE ANYWHERE Add comments and code about ro.boot.slot back" 2017-11-13 16:36:34 +00:00
Jaegeuk Kim
d872118d88 fastboot: support f2fs format
+ quota support

This patch fixes broken f2fs_format by replacing the existing flow with calling
legacy mkfs.f2fs binary explicitly likewise ext4.

This removes obsolete ext4 stuffs as well.

Bug: 67009570
Change-Id: Ia81bcbc7adc3a8b57ada860f7f7871602ac1c6e9
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2017-11-11 18:29:02 -08:00
Treehugger Robot
d0d7346dc7 Merge "first stage mount: abort when failed to parse fstab in device-tree" 2017-11-11 01:48:30 +00:00
Elliott Hughes
0626f7205e Merge "fastboot: show how long extraction takes." 2017-11-11 00:59:29 +00:00
Elliott Hughes
1412f5ffe3 Remove dead dlmalloc stubs.
Used to be used by ART, but long gone.

Bug: N/A
Test: ran tests
Change-Id: Id231d97b2b797562619e6fd90536b17dbe39f71e
2017-11-10 16:24:18 -08:00
Sandeep Patil
25f1631aa7 DO NOT MERGE ANYWHERE Add comments and code about ro.boot.slot back
Taimen bootloader passes androidboot.slot for now.
This reverts commit 211a4a5d5a.

Bug: 68710251
Test: taimen successfully mounts partition in first stage
Change-Id: I046afc99120e7ec9ef4b8ea7a852eb70e7231ea9
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-11-10 16:20:27 -08:00
Elliott Hughes
d2ce2f4f45 Merge "Move libcutils source to C++." 2017-11-11 00:18:29 +00:00
Treehugger Robot
865f9c2f0a Merge "libvndksupport: do not use functions from android/dlext.h" 2017-11-10 23:34:08 +00:00
Tianjie Xu
78d882bb5f Merge "Create a new directory on boot for update_engine logs" 2017-11-10 22:06:53 +00:00
Yifan Hong
1ccdb7d92a libvndksupport: do not use functions from android/dlext.h
... if they are not available. Use weak symbols and do not call the
following functions when they are not defined:

* android_dlopen_ext
* android_get_exported_namespace
Test: links
Test: boots

Change-Id: I653548bac61a0eba001f72bab969b5b858bd1553
2017-11-10 13:19:37 -08:00
Elliott Hughes
8e9aeb9053 Move libcutils source to C++.
Just the minimial changes to get this to actually build, because otherwise
we always bog down trying to rewrite everything (when the real answer
is usually "stop using libcutils, it's awful").

This doesn't move a handful of files: two are basically just BSD libc
source, a couple have outstanding code reviews, and one can be deleted
(but I'll do that in a separate change).

I'm also skipping the presubmit hooks because otherwise clang-format
wants to reformat everything. I'll follow up with that...

Bug: N/A
Test: builds
Change-Id: I06403f465b67c8e493bad466dd76b1151eed5993
2017-11-10 13:18:10 -08:00
Treehugger Robot
6707ef139d Merge changes from topic "qtaguidReplace"
* changes:
  Redirect qtaguid native call to netd fwmark client
  Move qtaguid API out of libcutils
2017-11-10 18:34:36 +00:00
Steven Moreland
4e641e3b6a PRODUCT_TREBLE_LINKER_NAMESPACES for ld.config.txt
PRODUCT_FULL_TREBLE is being deprecated in favor
of smaller flags. Use the appropriate one instead.

Bug: 62019611
Test: manual
Change-Id: Id5d127c29f908cd3011031b3b698ddec3dcba9c1
2017-11-10 10:25:45 -08:00
Elliott Hughes
23af112314 fastboot: show how long extraction takes.
Before:
  extracting android-info.txt (0 MB)...
  extracting boot.img (29 MB)...
  target reported max download size of 536870912 bytes
  archive does not contain 'boot.sig'
  archive does not contain 'boot_other.img'
  archive does not contain 'dtbo.img'
  archive does not contain 'dt.img'
  archive does not contain 'recovery.img'
  extracting system.img (1928 MB)...
  archive does not contain 'system.sig'
  extracting system_other.img (574 MB)...
  archive does not contain 'system.sig'
  archive does not contain 'vbmeta.img'

After:
  extracting android-info.txt (0 MB) to RAM...
  extracting boot.img (29 MB) to disk... took 0.232s
  target reported max download size of 536870912 bytes
  archive does not contain 'boot.sig'
  archive does not contain 'boot_other.img'
  archive does not contain 'dtbo.img'
  archive does not contain 'dt.img'
  archive does not contain 'recovery.img'
  extracting system.img (1928 MB) to disk... took 10.122s
  archive does not contain 'system.sig'
  extracting system_other.img (574 MB) to disk... took 3.424s
  archive does not contain 'system.sig'
  archive does not contain 'vbmeta.img'

Bug: http://b/69128980
Test: ran manually
Change-Id: Ib190d1cc56ad9da06a4f9a9e822f7dad4a9a53b7
2017-11-10 08:43:16 -08:00
Bowgo Tsai
ec19cf6306 first stage mount: abort when failed to parse fstab in device-tree
The client of FirstStageMount class should check the existence of fstab
in device-tree prior to using it. So raising a FATAL error inside
FirstStageMount when failed to parsing the fstab, in order to expose
more accurate error messages.

Also fixing a comment in fs_mgr, where it might happen in either
non-A/B or A/B.

Bug: 69102431
Test: boot sailfish
Change-Id: Ifb525beaa3423b118644778bfe0f84bff9465303
2017-11-10 12:53:46 +08:00
Treehugger Robot
c021b75cfd Merge changes from topic "libvndksupport_cp"
* changes:
  Make libvndksupport look for default namespace as well.
  libvndksupport: Change log level and message.
2017-11-10 03:23:02 +00:00
Justin Yun
090b593a8d Make libvndksupport look for default namespace as well.
In vendor process, libvndksupport must look for "default" namespace,
instead of "sphal" namespace to open hal libraries.

Bug: 63411330
Test: Boot the device.
Change-Id: I26208b6f47708f83e0679fd72ca7471ade84fff9
Merged-In: I26208b6f47708f83e0679fd72ca7471ade84fff9
2017-11-09 18:07:47 -08:00
Justin Yun
a34bd0561d libvndksupport: Change log level and message.
If no 'sphal' namespace exist, the sphal library may be found in
current namespace.
Change the log level and message to note this.

Bug: 64162324
Test: Check log message for vndksupport tag.
Change-Id: I5ed6ba1e48f99e7d11d80a465177ac9f3a7fbd97
Merged-In: I5ed6ba1e48f99e7d11d80a465177ac9f3a7fbd97
2017-11-09 18:07:41 -08:00
Chenbo Feng
baede73bd9 Redirect qtaguid native call to netd fwmark client
In order to replace qtaguid module with new eBPF network monitoring
module. We firstly move the current qtaguid userspace implementation
into netd and hide the detail from other processes. The current API will
talk to netd fwmark client to pass down the qtaguid related request from
high level framework and netd will use the proper method to complete the
request.

Test: Current TrafficStats CTS tests should not fail.
Bug: 30950746
Change-Id: Ie90c28f3594ab2877746b2372a1b6944768bfb18
2017-11-09 18:02:22 -08:00
Tianjie Xu
74fa3cab4e Create a new directory on boot for update_engine logs
Partners require to access update_engine's logs on the file system with
non-root permission.

Bug: 65568605
Test: directory created with the correct permission on boot
Change-Id: I1c1fb4acb8b0f2e7352ffa9e7d05a864940b5986
2017-11-09 12:11:28 -08:00
Treehugger Robot
93e5cd85d1 Merge "Move GetDeviceTest from adb's test_device.py to adb package." 2017-11-09 00:57:32 +00:00
Chenbo Feng
5b11831aa1 Move qtaguid API out of libcutils
The qtaguid kernel module will be deprecated on devices running 4.9
kernel or above and we need to support both old and new module in
userspace. Netd is responsible for choosing which kernel module to use
and all the current qtaguid native implementation need to be hided
behind it. So the current qtaguid native API implementation will be
moved to a isolate library under system/core and only netd can access to
it. The libcutils qtaguid API will become a wrapper to send request to
netd module. This modification will make sure the apps that currently
using this native API will not be broken.

Bug: 30950746
Test: All cts and vts test related should not fail.
Change-Id: I9de98a25ed5dc71bbf520ee0aadd16d59025699a
2017-11-08 16:28:43 -08:00
Josh Gao
85d4789719 Move GetDeviceTest from adb's test_device.py to adb package.
This test actually belongs with the adb python wrapper, since it's not
affected by changes to adb itself.

Bug: http://b/64260633
Test: python test_device.py
Change-Id: I58e5dff760f35923f8dbbdc7de6ffd75254880dc
2017-11-08 14:39:06 -08:00
Christopher Ferris
331d8e9b1a Merge "Fix another nullptr dereference." 2017-11-08 21:49:24 +00:00
Christopher Ferris
d96cbae4d4 Fix another nullptr dereference.
In this case, if the .eh_frame_hdr doesn't exist, we would crash.

Bug: 68813077

Test: Pass new unit tests, verified that without the fix, the unit test
Test: would crash.
Change-Id: I4f1365a76fe5c2fb69fa106a1ef15889c14e7611
2017-11-08 11:04:48 -08:00
Mark Salyzyn
35fc00124b Merge "Buffer overrun in __android_log_is_loggable() fix" 2017-11-08 16:06:38 +00:00
Christopher Ferris
58fb262613 Merge "Add support for only a .eh_frame." 2017-11-08 15:31:07 +00:00
Treehugger Robot
28e09852bf Merge changes from topic "uevent"
* changes:
  libcutils: Work around the lack of __mulodi4
  libcutils: Make uevent_kernel_* namespace-aware
2017-11-08 01:39:35 +00:00
Treehugger Robot
dbef1eeb45 Merge "crash_dump: don't inherit environment from parent." 2017-11-08 00:44:47 +00:00
Christopher Ferris
c9dee84d81 Add support for only a .eh_frame.
Static executables only have a .eh_frame section and no .eh_frame_hdr
section. Add support for this by rearranging the class hierarchy and
creating a DwarfEhFrameWithHdr class and a DwarfEhFrame class to handle
the different cases.

Add new unit tests for DwarfEhFrame and for the new functionality.

Bug: 68820189

Test: Passes new unit tests, unwinds static executables.
Change-Id: I63d7cb8c52a686e96579a2266e18c0d06bbb6e63
2017-11-07 13:22:39 -08:00
Treehugger Robot
1e0b9672de Merge "MIPS[64]: codeflinger: Fix build due to unused variable warnings" 2017-11-07 20:34:34 +00:00
Christopher Ferris
8e1ac14f40 Merge "Fix nullptr dereference." 2017-11-07 20:30:42 +00:00
Treehugger Robot
d9984743e6 Merge "Don't include the build number in the adbd binary." 2017-11-07 20:04:40 +00:00