Commit graph

1195 commits

Author SHA1 Message Date
Steven Moreland
1ec3b78b67 libprocessgroup users use libcutils
libprocessgroup symbols are being moved into libcutils in order to
optimize linking/memory usage. libprocessgroup will no longer be
required in the future (however removing references to it will come
separately).

Bug: 135145426
Test: boot

Test:
BEFORE:
$ adb shell showmap -a $(pid hwservicemanager) | grep -P "libprocessgroup|libcutils" -A1 | grep -P 'libprocessgroup|libcutils|\.bss' | awk '{s += $9}END{print s}'
28

AFTER:
$ adb shell showmap -a $(pid hwservicemanager) | grep -P "libprocessgroup|libcutils" -A1 | grep -P 'libprocessgroup|libcutils|\.bss' | awk '{s += $9}END{print s}'
12

Change-Id: I10d7c2d2b2b14cbbe0a128b9156d31206419d24c
2019-06-18 22:03:54 +00:00
Bowgo Tsai
3182ea132e Moving /odm/build.prop to /odm/etc/buid.prop
In device root directory, we have the following symlinks:
  - /odm/app -> /vendor/odm/app
  - /odm/bin -> /vendor/odm/bin
  - /odm/etc -> /vendor/odm/etc
  ...

This allows the Generic System Image (GSI) to be used on both devices:
  1) Has a physical odm partition, where those symlink will be hidden
     when /odm is used as the mount point
  2) Has no physical odm partition and fallback to /vendor/odm/.

We can't just have the symlink /odm -> /vendor/odm, because the former
devices won't have /vendor/odm directory, which leads to mount failure
when the mount point /odm is resolved to /vendor/odm.

The existing /vendor/odm/build.prop won't be loaded in the latter
devices, because there is no symlink
    - /odm/build.prop -> /vendor/odm/build.prop.

Note that init blocks reading through direct symlinks (O_NOFOLLOW) so
the above symlink won't work either. This CL moves the odm build.prop
to /odm/etc/build.prop for init to load it (symlinks in earlier
components of the path will still be followed by O_NOFOLLOW).

Bug: 132128501
Test: boot a device and checks /odm/etc/build.prop is loaded
Change-Id: I0733c277baa67c549bb45599abb70aba13fbdbcf
Merged-In: I0733c277baa67c549bb45599abb70aba13fbdbcf
(cherry picked from commit c49655b2a4)
2019-05-22 16:15:44 +08:00
Tim Murray
943f1c1d4a cutils: add ashmem_init
Add a new ashmem_init function that only dlopens libashmemd_client.
This allows the library to be preloaded in the zygote.

Test: boots, works
Bug: 129543489

Change-Id: Ie106791edf381654f085203c266c9f9c0df35cfc
2019-04-05 00:28:05 +00:00
Yifan Hong
bd5853cb48 Merge changes from topic "libprocessgroup_rc"
* changes:
  CgroupSetupCgroups -> CgroupSetup
  Add libcgrouprc to ld.config.*.txt.
  libprocessgroup: use libcgrouprc to read cgroup.rc
  libprocessgroup_setup: use libcgrouprc_format
  libprocessgroup: Move CgroupSetupCgroups() to libprocessgroup_setup
  libprocessgroup: Add libcgrouprc
  libprocessgroup: Add libcgrouprc_format
2019-04-03 16:41:21 +00:00
Elliott Hughes
15e370aced Merge "libcutils: android_reboot command should be unsigned." am: e3ec16b9c6 am: cf2f309cff
am: ba78d39cdc

Change-Id: I034c780c6c1166e4c6643ebcc607d3388246ebab
2019-04-02 19:52:28 -07:00
Treehugger Robot
e3ec16b9c6 Merge "libcutils: android_reboot command should be unsigned." 2019-04-03 01:19:06 +00:00
Yifan Hong
fad638c82d libprocessgroup: use libcgrouprc to read cgroup.rc
Use the LL-NDK library to read cgroup.rc.

As a side-effect, the CgroupController class is changed
to a wrapper of ACgroupController* from the library. The
class itself essentially becomes the pointer, and can be
trivially copied. Modify all client code for this change.

Test: builds and boots
Bug: 123664216

Change-Id: I635d9885db62e82f37421f6d20f59c84a6f4cbb2
2019-04-02 17:34:37 -07:00
Nick Kralevich
eed675688d Merge "Revert "relax /system/bin directory permissions"" am: 98880af580 am: 88b15b2b7c
am: 6b38459ee5

Change-Id: I44ec7363697f52ee55284343f4f4f473b34de9ab
2019-04-02 15:05:19 -07:00
Elliott Hughes
66e5ae0f5a libcutils: android_reboot command should be unsigned.
Hex literals have the type of the first type they fit in. The reboot
constants are large enough that that's `unsigned` rather than `int`.

