summaryrefslogtreecommitdiff
path: root/filesystem/android_device.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2025-03-04 00:11:21 +0000
committer Spandan Das <spandandas@google.com> 2025-03-04 00:34:50 +0000
commitc09353c15e447b330dc2dbb9def0ed1de2dd9188 (patch)
tree2f8e81520f1e374ba0f8f36bbc855ad1977857d1 /filesystem/android_device.go
parent21c11463ea0456f0592415bc381095347b84ed0e (diff)
Copy kernel_configs.txt and kernel_version.txt to target_files.zip
Move extractKernelVersionAndConfigs before buildTargetFilesZip. The intermediate kernel_configs.txt and kernel_version.txt will be copied to the META subdirectory of target_files.zip Test: Built soong's target_files.zip locally Bug: 399788685 Change-Id: Iae3efce1958ebcf7e06169771e359a332120ece4
Diffstat (limited to 'filesystem/android_device.go')
-rw-r--r--filesystem/android_device.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index 56a0a8443..005dc3439 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -109,6 +109,8 @@ type androidDevice struct {
proguardDictZip android.Path
proguardDictMapping android.Path
proguardUsageZip android.Path
+ kernelConfig android.Path
+ kernelVersion android.Path
}
func AndroidDeviceFactory() android.Module {
@@ -183,9 +185,9 @@ func (a *androidDevice) GenerateAndroidBuildActions(ctx android.ModuleContext) {
allInstalledModules := a.allInstalledModules(ctx)
+ a.kernelConfig, a.kernelVersion = a.extractKernelVersionAndConfigs(ctx)
a.buildTargetFilesZip(ctx, allInstalledModules)
a.buildProguardZips(ctx, allInstalledModules)
- a.extractKernelVersionAndConfigs(ctx)
var deps []android.Path
if proptools.String(a.partitionProps.Super_partition_name) != "" {
@@ -637,6 +639,14 @@ func (a *androidDevice) copyMetadataToTargetZip(ctx android.ModuleContext, build
builder.Command().Textf("cp").Input(fastbootInfo).Textf(" %s/META/fastboot-info.txt", targetFilesDir.String())
}
+ // kernel_configs.txt and kernel_version.txt
+ if a.kernelConfig != nil {
+ builder.Command().Textf("cp").Input(a.kernelConfig).Textf(" %s/META/", targetFilesDir.String())
+ }
+ if a.kernelVersion != nil {
+ builder.Command().Textf("cp").Input(a.kernelVersion).Textf(" %s/META/", targetFilesDir.String())
+ }
+
if a.partitionProps.Super_partition_name != nil {
superPartition := ctx.GetDirectDepProxyWithTag(*a.partitionProps.Super_partition_name, superPartitionDepTag)
if info, ok := android.OtherModuleProvider(ctx, superPartition, SuperImageProvider); ok {