[RFC PATCH v2 0/1] Introduce mtd splitter for ELF kernel loader

Sander Vanheule sander at svanheule.net
Sat Jul 11 09:45:38 EDT 2020

Currently, there appears to be no mtd splitter that works with a
firmware partition starting with an ELF kernel loader. Devices using a
loader must provide manual splits, possibly increasing the maintenance
effort for these devices.

This splitter may for example be used with the TP-Link CPE devices that
use a plain ELF loader or OKLI loader, but currently require a fixed
partition layout. Some examples are CPE510 and CPE610 devices.

Support is provided for 32-bit and 64-bit platforms, as well as
different rootfs types. This splitter has been tested on the TP-Link
EAP245v1 (32-bit platform with squashfs root).

Changes since v1:
  - Fix whitespace issues
  - Rename elf_header.class* to elf_header.elf*
  - Use stack for elf header instead of vmalloc
    mtdsplit_tplink uses a much larger header on the stack, so using
    vmalloc doesn't seem justified.

Sander Vanheule (1):
  kernel: mtdsplit: support ELF loader splitting

 .../files/drivers/mtd/mtdsplit/Kconfig        |   5 +
 .../files/drivers/mtd/mtdsplit/Makefile       |   1 +
 .../files/drivers/mtd/mtdsplit/mtdsplit_elf.c | 196 ++++++++++++++++++
 3 files changed, 202 insertions(+)
 create mode 100644 target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_elf.c


More information about the openwrt-devel mailing list