Bug: http://b/76110968
Test: treehugger
Change-Id: Iac4fe61d1fe572297febf0b57e34d698942469f9
2019-04-02 09:19:46 -07:00
Nick Kralevich
8d1b43bbf4 Revert "relax /system/bin directory permissions"
It appears Chase has fixed their app, so we no longer need to keep these
permissions relaxed.

This reverts commit 53842f8a90.

Bug: 119605322
Test: compiles and boots
Change-Id: Iba5e9ecd685eb386997a5e92638b8a1b5943ad4b
2019-04-02 08:54:17 -07:00
Steven Moreland
6e10e67eaa Merge "libutils/libcutils: make host more like device" am: 43f29072a9 am: 02bb6c1b24
am: 775ed88ddd

Change-Id: I6d9a2c90499622ad61046b3c222f8cb9d688bd16
2019-03-29 17:49:56 -07:00
Steven Moreland
43f29072a9 Merge "libutils/libcutils: make host more like device" 2019-03-29 23:05:20 +00:00
Steven Moreland
e6132be529 libutils/libcutils: make host more like device
Having shared host libraries allows libraries depending on these to use
'shared_libs' for these. This simplifies configurations since these
libraries don't have to specify 'shared_libs' on all non-host targets.

Bug: 124524556
Test: build only

Change-Id: I09fb4a4fb66ea0a87cb76b1e6f400c537a11f082
2019-03-28 18:44:32 -07:00
Yifan Hong
82faf0949f libcutils: android_get_control_file uses realpath. am: dd6eefca30 am: 877436dd25
am: 353d08605d

Change-Id: Ia22a3af3de76eace5f8cb6e58ebc2a8c9d59437f
2019-03-26 16:37:24 -07:00
Elliott Hughes
ae2c2c5770 Merge "Clean up some mess by only building Android-specific code for the device." am: 443fdb2fdc am: 0fa7eddc31
am: 870413d411

Change-Id: I5ea2a7cf59c8ce5b7bc0a970237df17a69d08056
2019-03-25 09:43:43 -07:00
Yifan Hong
dd6eefca30 libcutils: android_get_control_file uses realpath.
If the path to android_get_control_file is a symlink, the final sanity
check will fail that the fd does not have the same path as the given
file. We can't expect callers to readlink() because this would change
the environment key. Instead, try to call realpath on both paths.

Bug: 126233777
Test: lpdump
Change-Id: I0df10d7dbe3e572b8335faad812e5cd80bff1733
2019-03-21 16:00:00 -07:00
Elliott Hughes
7acb0d39e8 Clean up some mess by only building Android-specific code for the device.
Test: treehugger
Change-Id: Id44721ccd1817d8c537b226f60a58b7cb691fb01
2019-03-21 14:59:45 -07:00
Roland Levillain
00c6d45ee9 Merge "Remove Valgrind entries from fs_config." am: e61d5ccf47 am: 710264b43b
am: 6ab844e1fe

Change-Id: I8ab7dcf37ed09045bfe9efe14a93048d6966c74e
2019-03-14 06:43:13 -07:00
Roland Levillain
3f3e2c678e Remove Valgrind entries from fs_config.
Valgrind has been removed from the Android tree in 2018.

Test: n/a
Bug: 77856586
Change-Id: I3b51d9b2290a4276299725cdd5a53a5bba00166e
2019-03-13 17:12:00 +00:00
The Android Open Source Project
4d916a1ece DO NOT MERGE - Merge PPRL.190305.001 into master
Bug: 127812889
Change-Id: I16a546dc24d3cf980ad7ab09895c0d97ee436224
2019-03-11 11:57:28 -07:00
Martijn Coenen
538e0b98c4 Update comments on native_handle_create.
To indicate limits.

Test: builds
Change-Id: Id5129a7f6a8f413911544dedeb02bb4e7a2f6e10
2019-03-06 14:22:10 +01:00
Elliott Hughes
1c8edfa5f3 Merge "__android_log_is_debuggable() shouldn't be an apex symbol" am: 69fc7b628d
am: 963633232e

Change-Id: Id4d53a791e8350be4bb91af4b20bc4a9715b464f
2019-02-20 22:51:49 -08:00
Tom Cherry
15800946e0 __android_log_is_debuggable() shouldn't be an apex symbol
Remove a superfluous check in fs_mgr, since those return values are
already impossible for a non-debuggable build.  Replace a one time
call to __android_log_is_debuggable(), since there's no reason to
cache the value or use this symbol.

Test: build
Change-Id: Icd4bef7b616c49d304303747388d7e3018c6fcfc
2019-02-20 12:52:02 -08:00
Elliott Hughes
661ce4047d Merge "Clean up libcutils/libutils tests." am: 57150963a3
am: f984d7a403

