From cd08e9bffcc02c054d471ab6fcf877728fe59be5 Mon Sep 17 00:00:00 2001 From: Jonathan Bakker Date: Thu, 28 Aug 2025 12:11:55 -0700 Subject: [PATCH 1/2] lk2nd: Add ability to specify OS version and patch level in mkbootimg Some bootloaders check that there is valid in the OS version and/or patch level fields of the Android boot.img. Add the ability to specify them. --- Documentation/building.md | 8 ++++++++ lk2nd/device/2nd/rules.mk | 2 ++ 2 files changed, 10 insertions(+) diff --git a/Documentation/building.md b/Documentation/building.md index 91c2e71e27..01e24aaa78 100644 --- a/Documentation/building.md +++ b/Documentation/building.md @@ -104,3 +104,11 @@ from the AOSP 13 source tree located in `lk2nd/certs/` are used to sign the image. `BOOTIMG_CERT` is expected to be in X.509 PEM format and `BOOTIMG_KEY` is expected to be in PKCS#8 format. + +### OS Version and OS Patch Level in lk2nd.img + +#### `MKBOOTIMG_OS_VERSION=` AND `MKBOOTIMG_OS_PATCH_LEVEL=` - Set `lk2nd.img` OS version and patch level + +Set the OS version and patch level to specific values, as some bootloaders +may check this. `MKBOOTIMG_OS_VERSION` is in format x.y.z and +`MKBOOTIMG_OS_PATCH_LEVEL` is in format YYYY-MM-DD diff --git a/lk2nd/device/2nd/rules.mk b/lk2nd/device/2nd/rules.mk index 06d2dd523b..3585f5b0fc 100644 --- a/lk2nd/device/2nd/rules.mk +++ b/lk2nd/device/2nd/rules.mk @@ -66,6 +66,8 @@ $(OUTBOOTIMG): $(OUTBINDTB) $(OUTQCDT) $(RAMDISK) $(if $(OUTQCDT),--qcdt=$(OUTQCDT)) \ $(if $(MKBOOTIMG_BASE),--base=$(MKBOOTIMG_BASE)) \ $(if $(MKBOOTIMG_PAGESIZE),--pagesize=$(MKBOOTIMG_PAGESIZE)) \ + $(if $(MKBOOTIMG_OS_VERSION),--os_version=$(MKBOOTIMG_OS_VERSION)) \ + $(if $(MKBOOTIMG_OS_PATCH_LEVEL),--os_patch_level=$(MKBOOTIMG_OS_PATCH_LEVEL)) \ --ramdisk=$(RAMDISK) \ $(MKBOOTIMG_ARGS) From 96af54441a9aba4a6c074239e9e03560decee0d8 Mon Sep 17 00:00:00 2001 From: Jonathan Bakker Date: Thu, 28 Aug 2025 12:30:47 -0700 Subject: [PATCH 2/2] dts: msm8952: add support for the Palm Phone (PVG100/pepito) --- Documentation/devices.md | 1 + .../dts/msm8952/msm8940-palm-pepito.dts | 31 +++++++++++++++++++ lk2nd/device/dts/msm8952/rules.mk | 1 + 3 files changed, 33 insertions(+) create mode 100644 lk2nd/device/dts/msm8952/msm8940-palm-pepito.dts diff --git a/Documentation/devices.md b/Documentation/devices.md index 5d5977de53..f6ab121fa7 100644 --- a/Documentation/devices.md +++ b/Documentation/devices.md @@ -100,6 +100,7 @@ - Motorola Moto G5S (montana) - Motorola Moto G6 Play (jeter) - OPPO A57 (A57) (quirky - see comment in `lk2nd/device/dts/msm8952/msm8940-oppo-a57.dts`) +- Palm Phone (pepito) (quirky - see comment in `lk2nd/device/dts/msm8952/msm8940-palm-pepito.dts`) - Redmi 3S (land) - Redmi 4 (prada) - Redmi 4A (rolex) diff --git a/lk2nd/device/dts/msm8952/msm8940-palm-pepito.dts b/lk2nd/device/dts/msm8952/msm8940-palm-pepito.dts new file mode 100644 index 0000000000..e06b464c1d --- /dev/null +++ b/lk2nd/device/dts/msm8952/msm8940-palm-pepito.dts @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: BSD-3-Clause + +#include +#include + +/* + * There are a few quirks to be aware of + * + * - Fastboot is not available on this device, lk2nd must be flashed via EDL. + * Some EDL programs (or versions thereof) do not work properly with available + * firehoses (or else need responses ignored). QDL is a known working implementation + * + * - The stock bootloader checks the OS version and the OS patch level in the boot.img as + * well as ensuring there is a signature in the boot.img (it does not matter the signature). + * When compiling lk2nd, set MKBOOTIMG_OS_VERSION=8.1.0 MKBOOTIMG_OS_PATCH_LEVEL=2020-09-01 + * and SIGN_BOOTIMG=1 + */ + +/ { + qcom,msm-id = ; + qcom,board-id = <0xaa000008 0x00>; +}; + +&lk2nd { + model = "Palm Phone (pepito)"; + compatible = "palm,pepito"; + + lk2nd,dtb-files = "qcom,msm8940-mtp", "qcom,msm8940", "qcom,mtp"; + + lk2nd,single-key-navigation; +}; diff --git a/lk2nd/device/dts/msm8952/rules.mk b/lk2nd/device/dts/msm8952/rules.mk index b9d260cc6d..784e159132 100644 --- a/lk2nd/device/dts/msm8952/rules.mk +++ b/lk2nd/device/dts/msm8952/rules.mk @@ -15,6 +15,7 @@ ADTBS += \ $(LOCAL_DIR)/msm8937-xiaomi-land.dtb \ $(LOCAL_DIR)/msm8940-mtp.dtb \ $(LOCAL_DIR)/msm8940-oppo-a57.dtb \ + $(LOCAL_DIR)/msm8940-palm-pepito.dtb \ $(LOCAL_DIR)/msm8940-xiaomi-santoni.dtb \ $(LOCAL_DIR)/msm8952-mtp.dtb \ $(LOCAL_DIR)/msm8956-mtp.dtb \