Commit graph

97 commits

Author SHA1 Message Date
Jiyong Park
8d6481b92c Move fs_config_[files|dirs]_<partition> to soong
Note that not all partitions are moved to Soong. Soong doesn't yet
support *_dlkm partitions and the oem partition.

This change also removes dead code for support VNDK snapshot.

Finally, as a minor clean up, the leading '_' is dropped from the module
names _fs_config_*. There's no need to hide the module names.

Bug: 337993745
Test: m
Change-Id: I5beec5c6734291b9361f870fc1a8dba19def062e
2024-05-07 08:50:10 +09:00
Elliott Hughes
ad002facae fs_config: remove -S option.
mkfs warns about unknown "selabel=" fields, and this should be coming
from the file_contexts file, not here.

Test: treehugger
Change-Id: I63f3f616a2588438017e609a1a08c9dd7bf0c2ed
2024-03-04 21:20:52 +00:00
Cole Faust
216978e7c4 Convert fs_config_generator.py to python 3
Bug: 203436762
Test: ./test_fs_config_generator.py and m libc
Change-Id: I16ce5f5e273ade064acce8889a9eb3f2707910ae
2022-10-21 11:16:18 -07:00
Cole Faust
f08ab3d098 Fix broken fs_config_generator tests
These tests were failing at TOT. Also add a
python_test_host target so the tests will be
run on CI in the future.

Bug: 203436762
Test: m libc, prebuilts/build-tools/linux-x86/bin/py2-cmd build/make/tools/fs_config/test_fs_config_generator.py
Change-Id: I6dda841023a2f5e76d59360d08626fc1a8842ffe
2022-10-20 13:40:07 -07:00
Ramji Jiyani
13a4137929 core & tools: system_dlkm: add dynamic partition
Converts existing static partition support to a
dynamic partition.

Bug: 200082547
Test: TH
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: Ifd6d0c2a04e947b16f8b241e99cca594a1d315ae
2022-01-30 08:43:08 +00:00
Bob Badour
d2c7c08e7c Fix licenses and license texts.
Use Android-Apache-2.0 for all Apache 2.0

Remove legacy_restricted (no longer appears in code).

Remove Android.bp which did not build anything but was a placeholder
for the missing license texts.

Test: m nothing
Change-Id: Ia491a59c735ca20afda9b4bbac9d8b33dbf8874e
2022-01-24 16:19:41 -08:00
Justin Yun
9d3356b306 fs_config reads headers from snapshots, if available
fs_config requires the information from the header files in
system/core and bionic/libc. To build the vendor side fs_config,
use the header files in the vendor snashot if the required version
exists.

Bug: 187222756
Test: check ninja depedency with and without snasphots.
Change-Id: Ibf96eab4d9a129745be1a19b2aa2e4c8f57cf6bf
2021-07-13 11:42:18 +09:00
Bob Badour
0390580262 [LSC] Add LOCAL_LICENSE_KINDS to build/make
Added SPDX-license-identifier-Apache-2.0 to:
  target/product/sysconfig/Android.bp
  tools/apicheck/Android.bp
  tools/product_config/Android.bp
  tools/releasetools/Android.bp
  tools/signapk/Android.bp
  tools/signtos/Android.bp
  tools/zipalign/Android.bp
  tools/ziptime/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-GPL
    SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL
    SPDX-license-identifier-MIT legacy_not_a_contribution
    legacy_restricted
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-GPL
    SPDX-license-identifier-MIT
to:
  tools/Android.bp
  tools/droiddoc/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0
    SPDX-license-identifier-LGPL SPDX-license-identifier-MIT
to:
  core/base_rules.mk
  core/dex_preopt_libart.mk
  core/package_internal.mk

Added SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution
to:
  target/board/Android.mk

Added legacy_restricted
to:
  core/tasks/tools/package-modules.mk
  target/product/gsi/Android.bp
  target/product/gsi/Android.mk
  target/product/security/Android.bp
  target/product/security/Android.mk
  tools/acp/Android.bp
  tools/atree/Android.bp
  tools/fs_config/Android.bp
  tools/fs_config/Android.mk
  tools/fs_get_stats/Android.bp
  tools/libhost/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id67a4eb1312940f999643b2ae57f45f34f120724
