From 8d8604dbe743fa2bec8571e343df9fa06196428e Mon Sep 17 00:00:00 2001 From: Dmitry Muhomor Date: Sat, 26 Aug 2023 15:07:56 +0300 Subject: [PATCH] check PLATFORM_SECURITY_PATCH value in product Makefile On devices that no longer receive vendor updates (e.g. Pixel 4 / 4 XL), PLATFORM_SECURITY_PATCH should be overriden to correctly indicate that. --- config/device/common/gen4pixel.yml | 1 + src/build/make.ts | 7 +++++++ src/config/device.ts | 2 ++ 3 files changed, 10 insertions(+) diff --git a/config/device/common/gen4pixel.yml b/config/device/common/gen4pixel.yml index ce2a3aa..98325a8 100644 --- a/config/device/common/gen4pixel.yml +++ b/config/device/common/gen4pixel.yml @@ -8,6 +8,7 @@ includes: device: build_id: TP1A.221005.002.B2 prev_build_id: TP1A.221005.002 + platform_security_patch_level_override: 2022-11-01 filters: files: diff --git a/src/build/make.ts b/src/build/make.ts index a960296..08de098 100644 --- a/src/build/make.ts +++ b/src/build/make.ts @@ -246,6 +246,13 @@ PRODUCT_MANUFACTURER := ${mk.manufacturer}`) endif`) } + let splOverride = config?.device?.platform_security_patch_level_override + if (splOverride !== undefined) { + blocks.push(`ifneq ($(PLATFORM_SECURITY_PATCH),${splOverride}) + $(error PLATFORM_SECURITY_PATCH: expected ${splOverride}, got $(PLATFORM_SECURITY_PATCH)) +endif`) + } + return finishBlocks(blocks) } diff --git a/src/config/device.ts b/src/config/device.ts index 51f8f93..f3e2cba 100644 --- a/src/config/device.ts +++ b/src/config/device.ts @@ -29,6 +29,8 @@ export interface DeviceConfig { system_fs_type: FsType build_id: string prev_build_id: string + // ignored when undefined + platform_security_patch_level_override?: string } platform: {