add support for specifying PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS
See da2d4a29bf
This commit is contained in:
parent
fd2d1aada8
commit
ab3cc0d13c
5 changed files with 23 additions and 1 deletions
|
@ -52,6 +52,8 @@ export interface DeviceMakefile {
|
|||
|
||||
vintfManifestPaths?: Map<string, string>
|
||||
|
||||
vendorLinkerConfigPath?: string
|
||||
|
||||
props?: PartitionProps
|
||||
fingerprint?: string
|
||||
enforceRros?: string
|
||||
|
@ -193,6 +195,10 @@ export function serializeDeviceMakefile(mk: DeviceMakefile) {
|
|||
}
|
||||
}
|
||||
|
||||
if (mk.vendorLinkerConfigPath !== undefined) {
|
||||
blocks.push(`PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS += ${mk.vendorLinkerConfigPath}`)
|
||||
}
|
||||
|
||||
if (mk.props != undefined) {
|
||||
for (let [partition, props] of mk.props.entries()) {
|
||||
if (props.size == 0) {
|
||||
|
|
|
@ -146,6 +146,14 @@ const doDevice = (
|
|||
)
|
||||
}
|
||||
|
||||
let vendorLinkerConfig = config.platform.vendor_linker_config
|
||||
let vendorLinkerConfigPath: string | null = null
|
||||
if (Object.keys(vendorLinkerConfig).length > 0) {
|
||||
let json = JSON.stringify(vendorLinkerConfig, null, 4)
|
||||
vendorLinkerConfigPath = path.join(dirs.proprietary, 'linker-config-adevtool.json')
|
||||
await fs.writeFile(vendorLinkerConfigPath, json)
|
||||
}
|
||||
|
||||
// 11. Build files
|
||||
await withSpinner('Generating build files', () =>
|
||||
generateBuildFiles(
|
||||
|
@ -156,6 +164,7 @@ const doDevice = (
|
|||
propResults,
|
||||
fwPaths,
|
||||
vintfManifestPaths,
|
||||
vendorLinkerConfigPath,
|
||||
sepolicyResolutions,
|
||||
stockSrc,
|
||||
),
|
||||
|
|
|
@ -67,7 +67,7 @@ const doDevice = (
|
|||
|
||||
// 4. Build files
|
||||
await withSpinner('Generating build files', () =>
|
||||
generateBuildFiles(config, dirs, entries, [], propResults, null, null, null, stockSrc, false, true),
|
||||
generateBuildFiles(config, dirs, entries, [], propResults, null, null, null, null, stockSrc, false, true),
|
||||
)
|
||||
|
||||
await writeEnvsetupCommands(config, dirs)
|
||||
|
|
|
@ -40,6 +40,7 @@ export interface DeviceConfig {
|
|||
product_makefile: string // required
|
||||
// not included in makefile for state collection build (generate-prep)
|
||||
extra_product_makefiles: string[]
|
||||
vendor_linker_config: object
|
||||
}
|
||||
|
||||
generate: {
|
||||
|
@ -102,6 +103,7 @@ const DEFAULT_CONFIG_BASE = {
|
|||
namespaces: [],
|
||||
sepolicy_dirs: [],
|
||||
extra_product_makefiles: [],
|
||||
vendor_linker_config: {},
|
||||
},
|
||||
generate: {
|
||||
overrides: true,
|
||||
|
|
|
@ -295,6 +295,7 @@ export async function generateBuildFiles(
|
|||
propResults: PropResults | null,
|
||||
fwPaths: string[] | null,
|
||||
vintfManifestPaths: Map<string, string> | null,
|
||||
vendorLinkerConfigPath: string | null,
|
||||
sepolicyResolutions: SelinuxPartResolutions | null,
|
||||
stockSrc: string,
|
||||
addAbOtaParts = true,
|
||||
|
@ -306,6 +307,10 @@ export async function generateBuildFiles(
|
|||
build.deviceMakefile!.packages!.push(...buildPkgs)
|
||||
build.deviceMakefile!.packages!.sort((a, b) => a.localeCompare(b))
|
||||
|
||||
if (vendorLinkerConfigPath !== null) {
|
||||
build.deviceMakefile!.vendorLinkerConfigPath = vendorLinkerConfigPath
|
||||
}
|
||||
|
||||
// Add device parts
|
||||
build.deviceMakefile = {
|
||||
props: propResults?.missingProps,
|
||||
|
|
Loading…
Reference in a new issue