2021-02-14 10:37:20 -08:00
Elliott Hughes
27de935d83 Update OWNERS.
Test: treehugger
Change-Id: I5f9ddd03d5cd34fb398b842c933dc6a365be4b39
2020-12-11 12:56:27 -08:00
Colin Cross
40c9513f7f Follow argument changes to RuleBuilder
Pass pctx and ctx to NewRuleBuilder instead of RuleBuilder.Build,
and don't pass ctx to RuleBuilderCommand.BuiltTool.  Follows the
changes in I63e6597e19167393876dc2259d6f521363b7dabc.

Test: m checkbuild
Change-Id: I5d11e07ae1a24a967e379c151f4f5d7d188c6cc0
2020-12-01 16:21:51 -08:00
Chema Gonzalez
f8b158b312 build: make fs_config_generator.py python2 explicitly
Test: run script in Fedora 31 with (default) python3 interpreter.

```
$ env python --version
Python 3.7.9
```

Change-Id: Ib4e68c5df54b092380e9fca473cd0dbbc0c18db7
2020-10-28 10:52:14 -07:00
Justin Yun
75f7cf9a2d Add fs_config_(dirs|files) for product and system_ext
These files were added to devices with the fs_config_files_nonsystem
module in base_vendor.mk. As they are partition-specific, move them
to each base_<partition>.mk file.

To add the fs_config_* files to the base_<partition>.mk files, it is
required to define the fs_config_* regardless of the existance of
partitions.

Bug: 170282998
Test: build and check if they are installed.
Change-Id: Ib8a2c75e2e0e93bb7030da981494e880f8465e5a
2020-10-21 03:39:22 +00:00
Tom Cherry
787ef71f29 Merge "Use libcutils_headers for android_filesystem_config.h" 2020-09-21 17:26:10 +00:00
Tom Cherry
54752bf0ae Use libcutils_headers for android_filesystem_config.h
android_filesystem_config.h is found since system/core/include is on
the include path for all projects and contains a symlink to the real
android_filesystem_config.h.  This is fragile and the below bug seeks
to remove this symlink and have users correctly depend on
libcutils_headers.

Bug: 165825252
Test: build
Change-Id: Ie921c4fd96d6e4e42d127bfbfe7a892756ad9495
2020-09-18 22:49:10 +00:00
Tom Cherry
329545d912 fs_config: Update docs
1. Convert to README.md
2. Sync come content with the updates on source.android.com
3. fs_config uses bionic/libc/kernel/uapi/linux/capability.h, not
system/core/include/private/android_filesystem_capability.h as the
capability header, so update the documentation accordingly.

Test: n/a
Change-Id: I24a084d7a804d3f5d2259cfcea85b8ff4e79d290
2020-09-16 16:21:30 -07:00
Joel Galenson
154ac1d870 Update language to meet Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference.

Bug: 161896447
Test: Build
Change-Id: I8d33207c84f424e89f367b1c917661347402ae77
2020-07-30 15:05:55 -07:00
Yifan Hong
f496f1b94f Add odm_dlkm partition.
Test: define odm_dlkm in CF.
Bug: 156020364
Change-Id: I5593d09a1cdf13e651a13e951336555a7475865e
2020-07-16 12:34:29 -07:00
Yifan Hong
cfb917a1c7 Add vendor_dlkm partition.
Test: define vendor_dlkm for CF.
Bug: 156020364

Change-Id: I459059e1c20df7a285a377b8b3bbc8decc60b124
2020-07-13 14:20:56 -07:00
Tom Cherry
7cff1fa1fc Include private/fs_config.h directly when needed
This is no longer a transitive include of android_filesystem_config.h

Bug: 149785767
Test: build
Change-Id: Ib546dbc3b6f546ba48009cc9d6d0f4564acf0872
2020-03-05 10:55:45 -08:00
P.Adarsh Reddy
8b2e7c9c51 Make oemaids_headers available to vendor.
This change makes the oemaids_headers header library
available to vendor side.

Bug: 149665231
Test: Tested compilation, oemaids_headers is available to
a sample vendor binary.

