summaryrefslogtreecommitdiff
path: root/filesystem/filesystem.go
AgeCommit message (Collapse)Author
2024-12-10Revert "Remove unassigned event log tags feature" Priyanka Advani (xWF)
Revert submission 3400623-remove_unassigned_event_log_tags Reason for revert: Droidmonitor created revert due to b/383362497. Will be verifying through ABTD before submission. Reverted changes: /q/submissionid:3400623-remove_unassigned_event_log_tags Change-Id: I1378364ff5f9c6f09f47d72c104ae603e0d2063a
2024-12-10Merge "Use partition intead of "root" to assemble filesystem artifacts" into ↵ Treehugger Robot
main
2024-12-10Use partition intead of "root" to assemble filesystem artifacts Spandan Das
The artifacts for filesystem packaging are currently assembled in ``` $intermediates/$module/android_common/root/$base_dir ``` This CL changes this to ``` $intermediates/$module/android_common/$partition/$base_dir e.g. $intermediates/$module/android_common/system/system (system) $intermediates/$module/android_common/system_ext (system_ext) ``` The motivatiton for this change is to fix diffs in BuildManifestSystemExt.apk. The build_manifest.pb of this apk is generated from the base of $PRODUCT_OUT. This means that the paths of the artifacts contains the partition prefix. diff https://diff.googleplex.com/#key=9xuSx7nvP251 An alternative would be to use partition as the `Base_dir`, but this would create an additional top-level directory in the soong img files (make img files do not have a top-level partition directory for non system images) Test: 383144733 Bug: Built and mounted make and soong system_ext.img for AOSP CP. NOTICE is the last diff Change-Id: Iee53113a7e00dcda9d987f2aabf9605740bbe7fe
2024-12-10Define additional symlinks and dirs for recovery partition Jihoon Kang
To match that of the make generated recovery partition. Test: mount Soong generated recovery partition and compare with TARGET_RECOVERY_ROOT_OUT Bug: 381888358 Change-Id: I39822027088895525ef473ad9797f410d45ec7cd
2024-12-09Remove unassigned event log tags feature Cole Faust
.logtags files are a mapping of an integer -> name. However, there is an unused feature where you could put a '?' instead of an integer, and then the build system would assign a number to it, taking care to avoid all other already-assigned numbers across the source tree. This feature makes it hard to support some things we're working towards, like incremental soong and treble common system images, so remove it. Also modernize the python scripts a little. Bug: 382515940 Test: m event-log-tags Change-Id: Iae49e9924ac70f1ed0c141e21bc21c5d1974ef84
2024-12-05Remove Base_dir from non system non recovery filesystem Spandan Das
vendor.img/product.img... built by make do not assemble the artifacts in a $partition subdirectory. This CL adds this to soong built img files, and updates the symmlinks. Test: soong_generated_system_filesystem_test m soong_generated_vendor_filesystem_test soong_generated_product_filesystem_test Change-Id: Ia5feaf85bb49d552b93698c50998d8df7575e44a
2024-12-05Merge "Add selinux contexts to autogenerated partitions" into main Cole Faust
2024-12-05Add selinux contexts to autogenerated partitions Cole Faust
Filesystems had a selinux_contexts property that then compiled the selinux contexts. But in make, it uses the result of the file_contexts_bin_gen module, which already runs the compilation step. Add a precompiled_file_contexts property to accept that compiled file. Also add 2 missing symlinks to the system partition. Bug: 381120092 Test: diff'd make and soong build_image prop files Change-Id: Ia0681fa4afe43675b730eaf0857dc6b15771534e
2024-12-05Merge "Remove cross partition modules from provideLibs" into main Treehugger Robot
2024-12-05Remove cross partition modules from provideLibs Spandan Das
provideLibs of a partition is determined by doing a graph walk. This was causing linker.config.pb of vendor to have extraneous entries. Test: /vendor/etc/linker.config.pb is identical between make and soong img Change-Id: I79312083e1848a1f4cc1db1005a18ab887ba6ec0
2024-12-04Fixes for avb flags in soong-generated partitions Cole Faust
The logic for what variables control what aspect of AVB is pretty complicated, this brings make and soong closer together. Bug: 381120092 Test: m out/soong/.intermediates/build/soong/fsgen/aosp_cf_x86_64_phone_generated_system_image/android_common/prop, diff with make's prop file Change-Id: I6ada90262f4578d120c35b7f8d38c06c2b1d9c27
2024-12-03Add erofs compressor information to soong-generated partitions Cole Faust
Also change set a default compressor in the filesystem module type to match make. Bug: 381120092 Test: m out/soong/.intermediates/build/soong/fsgen/aosp_cf_x86_64_phone_generated_system_image/android_common/prop, diff with make Change-Id: Ic2b57f8f5e566d43a4aa52dd37574325d6d63c78
2024-12-03Merge changes from topic "recovery_soong_export" into main Treehugger Robot
* changes: Support auto-generating prebuilt_* modules for recovery partition Support auto gen module type matching in neverallow Introduce prebuilt_vendor module type Auto generate recovery partition
2024-12-02Auto generate recovery partition Jihoon Kang
This change conditionally auto generates the recovery partition in filesystem_generator. Test: m soong_generated_recovery_filesystem_test Bug: 381888358 Change-Id: I8938e842d8587ec1c986542385ed50c19dc1c76d
2024-12-02Automatically add system and system_ext autogen RRO to vendor/product Spandan Das
This CL creates a dependency edge from vendor/product to system and system_ext. A post deps mutator will walk the transitive closure and add the corresponding autogenerated RROs to deps. Bug: 374371755 Bug: 375277835 Test: m soong_generated_vendor_filesystem_test NOTICE is the last diff Change-Id: Iffe64174a0d639dc224505a08eccd0a1dedc9f39
2024-11-27Merge "Reland^2 : Do not allow vintf_fragments for modules installed in the ↵ Kiyoung Kim
filesystem"" into main
2024-11-27Reland^2 : Do not allow vintf_fragments for modules installed in the filesystem" Kiyoung Kim
Soong defined filesystem does not have any logic to handle vintf_fragments items, so those item should be used with vintf_fragment modules instead. This change checks if there is any module installed in the Soong defined filesystem and defines vintf_fragments property, and raises error for those modules. Bug: 322089980 Change-Id: Idd4c406c90571a07ff2cabd5629073d338af795c Test: There is no diff between vintf manifests of generic_system_image and aosp_cf_x86_64_phone
2024-11-26Disable sparse filesystems Cole Faust
The filesystems should not be parse unless one of the size-related variables are set, but currently filesystems don't support setting those size variables. Bug: 381120092 Test: m out/soong/.intermediates/build/soong/fsgen/aosp_cf_x86_64_phone_generated_system_image/android_common/aosp_cf_x86_64_phone_generated_system_image.img && file out/soong/.intermediates/build/soong/fsgen/aosp_cf_x86_64_phone_generated_system_image/android_common/aosp_cf_x86_64_phone_generated_system_image.img; observe that the filesystem is erofs instead of android sparse image Change-Id: I741531d5af8ad85664658995cd9fd3b46533d73c
2024-11-26Merge "Revert "Reland: Do not allow vintf_fragments for modules installed in ↵ Treehugger Robot
the filesystem"" into main
2024-11-26Revert "Reland: Do not allow vintf_fragments for modules installed in the ↵ Kiyoung Kim
filesystem" This reverts commit df17e7b6c3c7d26efab1ec9fbcffdf16c325a229. Reason for revert: Build failure from git_main/seahawk target Change-Id: I320864ae76101a5fd5e3b4ca6daa11bad3548ae7
2024-11-26Merge "Reland: Do not allow vintf_fragments for modules installed in the ↵ Treehugger Robot
filesystem" into main
2024-11-20Reland: Do not allow vintf_fragments for modules installed in the filesystem Kiyoung Kim
Soong defined filesystem does not have any logic to handle vintf_fragments items, so those item should be used with vintf_fragment modules instead. This change checks if there is any module installed in the Soong defined filesystem and defines vintf_fragments property, and raises error for those modules. Bug: 322089980 Change-Id: I6b21da631bb2f807afe9d88a1a8e892fde23509a Test: There is no diff between vintf manifests of generic_system_image and aosp_cf_x86_64_phone
2024-11-19Add partition size check to boot partitions Cole Faust
Since android devices are partitioned at the factory and the partitions can't be resized aftwards, make allows you to specify that partition size and asserts that the contents don't exceed it. Soong also needed this check. Bug: 377562951 Test: Manually modified BOARD_BOOTIMAGE_PARTITION_SIZE to test the warning and error Change-Id: I2368b350fb99c4055b14baa84b4964012f4934ef
2024-11-19Merge "Revert "Do not allow vintf_fragments for modules installed in the ↵ Chaitanya Cheemala (xWF)
filesystem"" into main
2024-11-19Revert "Do not allow vintf_fragments for modules installed in the filesystem" Chaitanya Cheemala (xWF)
This reverts commit d3d89ede5d31c6175915dc4516bf6cd5cb3cd350. Reason for revert: Likely culprit for b/379811732 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Change-Id: I9d70e7ae4a7c9663d6bc25f0291df615dfc6d58b
2024-11-19Merge "Do not allow vintf_fragments for modules installed in the filesystem" ↵ Treehugger Robot
into main
2024-11-18Merge "Auto-generate vendor ramdisk and boot image" into main Cole Faust
2024-11-18Auto-generate vendor ramdisk and boot image Cole Faust
They both still have a number of deficiences vs the make-built ones, but this is a start. Bug: 377563622 Test: Presubmits Change-Id: If3329ae44633b00a8c2c2d15e3574087f74efe88
2024-11-18Specify dev nodes list file for ramdisk partition generation Jihoon Kang
Ramdisk partition requires "-n" argument to be passed when generating the image file. Given that the value is agnostic to the target product and is set to a constant value, this is implicitly set internally in filesystem module. Test: inspect ramdisk.img build command Bug: 379190521 Change-Id: I01d0c1bf06e087ab49c71bdb0cfe48a08b9c7fc9
2024-11-14Do not allow vintf_fragments for modules installed in the filesystem Kiyoung Kim
Soong defined filesystem does not have any logic to handle vintf_fragments items, so those item should be used with vintf_fragment modules instead. This change checks if there is any module installed in the Soong defined filesystem and defines vintf_fragments property, and raises error for those modules. Bug: 322089980 Test: There is no diff between vintf manifests of generic_system_image and aosp_cf_x86_64_phone Change-Id: Ia03636e5d2975ab451650f70f66b46d7cd53e43a
2024-11-13Use fewer OutputPaths Cole Faust
A lot of the time, you really mean android.Path or android.WriteablePath instead of OutputPath. Also, many modules were holding onto OutputPaths/WriteablePaths after the files had already been generated, meaning they should no longer be treated as writable paths and are instead inputs into other actions. Change the type of those paths to just android.Path. Test: verified ninja files were unchanged on aosp_arm64-trunk_staging-userdebug Change-Id: Id773171bef59d855ba33c4b85cef268031cbec39
2024-11-12Make ModifyPackagingSpec generic to any filesystem Cole Faust
ModifyPackagingSpec was added to support installing product-partition modules on the system partition for GSI, but ramdisk also has a very similar issue, where it's modules are installed to the "ramdisk/system" partition. Make ModifyPackagingSpec generic so that it works on the ramdisk files. This reduces the ramdisk file diff down to just a missing build.prop file. Bug: 378146476 Test: m soong_generated_ramdisk_filesystem_test on aosp_cf_x86_64_phone Change-Id: I1d197679a1128400b6bb837d99e3aabe2ab3c68e
2024-11-12Add GSI support for android_system_image Inseob Kim
GSI's system.img includes system_ext and product artifacts. This patches android_system_image module so it can include such artifacts when building GSI. Bug: 370351758 Test: m android_gsi Change-Id: Id29678b1101e787e88dbedae38cdbf6d82d1cb95
2024-11-12Merge "Remove linkerconfig prop to linker_config" into main Treehugger Robot
2024-11-11Build ramdisk with soong Cole Faust
This is the first step to build the ramdisk, it still has some diffs with with the make-generated ramdisk though. Bug: 378146476 Test: m soong_generated_ramdisk_filesystem_test Change-Id: I767ea9d09e4d6413c2ec5af3120595e2001c9bb7
2024-11-11Remove linkerconfig prop to linker_config Spandan Das
This makes this consistent with its inner props `gen_linker_config` and `linker_config_srcs` Test: m nothing --no-skip-soong-tests Change-Id: I6efee5cc2d182af9c600ec80e3b02d1776ba8eb9
2024-11-11Merge "Use common interface to build linker configuration" into main Treehugger Robot
2024-11-08Use common interface to build linker configuration Kiyoung Kim
Current filesystem logic is quite separated with systemimage, so it can end up generating linker configuration twice which can end up an error case. This change creates a common interface and let both filesystem and systemimage can implement their own function to generate linker configuration. Bug: 324995772 Test: Compared linker.config.pb of generic_system_image with this patch Change-Id: Ic515e54deeafbae74fd02bb023661606aa7e0b7c
2024-11-07Add f2fs support to Soong filesystem modules mrziwang
Test: CI and unit tests Bug: 372522486 Change-Id: I4dd5efb6e81018903def05908dbdd71b11500fe7
2024-11-01Merge "Use a boolean to determine if linker.config.pb should be generated" ↵ Spandan Das
into main
2024-11-01Merge "Introduce packaging property high_priority_deps" into main Treehugger Robot
2024-11-01Introduce packaging property high_priority_deps Jihoon Kang
The property is used to specify the modules with higher install property when there are multiple source files for an install file. Test: m nothing Bug: 376345875 Change-Id: I4fc474b7c8d5e07dd59d509064e50d9798ae9e71
2024-11-01Use a boolean to determine if linker.config.pb should be generated Spandan Das
vendor and product generate a linker.config.pb even if `PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS` or `PRODUCT_PRODUCT_LINKER_CONFIG_FRAGMENTS` are empty respectively. This CL introduces a new property to determine if a filesystem should generate a linker.config.pb. The autogenerated vendor and product filesystem modules will set this property to true. Test: go test ./filesystem Bug: 376515221 Change-Id: Ibd007df0d287034f4d227a6054bd83937570ec27
2024-10-31Dedupe logic to generate linker.config.pb Spandan Das
Between android_filesystem and generic_system_image. `getLibsForLinkerConfig` will return a list of provideLibs and requireLibs for the fileystem. `linkerConfig.BuildLinkerConfig` will then filer out the non-stub libraries. For `android_filesystem`, requireLibs is ignored for now to match the logic in the kati built vendor.img Test: m nothing --no-skip-soong-tests Test: no diff in out/soong/.intermediates/build/make/target/product/generic/generic_system_image/android_common/gen/root-extra/system/etc/linker.config.pb paste of cmd: https://diff.googleplex.com/#key=KAqqP9bhKZMD Change-Id: I1f1d626a3a161fb2e12597909fd287533cbb8482
2024-10-31Add linker.config.pb support to android_filesystem Spandan Das
As part of the mk->bp conversion, all modules and partitions will eventually be built with Soong. vendor.img (built with kati) uses some rules in build/make/core to install a /etc/linker.config.pb file. This CL adds this logic to `android_filesystem`. This soong module will eventually be used to build vendor.img There are two main inputs to linker.config.pb generation for vendor. 1. PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS, a list of json files 2. List of stub libraries installed in vendor (1) will be passed to `android_filesystem` as `Linker_config_srcs`. (2) has a subtle difference between kati and soong implementation. Kati uses `SOONG_STUB_VENDOR_LIBRARIES` to determine the list of all vendor stub libraries in the tree, and then uses `--system $TARGET_OUT/vendor` to filter in the libraries which are actually installed. For the Soong implementation, this will be replaced with ctx.VisitDirectDeps, followed by child.HasStubVariants Test: go test ./filesystem Bug: 375686533 Change-Id: I6f9130d2aa866dcac9272b71939e40ed50a952ac
2024-10-25Install cross partition symlinks in autogenerated vendor.img Spandan Das
These match the symlinks present in the kati built vendor.img file. Since structs are not supported in `generateBpContent`, Android.bp generation for vendor is skipped for now. Bug: 374371755 Test: Verified that odm and lib/modules are present in vendor.img's fileList for aosp_cf_x86_64_phone Change-Id: I2564d23a5fc3b8e1aad360373ff2c103a074cfe7
2024-10-21Use a partition filter only for autogenerated partition modules Spandan Das
Using it for everything breaks some tests for compos (an apex). Test: go build ./filesystem Change-Id: I40de8678d0b5861317fa269df9c62b9823b1c87b
2024-10-21Revert^2 "Use a partition packaging spec filter for android_filesystem" Hugo Drumond Jacob
This reverts commit 02adec80da9796d685765dfb2ee8e96518072d3c. Reason for revert: b/374239899 Bug: 374239899 Change-Id: I263c11d02d26ea150484c185745cf58253352769
2024-10-21Revert "Use a partition packaging spec filter for android_filesystem" Pechetty Sravani (xWF)
This reverts commit 8a49643e6b727490898ea94b41667eecf24685f2. Reason for revert: <DroidMonitor created revert due to b/374395492.Will be verified through ABTD for standard investigation> Change-Id: I4494f15f1681bf2456439151771e84c7d1f221b7
2024-10-18Use a partition packaging spec filter for android_filesystem Spandan Das
This revives https://r.android.com/3308803. The use case for this filter is 1. To remove the transitive shared library dependencies of `system_ext` binaries that are intended to be installed in `system`. Without this filter, we get two copies of libc.so, libz.so, ... on device 2. To filter out dexpreopt files of apps. Even if an app is installed in `/system_ext`, its dexpreopt files will be installed in `system_other`. Kati allows this by allowing ctx.InstallFile to specify the path relative to device root. Diff in autogenerated `system_ext` partition for aosp cf before and after this CL https://diff.googleplex.com/#key=6ekb09PtreNh Test: go test ./filesystem Bug: 372487849 Change-Id: Ie52723be2469d3b210ee1ebb62997d378d44788b