From 06114545f4e8ba743059a070db66ee4a3b2e8793 Mon Sep 17 00:00:00 2001 From: Dmitry Muhomor Date: Mon, 5 Jun 2023 16:09:15 +0300 Subject: [PATCH] make addition of "require partition-exists=vendor_kernel_boot" generic Instead of hardcoding the list of devices (which is now missing lynx), check whether vendor_kernel_boot is present in the list of stock A/B partitions. --- src/frontend/generate.ts | 1 + src/images/firmware.ts | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/generate.ts b/src/frontend/generate.ts index dfd2d11..ee8a746 100644 --- a/src/frontend/generate.ts +++ b/src/frontend/generate.ts @@ -280,6 +280,7 @@ export async function extractFirmware( config.device.name, stockProps.get('vendor')!.get('ro.build.expect.bootloader')!, stockProps.get('vendor')!.get('ro.build.expect.baseband')!, + getAbOtaPartitionsProps(stockProps)!! ) await fs.writeFile(`${dirs.firmware}/${ANDROID_INFO}`, androidInfo) diff --git a/src/images/firmware.ts b/src/images/firmware.ts index ad01e1a..dd73b0c 100644 --- a/src/images/firmware.ts +++ b/src/images/firmware.ts @@ -62,15 +62,14 @@ export async function writeFirmwareImages(images: FirmwareImages, fwDir: string) return paths } -export function generateAndroidInfo(device: string, blVersion: string, radioVersion: string) { +export function generateAndroidInfo(device: string, blVersion: string, radioVersion: string, stockAbOtaPartitions: string[]) { let android_info = `require board=${device} require version-bootloader=${blVersion} require version-baseband=${radioVersion} ` - const vendor_kernel_boot_devices = ['cheetah', 'panther'] - if (vendor_kernel_boot_devices.includes(device)) { + if (stockAbOtaPartitions.includes('vendor_kernel_boot')) { android_info += 'require partition-exists=vendor_kernel_boot\n' }