Change-Id: I87369f1db883e40e83d6076defdd4c0d84aac46f
2020-02-18 09:44:23 +00:00
dianlujitao
5dcbe701cf fs_config: Fix generation for devices without vendor partition
If the "--all-partitions" argument is empty, the system fs_config should
be generated with all partitions emitted.

Fixes: 8453f02c (fs_config: Fix cases without vendor/oem partition)
Change-Id: I058cfd1c8e665b40757998e773c35e26465bf58a
Signed-off-by: dianlujitao <dianlujitao@lineageos.org>
2019-09-10 16:17:47 +08:00
Roland Levillain
5ca32dfec5 Fix typo in error message in tools/fs_config/fs_config_generator.py.
Test: n/a
Change-Id: I46682483803e1c7c71fb07157d0ef9c990152d93
2019-08-07 15:51:01 +01:00
Tom Cherry
fb303a5903 Generate /etc/{passwd,group} for all partitions
Bug: 73062966
Test: can load AIDs from partitions other than vendor
Test: bionic-unit-tests
Merged-In: Ia85abbeefe5a945369970f2aef42692e07ab8c09
Change-Id: Ia85abbeefe5a945369970f2aef42692e07ab8c09
2019-07-22 21:41:17 +00:00
Justin Yun
6151e3f1ea Rename product_services to system_ext
Bug: 134359158
Test: build and check if system_ext.img is created
Change-Id: I67f2e95dd29eac6a28e07e24ea973d3a134c3bfc
2019-07-09 08:57:19 +00:00
Tom Cherry
de18e892d3 Update fs_config documentation
While searching for some fs_config related symbols, I ran across this
being out of date, so update it.

The new documentation defers to the help section of the underlying
script more to hopefully avoid this in the future.

Test: n/a
Change-Id: I94893cbb29b8d7e81963a12e3f8316ac3f41b7ae
2019-06-17 13:31:28 -07:00
Felix
8453f02c65 fs_config: Fix cases without vendor/oem partition
If the device has neither an OEM nor a vendor partiton,
$PRIVATE_PARTITION_LIST will be empty, causing the fsconfig tool to fail
because the "--all-partitions" argument will be empty.

Quote the comma-substituted "$(PRIVATE_PARTITION_LIST)" - which may be
empty - to appease argparse, which will then populate "_all_partitions"
with an empty "str" object.

Checking _all_partitions against None is superfluous since either
argparse will catch the empty argument and fail early, or the argument
will be a string, in which case it will not be None.

Signed-off-by: Felix <google@ix5.org>
Change-Id: I236e30445b303b4945467b5dc4387d54b5d984f9
2019-05-29 22:24:05 +02:00
Dan Willemsen
7f25f2aed9 TARGET_FS_CONFIG_GEN is a list, not a single path
Bug: 130787336
Test: m oemaids_header_gen oemaids_headers passwd group
Test: Set TARGET_FS_CONFIG_GEN to a list of paths
Change-Id: I5186b378fea8865f46cfd891420ba576f36e2565
2019-04-18 17:16:50 +00:00
Dan Willemsen
d32e6d1314 Convert oemaids_headers / passwd / group to Soong
Bug: 118089258
Test: m oemaids_header_gen oemaids_headers passwd group
Change-Id: Ie3b92a499b44391e0692da5d9ad067089a62aabb
2019-04-10 20:46:33 -07:00
Tom Cherry
9d924f67d3 Use fs_config_generator.py to generate fs_config_files/dirs directly
We want to remove target specific host tools and since
fs_config_generate is compiled with a target specific header file, we
instead remove fs_config_generate entirely and allow python to build
the fs_config_files/dirs files directly from config.fs files and
parsed C headers.

Test: associated unit tests and new end to end test
Test: aosp_sailfish, aosp_crosshatch build produces valid fs_config files
Test: aosp_cf_x86_phone build correctly produces empty fs_config files
Change-Id: Idbc63ff56c0979e1e4c17721371de9d9d02dc8ff
2019-02-15 09:44:09 -08:00
Tom Cherry
1a9f8356fd Error if $(TARGET_DEVICE_DIR)/android_filesystem_config.h exists
This was deprecated along with TARGET_ANDROID_FILESYSTEM_CONFIG_H so
warn if it still exists.