Change-Id: I9870edb8119ba3850b8f9863de439f3fa1fabaa8
2019-02-11 18:37:45 -08:00
Elliott Hughes
01705e4f1d Clean up libcutils/libutils tests.
Move tests in the same directory as the corresponding code, so it's
easier to see what is/isn't tested.

Fix naming of libcutils_tests (plural) to match the singular that's more
common (even though the plural makes more sense to me).

Add these two to system/core/'s TEST_MAPPING.

Remove obsolete AndroidTest.xml.

Fix a flaky (timing-dependent) libcutils test.

Test: ran tests
Change-Id: I7e0a31ff45c8a152562bf66fc97161594249366e
2019-02-11 13:15:56 -08:00
Jiyong Park
76a125bf4e Merge "Eliminate the APEX name in fs_config using wildcard" am: ea353cab91
am: 2e0f43c6ba

Change-Id: Id6e14d3e5d9c7e479ba2150804aa5f0f9c73469d
2019-02-08 17:45:37 -08:00
Jiyong Park
defdb18675 Eliminate the APEX name in fs_config using wildcard
Bug: 123743953
Test: Marlin/sailfish boots to the UI
Change-Id: If1669122be78255879ffb8c8c0a7408a34b5e617
2019-02-09 02:59:17 +09:00
Jiyong Park
6e1875ffea Merge "fs_config supports shell wildcard patterns" am: 2210f80e48
am: 4fe80fa336

Change-Id: I6dfdd5d8979a294bbe3c054f900e4f0f935edae4
2019-02-08 07:54:57 -08:00
Jiyong Park
a2159c493b fs_config supports shell wildcard patterns
It now supports shell wildcard pattern matching using fnmatch(3).

Bug: 123743953
Test: atest libcutils_test
Change-Id: Ib82ae3bf717cbdba267024e1c9d3da004274b95c
2019-02-08 03:53:52 +09:00
Jiyong Park
b97eeb34c4 Merge "Configure /system/apex/com.android.runtime.[debug|release]/bin/*" am: 186661d135
am: 6649f7447e

Change-Id: Iee6311ea1bdeae6e45a6863ee048ff229c0ca841
2019-02-07 08:26:34 -08:00
Jiyong Park
186661d135 Merge "Configure /system/apex/com.android.runtime.[debug|release]/bin/*" 2019-02-07 16:08:24 +00:00
Joel Fernandes
e3b45e5c31 Merge changes from topic "memfd-support" am: 3133b695e0
am: b03663ebdf

Change-Id: Idf18cb0a8eb9327f75d28018e9f0940cc32ae962
2019-02-07 06:27:43 -08:00
Joel Fernandes
519440468b Add support for memfd
This patch adds support to make libcutils create and use memfd where
possible, instead of ashmem.

The libcutils library is made dynamic, since apps are still sending over
ashmem FDs to processes and we are working on moving those apps away
from ashmem. The best we can do for that is make the library work, and
force apps in the long run to move away from directly using ashmem.

Due to further complications mentioned in the 'NOTE' section of the
patch, memfd is kept disabled for now, so nothing changes yet. To enable
it, set the sys.use_memfd property (check user_debug build).

Bug: 113362644
Change-Id: I491cb7841b664db5b1c26b3e07a440a14810e182
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-02-07 00:40:13 +00:00
Tri Vo
f60debf334 Merge "libcutils: route to ashmemd" am: 5bccd33e0b
am: 6604befa2e

Change-Id: I9511ecf61f9dd85bf2345eef0dd0138cf4f918b0
2019-02-05 13:58:27 -08:00
Suren Baghdasaryan
43a0b172f4 libprocessgroup: Add support for task profiles am: 82b72a5667
am: 953472f577

Change-Id: I5878ecc185f6c673bd18ef17769430e2df1ad71f
2019-02-04 20:58:31 -08:00
Tri Vo
2891ba09d5 libcutils: route to ashmemd
If libcutils is not a VNDK version and /dev/ashmem is not available,
then ask ashmemd for opened fd to /dev/ashmem.

We rely on SELinux policy to determine what's allowed to open
/dev/ashmem directly.

Bug: 113362644
Test: device boots (in selinux permissive mode)
Change-Id: I93c4fa6044b0bfa5282097c6c32139a8d8f67deb
2019-02-04 10:30:24 -08:00
Suren Baghdasaryan
82b72a5667 libprocessgroup: Add support for task profiles
Abstract usage of cgroups into task profiles that allows for changes
in cgroup hierarchy and version without affecting framework codebase.
Rework current processgroup and sched_policy API function implementations
to use task profiles instead of hardcoded paths and attributes.
Mount cgroups using information from cgroups.json rather than from init.rc

