Commit graph

1243 commits

Author SHA1 Message Date
Jeongik Cha
4e467e71e9 Turn on executable bit on system_ext/bin
Setting executable bit on system_ext/bin is missing, so add them into
list.

Bug: 144066307
Test: m && check if system_ext/bin/* have execute permission.
Change-Id: I89c9e0d2d54f965ecd058bb9e77ba77b7ed164c1
2019-11-07 16:51:49 +09:00
Tom Cherry
350164cc7c Revert "liblog: remove mistakenly added symbols from vndk"
This reverts commit 5f8162b086.

Reason for revert: Turns out they're being used.

Merged-In: Iad9010190c7a4140b69dc553df5debdd88dcf81a
Change-Id: Iad9010190c7a4140b69dc553df5debdd88dcf81a
2019-10-23 11:39:13 -07:00
Tom Cherry
7867721e51 liblog: remove mistakenly added symbols from vndk
These functions and headers were all mistakenly added to the vndk.
They should not be used by vendors.

Test: these symbols do not appear in vendor libraries
Merged-In: I03919b437c2d9f0e573b7a6b40249ed12fe874b9
Change-Id: I03919b437c2d9f0e573b7a6b40249ed12fe874b9
2019-10-22 09:47:45 -07:00
Treehugger Robot
ed2d29ea13 Merge "sched_policy: add get_cpuset/sched_policy_profile_name" 2019-10-16 02:44:22 +00:00
Wei Wang
ee2f260223 sched_policy: add get_cpuset/sched_policy_profile_name
Expose API to return name of task profile for cpuset/sched policy so
that libprocessgroup clients using SetTaskProfiles directly don't have
to maintain the mapping. This reduces the risk of inconsistency and saves
memory.

Bug: 139521784
Test: atest libcutils_test:SchedPolicy
Change-Id: I414312a038613913fb6a827bdcefceb3dec21264
2019-10-14 20:03:06 -07:00
Florian Mayer
ad427b74c4 Remove useless goto.
Test: build

Change-Id: Ifb8d832de1115eefbf2e09c6d5c8f03244566933
2019-10-10 18:15:24 +01:00
Bill Peckham
dea8c9c1ac Moving recovery resources from /system to /vendor
This change is part of a topic that moves the recovery resources from the
system partition to the vendor partition, if it exists, or the vendor directory
on the system partition otherwise. The recovery resources are moving from the
system image to the vendor partition so that a single system image may be used
with either an A/B or a non-A/B vendor image. The topic removes a delta in the
system image that prevented such reuse in the past.

The recovery resources that are moving are involved with updating the recovery
partition after an update. In a non-A/B configuration, the system boots from
the recovery partition, updates the other partitions (system, vendor, etc.)
Then, the next time the system boots normally, a script updates the recovery
partition (if necessary). This script, the executables it invokes, and the data
files that it uses were previously on the system partition. The resources that
are moving include the following.

* install-recovery.sh
* applypatch
* recovery-resource.dat (if present)
* recovery-from-boot.p (if present)

This change moves the recovery resources to vendor in libcutils/fs_config.cpp
and removes the flash_recovery service from rootdir/init.rc. This service moved
to a vendor init.rc file in bootable/recovery/applypatch.

Bug: 68319577
Test: Ensure that recovery partition is updated correctly.
Change-Id: I492f7989ea8042912e9d0e0eadeaa351affbee13
2019-10-04 00:04:08 +00:00
Tri Vo
92fd3caff7 libcutils: route to /dev/ashmem<boot_id> instead of ashmemd
Having libcutils ask ashmemd for ashmem fds results in unsatisfactory
performance/memory overhead. Introduce a duplicate of /dev/ashmem and
route to it instead.

Our goal remains as before, namely, use SELinux to phase out usage of
ashmem that doesn't go through libcutils.

Bug: 139855428
Test: boot aosp_crosshatch, browse internet, use camera
Change-Id: I02260a9042acb412571b11f1f4c1d8608483064a
2019-09-25 12:50:16 -07:00
Treehugger Robot
cda0a308eb Merge "Allocate UID for fs-verity ownership in keystore" 2019-09-17 16:08:48 +00:00
Nick Kralevich
6bcd50ed6d system/apex/*/bin should be 0751
Consistent with other bin directories, system/apex/*/bin should
be 0751.

Test: compiles and boots
Change-Id: Ie32e7623d2b2eb923417d0c2ba3ee6899a9bfc7b
2019-09-10 18:54:28 -07:00
Victor Hsieh
5f327d24c3 Allocate UID for fs-verity ownership in keystore
Test: compile and use
Bug: 112038744
Change-Id: Ic129484a0f6f266bb58f8afd722d5d8f7565b922
2019-09-05 16:18:13 -07:00
Xin Li
d0a45dbc9a Merge "DO NOT MERGE - Merge Android 10 into master" 2019-09-05 16:53:23 +00:00
Steven Moreland
c0660668e7 libcutils: Implement ashmem_valid on host.
Was missing.

Bug: 124524556
Test: build host code with dependency on this
Change-Id: I0074923e9ec53e42f9479fff47df0a24c8750164
2019-09-05 01:26:19 +00:00
Elliott Hughes
13e64377b3 Merge "Reland "libcutils: remove unused "jstring.h"."
am: a22599df58

Change-Id: I7ea8fa894ed60fc64534a6de312258b75b3bff8e
2019-08-12 11:40:28 -07:00
Elliott Hughes
79198d9ade Reland "libcutils: remove unused "jstring.h".
This reverts commit 09ba34925f.

Bug: http://b/139257138
Test: treehugger
Change-Id: Id9b612c5a79b89ed17d2205219af19788ae96c9e
2019-08-12 15:09:20 +00:00
Mason Wang
1967bf3f07 Merge "Revert "libcutils: remove unused "jstring.h".""
am: 4b8e6b673f

Change-Id: I2ec20c825970beefae2c9b2693506c2d7d3165d5
2019-08-11 22:40:42 -07:00
Mason Wang
09ba34925f Revert "libcutils: remove unused "jstring.h"."
This reverts commit aa96e8898c.

Reason for revert: It caused BB, and b/139257138 is for your reference

Change-Id: I93f1d0ba0fa43325e2815e9b2de84bb7cb41c457
2019-08-12 02:16:58 +00:00
Elliott Hughes
94879d3b9f Merge "libcutils: remove unused "jstring.h"."
am: e2adc14803

Change-Id: I2d779ea267d1177ace3d18290f61b9006d86ce25
2019-08-11 08:51:52 -07:00
Elliott Hughes
aa96e8898c libcutils: remove unused "jstring.h".
Test: treehugger
Change-Id: I56989862a51a6c8785f22f783027d50c42be650c
2019-08-08 17:45:48 -07:00
Elliott Hughes
498163c28a Merge "Remove more dead code."
am: 0c2dab9adf

Change-Id: I52dbcba34d893573b3452c7b084af8840e5c1ec1
2019-08-08 12:40:55 -07:00
Elliott Hughes
1547e4a316 Remove more dead code.
Test: treehugger
Change-Id: I2b7f606241cde2c2743d8021fad00d30f7e0b0de
2019-08-07 14:52:16 -07:00
Tom Cherry
306ca15d79 Merge "Add reserved AID ranges for all partitions"
am: 2a0a0810a1

Change-Id: I639c3ed66293da360318b5979480c1def45f1955
2019-07-15 16:32:41 -07:00
Tom Cherry
2a0a0810a1 Merge "Add reserved AID ranges for all partitions" 2019-07-15 23:19:41 +00:00
Justin Yun
e0b1eb8d65 Merge "Rename product_services to system_ext"
am: 6da50e319c

Change-Id: If9eaecca2382b3ace74ae721e80d51c79bb9b0fb
2019-07-11 00:15:28 -07:00
Tom Cherry
3ceea099f3 Add reserved AID ranges for all partitions
With Treble and Mainline, each partition needs to be able to
independently define its own set of AIDs and therefore needs its own
AID range to not conflict with updates made to other partitions.

This includes the system partition in the case of vendors making
additions to it.  Bionic will always have the hardcoded list of
platform AIDs in its own reserved list.

Bug: 73062966
Test: can load AIDs from partitions other than vendor
Test: bionic-unit-tests

Change-Id: I6509acc555cd28b421b9edaf3f8006bad6c56125
2019-07-10 13:45:53 -07:00
Justin Yun
7eaf9b58ec Rename product_services to system_ext
Update ld.config.txt and init.

Bug: 134359158
Test: make && check boot and ld.config.txt file
Change-Id: Ie1dce42e690414fb45b26759506ea7f64d06740d
2019-07-09 23:34:17 +00:00
Tom Cherry
073c1d442c Merge "Actually make fs_path_config / fs_path_config_from_file private" am: 20670249d0
am: a4754b12c4

Change-Id: Iedd8078ee67055f4b88393de4c9b8f42f8c39fef
2019-06-24 14:37:04 -07:00
Tom Cherry
68debff5ec Actually make fs_path_config / fs_path_config_from_file private
No one outside of libcutils is using these structs and we don't want
to leak them as they are private.

Test: build
Change-Id: I1c95564a9843c9155a333334008cbff7c7ff1f51
2019-06-20 23:34:30 +00:00
Tom Cherry
bc876255f7 Merge "Remove fs_config endianness functions" am: 9b229069fb
am: 2a43e8ffb7

Change-Id: I76dd185d3034387b347119c6136620c3409e7ea6
2019-06-20 15:10:31 -07:00
Tom Cherry
ad13c88ee2 Merge "Remove fs_config_generate()" am: 45f79b1c3b
am: b9ef822307

Change-Id: I2d451687cdfef481ec4c222cbdef584fa0b6bfbd
2019-06-20 15:10:14 -07:00
Tom Cherry
5550d4e90f Remove fs_config endianness functions
We don't support big endian on Android.

Test: build
Change-Id: I4278ecc139b0ffeba63cf7b3a43b1ce9e858e741
2019-06-20 16:35:50 +00:00
Zhijun He
f17089d834 Revert "libprocessgroup users use libcutils"
am: 5360a8492d

Change-Id: I505e0a9aa120531f6190b328a0dc9a9f79eb473a
2019-06-18 22:50:46 -07:00
Zhijun He
5360a8492d Revert "libprocessgroup users use libcutils"
This reverts commit 1ec3b78b67.

Reason for revert: breaks all camera use cases

Bug: 135568875

Exempt-From-Owner-Approval: revert, no build cop

Change-Id: Iec8e1f94f5bedced3f3faf73f851fd2f13e2e768
2019-06-19 05:25:07 +00:00
Steven Moreland
d0b343973c Merge "libprocessgroup users use libcutils" into qt-dev
am: c99582dc51

Change-Id: Ib150bad71b461c71355467ea0f21d5cebc3f7633
2019-06-18 16:48:52 -07:00
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
Tom Cherry
55fe01db69 Remove fs_config_generate()
We replaced creating the binary fs_config files with a python script
(/build/make/tools/fs_config/fs_config_generator.py), so there are no
more users of this function, nor do we plan for there to be.

Test: build
Change-Id: I49ec7e3d22c206bc250cbda6f66a4a59e47030e9
2019-06-17 13:40:31 -07:00
Bowgo Tsai
1d0e2be724 Merge "Moving /odm/build.prop to /odm/etc/buid.prop" into qt-dev
am: b36b54cf79

Change-Id: Iaa42e2c76c794b6c94a69961421834956c04ff65
2019-05-22 21:07:57 -07: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
Bowgo Tsai
9fc8dcf517 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
2019-05-22 06:03:34 +00:00
dimitry
d2231d0e2d Merge changes I8186718c,I8d6f33e9,I56fe5e11,Ie4004c98,I531d3d60, ... am: b26696e2dd
am: f7e9467a31

Change-Id: Iaf243bead1df42205b8c7b35f6336e5b664c45aa
2019-05-21 02:24:56 -07:00
dimitry
051d5cba80 Enable native_bridge_support for libcutils
Android build system added support for building translated binaries
used on natively bridged targets (arm on x86 for example).

However in order to avoid building unnecessary binaries and libraries
for such architectures most modules do not support native bridge by default.

All needed modules have to explicitly indicate if they may be used as part
of translated binary build.

This change enabled native bridge support for libcutils which is a
greylisted library (available for apps targeting Android version < N).

Bug: http://b/77159578
Test: make
Change-Id: I56fe5e11a884d22714cfc4afb78bec0a352d6370
2019-05-16 14:17:00 +02:00
Tom Cherry
d0dc22e467 Merge "Add default executable permission in odm/bin" am: 766e878253
am: ede9bb5b37

Change-Id: I0d2817f128f8acaec5356b42b80d43ef0b8ac947
2019-05-08 08:56:03 -07:00
Tom Cherry
766e878253 Merge "Add default executable permission in odm/bin" 2019-05-08 15:31:28 +00:00
Tom Cherry
6836c9a24b Merge "Remove sbin from fs_config.cpp" am: 26ec31ce8d
am: c6c4fbe805

Change-Id: I8a8d4742a03df2bf475c6a4a7c7350cff7638470
2019-05-07 23:59:51 -07:00
Tom Cherry
2f74a26a2d Remove sbin from fs_config.cpp
There is no longer a /sbin on Android.

Bug: 73660730
Test: build
Change-Id: I3f5ce292790392a02aa4a1c661f44b4c7e1570dc
2019-05-07 10:21:05 -07:00
Min Yun
a8eb00720c Add default executable permission in odm/bin
In odm's binary files can't have executable permission.
Add default executable permission in odm/bin and vendor/odm/bin.
Previously partitions that except system, only appeared in
system partition if product haven't separated partition.
After support ODM, vendor/odm should considered.

Bug : 124465978
Test : Check each file's permission.
system/vendor/bin/* -> 0755
system/product/bin/* -> 0755
system/product_services/bin/* -> 0644
system/oem/bin/* -> 0644

vendor/odm/bin/* -> 0755
vendor/product/bin/* -> 0644
vendor/product_services/bin/* -> 0644

Change-Id: I5cee48474fceaf73853b2013d58017bd64953d86
2019-05-07 14:04:23 +09:00
Tim Murray
41f261df25 Merge "cutils: add ashmem_init" am: 55ba959c13
am: 3d213c39e8

Change-Id: Ib9335109c0226c34dce479ee56a5f231d23f8d19
2019-04-05 03:02:02 -07:00
Tim Murray
8879ed7f2a 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-04 17:30:25 -07: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
25d42eeaa6 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 19:08:51 +00:00