Test: successful error if it exists, no error if it does not
Change-Id: I7dde3c88aaf7ecec23ffe018cbe8b42ebadb2bf8
2019-02-14 10:02:04 -08:00
Tom Cherry
766adc9cbc Fix failing test_fs_config_generator.py tests
Also run pylint and yapf to fix the style issues.

Test: these same tests
Change-Id: I0a783f7a6f08a90f615d94e9d16da0f314b7813f
2019-02-13 14:34:42 -08:00
Tom Cherry
e0f3ed5cd0 Remove TARGET_ANDROID_FILESYSTEM_CONFIG_H
TARGET_FS_CONFIG_GEN has existed as the preferred mechanism for two
releases, so we finally deprecate TARGET_ANDROID_FILESYSTEM_CONFIG_H.

Test: build
Change-Id: I299a4d1d1d893ac16d6e6ce2ec4659bfcdc19095
2019-02-11 13:45:01 -08:00
Tom Cherry
0377f12108 Add owners for fs_config
Test: n/a
Change-Id: I3f81216444240acfbc86c3ef5c21e142107eb044
2018-12-14 10:55:29 -08:00
Joe Onorato
2afb6eb22e Add a print command to fs_config_generator.py
This prints the uid map in a very simple format, with
AID_CONSTANT<space>uid
on each line.  This is super easy for other tools to
parse, and generate their own mappings, without requiring
edits to fs_config_generator.py itself.

Test: make, treehugger
Change-Id: I10e24ac29d440a24d43580880343d122ae1cdf02
2018-12-13 11:38:07 -08:00
Mark Salyzyn
640816eb42 fs_config: remove empty fs_config_* automation.
The code to manage citing empty <partition>/etc/fs_config_{files|dirs}
content by specifically setting the file(s) to access mode 00000 is
bitrotted and ill-suited for multiple partitions and was written for
a more paranoid time when DAC and MAC rules were not nearly as mature.

Striking out the complications as it affected deterministic results.

Test: compile and boot
Bug: 119310326
Change-Id: Iec02e0c1194eaa799ab95adff4ff0951a24652a4
2018-12-12 08:40:19 -08:00
Mark Salyzyn
cf343a6d1e fs_config: add product and product_services
Mechanical extension of mount directories to also support product/
and product_services/ as individually supplied images.

NB: In the distant past, a prototype placing the make rules into a
    macro was rejected as too difficult to maintain within the macro
    rules, so rules are rolled-out to make them easy to understand.

Test: compile
Bug: 119310326
Change-Id: Ief137cbe62db7175ee02275804ff1d644858dc3d
2018-12-06 22:13:26 +00:00
Vic Yang
5b3a7c0069 Move android_ids from .data.rel.ro to .rodata
Pages in .data.rel.ro are always dirty.  Move whatever we can to
.rodata so that we reduce memory pressure.

The size of rodata, text, and data.rel.ro sections of libc on cuttlefish
before/after this change:
    rodata: 0xfd70 -> 0x101d0 (+1120 bytes)
    text: 0xb5715 -> 0xb56e5 (-48 bytes)
    data.rel.ro: 0x57e0 -> 0x5230 (-1456 bytes)

While this change alone doesn't reduce the number of dirty pages
from data.rel.ro on cuttlefish, it is a step in that direction.

Test: Build and boot cuttlefish
Change-Id: Iff8203940495109dd01c40f31b034cfb2882e7f4
2018-12-05 00:10:19 -08:00
Mark Salyzyn
705b59e155 fs_config: fix fs_config_*_system targets
Content from fs_config designated for other partitions is leaking
into the system fs_config_* files.  Notably /vendor is showing up.

Rule expansion happens late, after all parsing.  This is the same in
make and kati.  build/make/tools/fs_config/Android.mk ends with
fs_config_generate_extra_partition_list :=, so by the time you get to
rule expansion the value is empty.

Added a PRIVATE_PARTITION_LIST variable to record the value of
fs_config_generate_extra_partition-list.

