Minor fixes for META/kernel_version.txt
- extractKernelVersionAndConfigs returns (version,config) but was
incorrectly assigned to (config,version)
- kernel_version.txt generated by make has a newline at the end. This CL
adds the newline to Soong's kernel_version.txt for bit-identical.
Test: Diff'd make and soong built kernel_version.txt
Change-Id: I3131d1253057715e0c361c8036769223e5965b7b
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index b1f668d..a616ee0 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -191,7 +191,7 @@
allInstalledModules := a.allInstalledModules(ctx)
a.apkCertsInfo = a.buildApkCertsInfo(ctx, allInstalledModules)
- a.kernelConfig, a.kernelVersion = a.extractKernelVersionAndConfigs(ctx)
+ a.kernelVersion, a.kernelConfig = a.extractKernelVersionAndConfigs(ctx)
a.miscInfo = a.addMiscInfo(ctx)
a.buildTargetFilesZip(ctx, allInstalledModules)
a.buildProguardZips(ctx, allInstalledModules)
@@ -881,11 +881,12 @@
Flag("--tools lz4:"+lz4tool.String()).Implicit(lz4tool).
FlagWithInput("--input ", kernel).
FlagWithOutput("--output-release ", extractedVersionFile).
- FlagWithOutput("--output-configs ", extractedConfigsFile)
+ FlagWithOutput("--output-configs ", extractedConfigsFile).
+ Textf(`&& printf "\n" >> %s`, extractedVersionFile)
if specifiedVersion := proptools.String(a.deviceProps.Kernel_version); specifiedVersion != "" {
specifiedVersionFile := android.PathForModuleOut(ctx, "specified_kernel_version.txt")
- android.WriteFileRuleVerbatim(ctx, specifiedVersionFile, specifiedVersion)
+ android.WriteFileRule(ctx, specifiedVersionFile, specifiedVersion)
builder.Command().Text("diff -q").
Input(specifiedVersionFile).
Input(extractedVersionFile).