Exempt-From-Owner-Approval: already approved in internal master

Bug: 111307099
Test: builds, boots

Change-Id: If5532d6dc570add825cebd5b5148e00c7d688e32
Merged-In: If5532d6dc570add825cebd5b5148e00c7d688e32
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-03 16:48:35 +00:00
Jiyong Park
3435c88b4a Configure /system/apex/com.android.runtime.[debug|release]/bin/*
When TARGET_FLATTEN_APEX is set to true, the APEXes are flattened
directly under /system/apex/<name>. Among them the runtime APEX carries
binaries such as linker, dex2oat and they need to be configured to be
executable.

Bug: 123684826
Test: Marlin/sailfish boots to the UI
Change-Id: I8ebe9dc4341410ff91ca2cb7cf95e21b0829c008
2019-02-01 22:05:46 +09:00
David Anderson
a174c6e5b5 Merge "Add user/group for gsid." am: 9747a65380
am: 520aa5bfa1

Change-Id: I244794b8aca62983bb600ca214aedb09ef23a50a
2019-01-30 09:37:30 -08:00
David Anderson
8bc2b89ae6 Add user/group for gsid.
Bug: 122556707
Test: manual test
Change-Id: I18e44ff1bbb3c43cfc8f6f2997f9358052ce249b
2019-01-29 17:48:12 -08:00
Suren Baghdasaryan
1bd127b72e DO NOT MERGE: Revert "Revert "libcutils: Move sched_policy functions into libprocessgroup""
This reverts commit b5394db682.

Reason for revert: AOSP is fixed with new vendor image

Change-Id: Ie1a2e0200600214a65f4fe2250c903c8e8ce0a29
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-01-25 16:49:09 +00:00
Yabin Cui
f29284d53a Merge "Add setuid/setgid capabilities to simpleperf_app_runner." am: c87d1ed611
am: eb16021d1e

Change-Id: I4a723f71f1b7942db5124aa42ccb5e4008e2dde4
2019-01-24 11:17:50 -08:00
Yabin Cui
eb16021d1e Merge "Add setuid/setgid capabilities to simpleperf_app_runner."
am: c87d1ed611

Change-Id: I4d03b065dd379cffbe5ca9656c3294a7f3675887
2019-01-24 11:05:26 -08:00
Suren Baghdasaryan
6738419e09 Merge changes from topic "move sched_policy functions" am: ca50ee91b5
am: e8b2ac49bb

Change-Id: I9ba62bc4cce474b2a12af5a1035714ac9dd39703
2019-01-22 13:41:10 -08:00
Yabin Cui
af3e30d271 Add setuid/setgid capabilities to simpleperf_app_runner.
Also add simpleperf_app_runner in shell utilities.

Bug: 118835348
Test: build and boot.
Test: run simpleperf_app_runner manually.

Change-Id: I538503dabfa8ff192f4b3029206a62613eacdf32
2019-01-22 11:20:10 -08:00
Suren Baghdasaryan
facd40d0e1 libcutils: Move sched_policy functions into libprocessgroup
Move functions operating on cgroups from sched_policy.h in libcutils
into sched_policy_ctrl.h under libprocessgroup. This consolidates
cgroup-related functionality inside libprocessgroup.

Bug: 111307099
Test: builds, boots

Merged-In: Iba75f33281162b889989214d0325a5973d53ed2d
Change-Id: Iba75f33281162b889989214d0325a5973d53ed2d
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-01-22 18:18:48 +00:00
Martijn Coenen
c3be3e8b2a Merge "Update AID_ISOLATED_START to include new range." am: 73992c7c00
am: 48ec9e7ce4

Change-Id: I4c95bf99639aeb3e22f6260f2905ba6f5ce592ad
2019-01-17 13:03:00 -08:00
Martijn Coenen
cb88bc95fc Update AID_ISOLATED_START to include new range.
The AppZygote allocates UIDs out of the [90000..98999] range.

Bug: 111434506
Test: builds
Change-Id: I7846a81077636f6f9aff2880f1c9ee01c6f98257
2019-01-17 11:48:58 +01:00
Martijn Coenen
20ac1203a3 Export maximum number of fds/ints in a native_handle.
So we can deserialize it consisently and safely.

Bug: 120084106
Test: builds
Change-Id: I0eafff70d3a7e4d732fe600a0052efb90108208d
2019-01-16 08:55:14 -08:00
Mårten Kongstad
79d59f0b79 Merge "Add systrace tag for RRO" am: 1c018862a0
am: 047ae05793

Change-Id: If1c6b6b4b3b7696dfcbd358aca2234edfc9f24ee
2019-01-09 16:14:02 -08:00