aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile
diff options
context:
space:
mode:
authorSander Vanheule <sander@svanheule.net>2020-07-02 22:33:56 +0200
committerStijn Tintel <stijn@linux-ipv6.be>2020-09-09 20:41:50 +0300
commit3f7047db7aafd0846ccddf102aad32ea13588cfb (patch)
treeb13abeb7f8edbec5e0693a668b22a66486edcaf7 /target/linux/generic/files/drivers/mtd/mtdsplit/Makefile
parentf58d3235342433eeba7458b0a527ee2b3725ee3a (diff)
downloadupstream-3f7047db7aafd0846ccddf102aad32ea13588cfb.tar.gz
upstream-3f7047db7aafd0846ccddf102aad32ea13588cfb.tar.bz2
upstream-3f7047db7aafd0846ccddf102aad32ea13588cfb.zip
kernel: mtdsplit: support ELF loader splitting
To parse the ELF kernel loader, a small ELF parser is used that can handle both ELF32 or ELF64 class loaders. The splitter assumes that the kernel is always located before the rootfs, whether it is embedded in the loader or not. If the kernel is located after the rootfs on the firmware partition, then the rootfs splitter will include it in the dynamically created rootfs_data partition and the kernel will be corrupted. The kernel image is preferably embedded inside the ELF loader, so the end of the loader equals the end of the kernel partition. This is due to the way mtd_find_rootfs_from searches for the the rootfs: - if the kernel image is embedded in the loader, the appended rootfs may follow the loader immediately, within the same erase block. - if the kernel image is not embedded in the loader, but placed at some offset behind the loader (OKLI-style loader), the rootfs must be aligned to an erase-block after the loader and kernel image. In case section header table is empty, determine the elf loader size by finding the end of the last segment, as defined by the program header table. Signed-off-by: Sander Vanheule <sander@svanheule.net>
Diffstat (limited to 'target/linux/generic/files/drivers/mtd/mtdsplit/Makefile')
-rw-r--r--target/linux/generic/files/drivers/mtd/mtdsplit/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile b/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile
index d3634e78db..8671628e7c 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/Makefile
@@ -12,3 +12,4 @@ obj-$(CONFIG_MTD_SPLIT_EVA_FW) += mtdsplit_eva.o
obj-$(CONFIG_MTD_SPLIT_WRGG_FW) += mtdsplit_wrgg.o
obj-$(CONFIG_MTD_SPLIT_MINOR_FW) += mtdsplit_minor.o
obj-$(CONFIG_MTD_SPLIT_JIMAGE_FW) += mtdsplit_jimage.o
+obj-$(CONFIG_MTD_SPLIT_ELF_FW) += mtdsplit_elf.o