Add fs_config_files/fs_config_dirs/build_prop to system_dlkm
system_dlkm.img contains these metadata files in addition to the .ko
files. This CL pacakges these files via the following
1. Hardcode the deps in filesystem_creator.go, since these are auto
included by kati packaging system
2. Set partition type on the system_dlkm filesystem and
system_dlkm_specific: true on the prebuilt kernel modules. This
ensures that the partition based packaging filter does not cause
these files to be skipped.
Test: m soong_generated_system_dlkm_filesystem_test
KATI only installed file(s):
etc/NOTICE.xml.gz
Change-Id: I367f3c662f5e5bcd6cf452905b599e6725281c81
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go
index bcf2361..5f6475a 100644
--- a/fsgen/filesystem_creator.go
+++ b/fsgen/filesystem_creator.go
@@ -234,11 +234,6 @@
var module android.Module
if partitionType == "system" {
module = ctx.CreateModule(filesystem.SystemImageFactory, baseProps, fsProps)
- } else if partitionType == "system_dlkm" {
- // Do not set partition_type. build/soong/android/paths#modulePartition currently does not support dlkm
- // partitions. Since `android_filesystem` uses a partition based filter, setting the partition here
- // would result in missing in entries.
- module = ctx.CreateModule(filesystem.FilesystemFactory, baseProps, fsProps)
} else {
// Explicitly set the partition.
fsProps.Partition_type = proptools.StringPtr(partitionType)
@@ -260,12 +255,18 @@
fsGenState := ctx.Config().Get(fsGenStateOnceKey).(*FsGenState)
name := generatedModuleName(ctx.Config(), fmt.Sprintf("%s-kernel-modules", partitionType))
props := &struct {
- Name *string
- Srcs []string
+ Name *string
+ Srcs []string
+ System_dlkm_specific *bool
+ Vendor_dlkm_specific *bool // TODO (b/377562851)
+ Odm_dlkm_specific *bool // TODO (b/377563262)
}{
Name: proptools.StringPtr(name),
Srcs: kernelModules,
}
+ if partitionType == "system_dlkm" {
+ props.System_dlkm_specific = proptools.BoolPtr(true)
+ }
kernelModule := ctx.CreateModuleInDirectory(
kernel.PrebuiltKernelModulesFactory,
".", // create in root directory for now
diff --git a/fsgen/fsgen_mutators.go b/fsgen/fsgen_mutators.go
index e530a5b..2d4ad79 100644
--- a/fsgen/fsgen_mutators.go
+++ b/fsgen/fsgen_mutators.go
@@ -146,8 +146,14 @@
"com.android.vndk.v33": defaultDepCandidateProps(ctx.Config()),
"com.android.vndk.v34": defaultDepCandidateProps(ctx.Config()),
},
- "system_dlkm": {},
- "userdata": {},
+ "userdata": {},
+ "system_dlkm": {
+ // these are phony required deps of the phony fs_config_dirs_nonsystem
+ "fs_config_dirs_system_dlkm": defaultDepCandidateProps(ctx.Config()),
+ "fs_config_files_system_dlkm": defaultDepCandidateProps(ctx.Config()),
+ // build props are automatically added to `ALL_DEFAULT_INSTALLED_MODULES`
+ "system_dlkm-build.prop": defaultDepCandidateProps(ctx.Config()),
+ },
},
fsDepsMutex: sync.Mutex{},
moduleToInstallationProps: map[string]installationProperties{},