Test: inspect result of ${OUT}/product/*/system/etc/fs_config_files
Bug: 119677224
Bug: 119310326
Change-Id: I968b4936ab2c5d174f164c760820af13434654ca
2018-11-19 07:14:54 -08:00
Anton Hansson
e85ec84eef Split up fs_config_* modules per partition.
This was already done for partitions other than the system partition.
Add new, separate "_system" targets, and add new phony modules which
collects _system and _nonsystem targets for now.

Update the base_system.mk file to only depend on the system module, and
put the other ones in base_vendor.mk for now.

Bug: 80410283
Test: make fs_config_dirs[_*] fs_config_files[_*] and verify output
Change-Id: I7843578dbb9f27edf4c1e5b4a795a530f79e0be1
2018-06-27 11:15:59 +01:00
Tom Cherry
b6b2d49e23 Merge "Always create /vendor/etc/{passwd,group}" 2018-06-15 17:04:16 +00:00
Tom Cherry
53940fd2ba Always create /vendor/etc/{passwd,group}
Previously we only created these if the device set
TARGET_FS_CONFIG_GEN, however there are now other targets that want to
depend on these.  Instead of having those targets conditionally depend
on them, we always create them, defaulting to blank contents (by
reading /dev/null for TARGET_FS_CONFIG_GEN).

Test: builds succeed
Change-Id: Ie95286f5a800d891022eb66cd6fefcc967000c2e
2018-06-14 13:29:32 -07:00
Wei Wang
77e329a6a6 fs_config_generator: use vendor shell for vendor AID
Bug: 109748241
Test: Build and check generated file
Change-Id: Ib6bca77aa906a1aa9ed41c51bddb2871ecb66e1a
2018-06-06 15:14:42 -07:00
Wei Wang
3b5d3b1525 Remove comment line in generated passwd file
The man page for the password file (man 5 passwd) does not mention any
provisions for comment line other than comment field

Bug: 109748241
Test: Build and check generated file
Change-Id: I2912d0844cf3f077184129d1a0121b50b09ef1e3
2018-06-05 15:34:58 -07:00
Tom Cherry
2d197a1e19 Require a vendor_ prefix for users/groups in /vendor/etc/{passwd,group}
Bug: 79528966
Test: successful build with vendor_ prefixed users/groups
Test: expected build failure when not using vendor_ prefixed users/groups
Change-Id: If006c70178aa5bdcc9521a06ef8df2500f70bbb9
2018-05-14 13:16:50 -07:00
Tom Cherry
7a95c15c15 Convert liboemaids to oemaids_headers as a headers only library
Bug: 77298768
Test: test that config.fs AIDs are visible through this library
Change-Id: Ifbf3276212ea6904533ac23021bfce29d9a3c5d9
2018-04-04 12:29:14 -07:00
Treehugger Robot
3d4fb4e335 Merge "Make mksquashfs generate a fs_config-friendly root entry" 2018-02-27 16:24:21 +00:00
Tom Cherry
3d9fa3615d Merge "Place TARGET_FS_CONFIG_GEN passwd/group files in /vendor/etc" 2018-02-12 16:27:20 +00:00
Tom Cherry
ee0610e86c Add compile time check that friendly AID names are < 32 characters
There is an internal buffer in bionic for user/group names that is 32
characters long including the trailing null, so we must restrict the
length of these names during compile time.

Bug: 27999086
Test: Successfully compile a valid config.fs
Test: Fail to compile a config.fs with AID name > 31 characters
Change-Id: I7fe887c630dd4d1033b86a5d8332480eb3b0fa07
2018-02-09 18:46:13 +00:00
Tom Cherry
55d0104f1b Place TARGET_FS_CONFIG_GEN passwd/group files in /vendor/etc
These entries are vendor provided and belong on the /vendor partition.

Bug: 27999086
Test: end to end user/group check via config.fs and getpwnam, etc.
Change-Id: I9a5d56da594bf0d04de2b9ce7fd7d9a8151d4682
2018-02-09 10:44:52 -08:00
Luis Hector Chavez
440da2d41a Make mksquashfs generate a fs_config-friendly root entry
This change adds a flag so that the mksquashfs wrapper scripts generate
an entry that is fs_config-friendly for the root inode. Namely, the root
entry is expected to have an empty filename.

Bug: 72745016
Test: m -j100 dist
Change-Id: Iebdf79c5af0b9d999b7e5f5fe240abfe52cbadda
2018-02-07 10:22:52 -08:00