[PATCH v3 1/3] ipq40xx: image: limit kernel size for NOR devices

Tomasz Maciej Nowak tmn505 at gmail.com
Tue Jul 25 10:16:25 PDT 2023


W dniu 25.07.2023 o 12:27, Robert Marko pisze:
> On Mon, 24 Jul 2023 at 15:31, Tomasz Maciej Nowak <tmn505 at terefe.re> wrote:
>>
>> From: Tomasz Maciej Nowak <tmn505 at gmail.com>
>>
>> 'bootipq' command on some devices, with kernel on NOR flash chip, read
>> kernel partition size from Qualcomm proprietary partition table, which
>> seems to be stored in MIBIB partition. The partition table can be read
>> by 'smeminfo' command in U-Boot command line interface. Because this
>> partition table is never updated on sysupgrade (even when the kernel
>> size changes) kernel size is capped at initial value, usually 4MiB.
>> Sysupgrading such kernel will soft-brick the device, which will need
>> serial console for recovery. Some devices already suffer from this,
>> beacuse its U-Boot does not allow to boot LZMA compressed kernel image
>> and/or kernel zImage. Even some devices allowing to boot LZMA compressed
>> kernel will hit this limitation later. Therefore limit the kernel size
>> to 4MiB for devices not having it specified, so we won't create
>> soft-bricking images.
>>
>> Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
>> ---
>>  target/linux/ipq40xx/image/generic.mk | 7 +++++++
>>  1 file changed, 7 insertions(+)
>>
>> diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk
>> index f15463ae8ca5..d9d60a25ff0f 100644
>> --- a/target/linux/ipq40xx/image/generic.mk
>> +++ b/target/linux/ipq40xx/image/generic.mk
>> @@ -130,6 +130,7 @@ define Device/8dev_habanero-dvk
>>         DEVICE_VENDOR := 8devices
>>         DEVICE_MODEL := Habanero DVK
>>         IMAGE_SIZE := 30976k
>> +       KERNEL_SIZE := 4096k
> 
> Habanero does not have a kernel size limit as its not using bootipq for booting.

Thanks, I'll remove it from the patch in next iteration.

> 
> Regards,
> Robert

Regards

-- 
TMN




More information about the openwrt-devel mailing list