Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config/device/common/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,9 @@ backport_files:
- lib64/vendor.samsung_slsi.telephony.hardware.radioExternal-V1-ndk.so
- lib64/vendor.samsung_slsi.telephony.hardware.radioExternal@1.0.so
- lib64/vendor.samsung_slsi.telephony.hardware.radioExternal@1.1.so

secondary_backport_files:
vendor:
- lib64/egl/libEGL_powervr.so
- lib64/egl/libGLESv1_CM_powervr.so
- lib64/egl/libGLESv2_powervr.so
1 change: 1 addition & 0 deletions config/device/common/gen10pixel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ includes:

device:
platform: laguna
secondary_backport_build_id: CP21.260206.011

package_exclusions:
- com.google.android.apps.bard # Gemini
Expand Down
21 changes: 19 additions & 2 deletions src/commands/generate-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import { processSepolicy } from '../processor/sepolicy'
import { processSysconfig } from '../processor/sysconfig'
import { processVintf } from '../processor/vintf'
import { gitDiff } from '../util/cli'
import { mapGet } from '../util/data'
import { assertDefined, mapGet } from '../util/data'
import {
DIR_SPEC_PLACEHOLDER,
FileTreeComparison,
Expand Down Expand Up @@ -215,7 +215,9 @@ export default class GenerateFull extends Command {
let backportBuildId = config.device.backport_build_id
if (backportBuildId !== undefined) {
let backportDeviceImages = mapGet(images, getDeviceBuildId(config, backportBuildId))
let fileOverlays: { [part: string]: Set<string> } = Object.fromEntries(Object.entries(config.backport_files).map(([k, v]) => [k, new Set(v)]))
let fileOverlays: { [part: string]: Set<string> } = Object.fromEntries(
Object.entries(config.backport_files).map(([k, v]) => [k, new Set(v)]),
)
let fileOverlaysByDir: { [part: string]: { [dir: string]: Set<string> } } = {}
for (let [part, filePaths] of Object.entries(fileOverlays)) {
let filesByDir: { [dir: string]: Set<string> } = {}
Expand All @@ -235,11 +237,26 @@ export default class GenerateFull extends Command {
fileOverlaysByDir[part] = filesByDir
}

let secondaryBackportBuildId = config.device.secondary_backport_build_id
let secondaryFileOverlays: { [part: string]: Set<string> } | undefined = undefined
let secondaryBasePath: string | undefined = undefined
if (secondaryBackportBuildId !== undefined) {
secondaryBasePath = mapGet(
images,
getDeviceBuildId(config, secondaryBackportBuildId),
).unpackedFactoryImageDir
secondaryFileOverlays = Object.fromEntries(
Object.entries(assertDefined(config.secondary_backport_files)).map(([k, v]) => [k, new Set(v)]),
)
}

pathResolver.overlay = {
basePath: backportDeviceImages.unpackedFactoryImageDir,
secondaryBasePath,
dirOverlays: config.backport_dirs,
fileOverlays,
fileOverlaysByDir,
secondaryFileOverlays,
}
}
// Prepare output directories
Expand Down
35 changes: 31 additions & 4 deletions src/commands/show-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { BuildIndex, ImageType, loadBuildIndex } from '../images/build-index'
import { DeviceImage } from '../images/device-image'
import { updateMultiMap } from '../util/data'
import { log } from '../util/log'
import { loadBuildIdToTagMap } from './update-aosp-tag-index'
import { BuildIdToTag, loadBuildIdToTagMap } from './update-aosp-tag-index'

export default class ShowStatus extends Command {
static flags = {
Expand All @@ -19,11 +19,13 @@ export default class ShowStatus extends Command {

let buildIdMap = new Map<string, DeviceConfig[]>()
let backportBuildIdMap = new Map<string, DeviceConfig[]>()
let secondaryBackportBuildIdMap = new Map<string, DeviceConfig[]>()
// platform security patch levels
let psplMap = new Map<string, DeviceConfig[]>()
let buildIndex = await loadBuildIndex()
let mainImageStatus = new ImageStatus(buildIndex)
let backportImageStatus = new ImageStatus(buildIndex)
let secondaryBackportImageStatus = new ImageStatus(buildIndex)

for (let config of configs) {
updateMultiMap(buildIdMap, config.device.build_id, config)
Expand All @@ -33,20 +35,32 @@ export default class ShowStatus extends Command {
updateMultiMap(backportBuildIdMap, backportBuildId, config)
await backportImageStatus.update(config, backportBuildId)
}
let secondaryBackportBuildId = config.device.secondary_backport_build_id
if (secondaryBackportBuildId !== undefined) {
updateMultiMap(secondaryBackportBuildIdMap, backportBuildId, config)
await secondaryBackportImageStatus.update(config, secondaryBackportBuildId)
}
updateMultiMap(psplMap, config.device.platform_security_patch_level_override, config)
}

let buildIdToTag = await loadBuildIdToTagMap()

this.log(chalk.bold('Tag | Build ID:'))
this.log(chalk.bold('Main stock image:'))
for (let [buildId, configs] of buildIdMap.entries()) {
this.log(`${buildIdToTag?.get(buildId) ?? '[no tag]'} | ${buildId}: ` + getDeviceNames(configs))
this.log(`${expandBuildId(buildIdToTag, buildId)}: ` + getDeviceNames(configs))
}

if (backportBuildIdMap.size > 0) {
this.log(chalk.bold('\nBackports:'))
for (let [buildId, configs] of backportBuildIdMap.entries()) {
this.log(`${buildIdToTag?.get(buildId) ?? '[no tag]'} | ${buildId}: ` + getDeviceNames(configs))
this.log(`${expandBuildId(buildIdToTag, buildId)}: ` + getDeviceNames(configs))
}

if (secondaryBackportBuildIdMap.size > 0) {
this.log(chalk.bold('\nSecondary backports:'))
for (let [buildId, configs] of secondaryBackportBuildIdMap.entries()) {
this.log(`${expandBuildId(buildIdToTag, buildId)}: ` + getDeviceNames(configs))
}
}
}

Expand All @@ -65,12 +79,25 @@ export default class ShowStatus extends Command {
backportImageStatus.log()
}

if (secondaryBackportBuildIdMap.size > 0) {
this.log(chalk.bold('\nSecondary backport stock image:'))
secondaryBackportImageStatus.log()
}

if (mainImageStatus.unknownImages.size + backportImageStatus.unknownImages.size !== 0) {
process.exit(1)
}
}
}

function expandBuildId(buildIdToTag: BuildIdToTag | null, buildId: string) {
let tag = buildIdToTag?.get(buildId)
if (tag == undefined) {
return buildId
}
return tag + ' | ' + buildId
}

class ImageStatus {
static imageTypes = [ImageType.Factory, ImageType.Ota]

Expand Down
2 changes: 1 addition & 1 deletion src/commands/update-aosp-tag-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { showGitDiff } from '../util/cli'
import { readFile } from '../util/fs'
import { GitLsRemote } from '../util/git'

type BuildIdToTag = Map<string, string>
export type BuildIdToTag = Map<string, string>

export async function loadBuildIdToTagMap(): Promise<BuildIdToTag | null> {
try {
Expand Down
3 changes: 3 additions & 0 deletions src/config/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface DeviceConfig {
build_id: string
is_beta_build_id: boolean
backport_build_id: string | undefined
secondary_backport_build_id: string | undefined
is_beta_backport_build_id: boolean
backport_base_firmware?: boolean
prev_build_id: string
Expand Down Expand Up @@ -92,6 +93,8 @@ export interface DeviceConfig {

backport_dirs: { [part: string]: string[] }
backport_files: { [part: string]: string[] }
// Files to backport from secondary_backport_build_id. Must be a subset of backport_files
secondary_backport_files?: { [part: string]: string[] }

apk_map: { [apk_path: string]: ApkMapping }
apex_map: { [apex_path: string]: ApexMapping }
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export async function prepareDeviceImages(
if (backportBuildId !== undefined) {
buildIds.push(backportBuildId)
}
let secondaryBackportBuildId = deviceConfig.device.secondary_backport_build_id
if (secondaryBackportBuildId !== undefined) {
buildIds.push(secondaryBackportBuildId)
}
}

for (let buildIdSpec of buildIds) {
Expand Down
7 changes: 7 additions & 0 deletions src/util/partitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import path from 'path'
import { PartPath } from '../blobs/file-list'
import { UNPACKED_APEXES_DIR_NAME } from '../frontend/source'
import { isFile } from './fs'
import { assertDefined } from './data'

export enum Partition {
Root = 'root',
Expand Down Expand Up @@ -31,8 +32,11 @@ export enum Partition {

export interface OverlayConfig {
basePath: string
secondaryBasePath?: string
dirOverlays: { [part: string]: string[] }
fileOverlays: { [part: string]: Set<string> }
// secondaryFileOverlays must be a subset of fileOverlays
secondaryFileOverlays?: { [part: string]: Set<string> }
fileOverlaysByDir: { [part: string]: { [dir: string]: Set<string> } }
}

Expand Down Expand Up @@ -77,6 +81,9 @@ export class PathResolver {
}
}
if (shouldOverlay) {
if (overlay.secondaryFileOverlays?.[part]?.has(relPath) === true) {
return path.join(assertDefined(overlay.secondaryBasePath), partPath, relPath)
}
return path.join(overlay.basePath, partPath, relPath)
}
}
Expand Down
6 changes: 3 additions & 3 deletions vendor-specs/google_devices/blazer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6464,9 +6464,9 @@ proprietary/vendor/lib64/com.google.input-V2-ndk.so: b684e105868cbda0bf72036e6d5
proprietary/vendor/lib64/com.google.input-V6-ndk.so: 4fcdaff2c2c6b379131acda0957e40ddc3dd705db9dcc10eb819d0c4aa7e1a71
proprietary/vendor/lib64/com.google.pixel.modem.logmasklibrary-V1-ndk.so: ce0d9dc6e84dc57b747101dc5df3b63cb3d596147f4f0cb47753c47179aefa02
proprietary/vendor/lib64/egl: dir
proprietary/vendor/lib64/egl/libEGL_powervr.so: cd5d3bc92837fa0702ef475ed13c564c5d45cbdd9a6935ee0ff248d28ead8619
proprietary/vendor/lib64/egl/libGLESv1_CM_powervr.so: 9d0049f7efa9b0bc0722475f3af5543e7cf142d026ed5d18fceb2cc8e6f2c139
proprietary/vendor/lib64/egl/libGLESv2_powervr.so: b5b0282738114813d7299c4fb7e7ae143a72b3ba5a48bce80adf2ccd142d9a5c
proprietary/vendor/lib64/egl/libEGL_powervr.so: 5e9ed7dbc559b12b4960458886970240924069038f066bb6d984a4ffdf57ba5e
proprietary/vendor/lib64/egl/libGLESv1_CM_powervr.so: 6a9f11fd22506054e4ea924df36b17bd4ac5510b873dbe90a872373522d65659
proprietary/vendor/lib64/egl/libGLESv2_powervr.so: 11c33498c5ea36fd3cb65721a67dce5ab1f9536216ea17db9a2f222896b28320
proprietary/vendor/lib64/fake_gxp_telemetry_reader.so: bcb07d0d5266903934acbbb1dc49ffe8ca55c8d7d213aff132796ff020d368c0
proprietary/vendor/lib64/fake_libtachyon_core.so: cc7027060ac3d4fa27f5c1b6de92b1723b37050994d3ce735f94238957a94d88
proprietary/vendor/lib64/gxp_metrics_logger.so: f913b680c8e2d8b92df5e0d93388ea77ebe10824d60897bc5a9bbf2e56c827e6
Expand Down
6 changes: 3 additions & 3 deletions vendor-specs/google_devices/frankel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6431,9 +6431,9 @@ proprietary/vendor/lib64/com.google.input-V2-ndk.so: b684e105868cbda0bf72036e6d5
proprietary/vendor/lib64/com.google.input-V6-ndk.so: 4fcdaff2c2c6b379131acda0957e40ddc3dd705db9dcc10eb819d0c4aa7e1a71
proprietary/vendor/lib64/com.google.pixel.modem.logmasklibrary-V1-ndk.so: ce0d9dc6e84dc57b747101dc5df3b63cb3d596147f4f0cb47753c47179aefa02
proprietary/vendor/lib64/egl: dir
proprietary/vendor/lib64/egl/libEGL_powervr.so: cd5d3bc92837fa0702ef475ed13c564c5d45cbdd9a6935ee0ff248d28ead8619
proprietary/vendor/lib64/egl/libGLESv1_CM_powervr.so: 9d0049f7efa9b0bc0722475f3af5543e7cf142d026ed5d18fceb2cc8e6f2c139
proprietary/vendor/lib64/egl/libGLESv2_powervr.so: b5b0282738114813d7299c4fb7e7ae143a72b3ba5a48bce80adf2ccd142d9a5c
proprietary/vendor/lib64/egl/libEGL_powervr.so: 5e9ed7dbc559b12b4960458886970240924069038f066bb6d984a4ffdf57ba5e
proprietary/vendor/lib64/egl/libGLESv1_CM_powervr.so: 6a9f11fd22506054e4ea924df36b17bd4ac5510b873dbe90a872373522d65659
proprietary/vendor/lib64/egl/libGLESv2_powervr.so: 11c33498c5ea36fd3cb65721a67dce5ab1f9536216ea17db9a2f222896b28320
proprietary/vendor/lib64/fake_gxp_telemetry_reader.so: bcb07d0d5266903934acbbb1dc49ffe8ca55c8d7d213aff132796ff020d368c0
proprietary/vendor/lib64/fake_libtachyon_core.so: cc7027060ac3d4fa27f5c1b6de92b1723b37050994d3ce735f94238957a94d88
proprietary/vendor/lib64/gxp_metrics_logger.so: f913b680c8e2d8b92df5e0d93388ea77ebe10824d60897bc5a9bbf2e56c827e6
Expand Down
6 changes: 3 additions & 3 deletions vendor-specs/google_devices/mustang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6465,9 +6465,9 @@ proprietary/vendor/lib64/com.google.input-V2-ndk.so: b684e105868cbda0bf72036e6d5
proprietary/vendor/lib64/com.google.input-V6-ndk.so: 4fcdaff2c2c6b379131acda0957e40ddc3dd705db9dcc10eb819d0c4aa7e1a71
proprietary/vendor/lib64/com.google.pixel.modem.logmasklibrary-V1-ndk.so: ce0d9dc6e84dc57b747101dc5df3b63cb3d596147f4f0cb47753c47179aefa02
proprietary/vendor/lib64/egl: dir
proprietary/vendor/lib64/egl/libEGL_powervr.so: cd5d3bc92837fa0702ef475ed13c564c5d45cbdd9a6935ee0ff248d28ead8619
proprietary/vendor/lib64/egl/libGLESv1_CM_powervr.so: 9d0049f7efa9b0bc0722475f3af5543e7cf142d026ed5d18fceb2cc8e6f2c139
proprietary/vendor/lib64/egl/libGLESv2_powervr.so: b5b0282738114813d7299c4fb7e7ae143a72b3ba5a48bce80adf2ccd142d9a5c
proprietary/vendor/lib64/egl/libEGL_powervr.so: 5e9ed7dbc559b12b4960458886970240924069038f066bb6d984a4ffdf57ba5e
proprietary/vendor/lib64/egl/libGLESv1_CM_powervr.so: 6a9f11fd22506054e4ea924df36b17bd4ac5510b873dbe90a872373522d65659
proprietary/vendor/lib64/egl/libGLESv2_powervr.so: 11c33498c5ea36fd3cb65721a67dce5ab1f9536216ea17db9a2f222896b28320
proprietary/vendor/lib64/fake_gxp_telemetry_reader.so: bcb07d0d5266903934acbbb1dc49ffe8ca55c8d7d213aff132796ff020d368c0
proprietary/vendor/lib64/fake_libtachyon_core.so: cc7027060ac3d4fa27f5c1b6de92b1723b37050994d3ce735f94238957a94d88
proprietary/vendor/lib64/gxp_metrics_logger.so: f913b680c8e2d8b92df5e0d93388ea77ebe10824d60897bc5a9bbf2e56c827e6
Expand Down
6 changes: 3 additions & 3 deletions vendor-specs/google_devices/rango.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6749,9 +6749,9 @@ proprietary/vendor/lib64/com.google.input-V2-ndk.so: b684e105868cbda0bf72036e6d5
proprietary/vendor/lib64/com.google.input-V6-ndk.so: 4fcdaff2c2c6b379131acda0957e40ddc3dd705db9dcc10eb819d0c4aa7e1a71
proprietary/vendor/lib64/com.google.pixel.modem.logmasklibrary-V1-ndk.so: ce0d9dc6e84dc57b747101dc5df3b63cb3d596147f4f0cb47753c47179aefa02
proprietary/vendor/lib64/egl: dir
proprietary/vendor/lib64/egl/libEGL_powervr.so: cd5d3bc92837fa0702ef475ed13c564c5d45cbdd9a6935ee0ff248d28ead8619
proprietary/vendor/lib64/egl/libGLESv1_CM_powervr.so: 9d0049f7efa9b0bc0722475f3af5543e7cf142d026ed5d18fceb2cc8e6f2c139
proprietary/vendor/lib64/egl/libGLESv2_powervr.so: b5b0282738114813d7299c4fb7e7ae143a72b3ba5a48bce80adf2ccd142d9a5c
proprietary/vendor/lib64/egl/libEGL_powervr.so: 5e9ed7dbc559b12b4960458886970240924069038f066bb6d984a4ffdf57ba5e
proprietary/vendor/lib64/egl/libGLESv1_CM_powervr.so: 6a9f11fd22506054e4ea924df36b17bd4ac5510b873dbe90a872373522d65659
proprietary/vendor/lib64/egl/libGLESv2_powervr.so: 11c33498c5ea36fd3cb65721a67dce5ab1f9536216ea17db9a2f222896b28320
proprietary/vendor/lib64/fake_gxp_telemetry_reader.so: bcb07d0d5266903934acbbb1dc49ffe8ca55c8d7d213aff132796ff020d368c0
proprietary/vendor/lib64/fake_libtachyon_core.so: cc7027060ac3d4fa27f5c1b6de92b1723b37050994d3ce735f94238957a94d88
proprietary/vendor/lib64/goodix_sfps_suez.so: 92d1710b9d3cb694a41699edd2d8171fd9f54980e6d99ded74503272532a9b07
Expand Down