difos/target/linux/generic
Sander Vanheule 3f7047db7a 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>
2020-09-09 20:41:50 +03:00
..
backport-4.19 kernel: Fix cake patch for kernel 4.19.138 2020-08-11 21:11:53 +02:00
backport-5.4 kernel: bump 5.4 to 5.4.63 2020-09-06 19:55:19 +02:00
files kernel: mtdsplit: support ELF loader splitting 2020-09-09 20:41:50 +03:00
hack-4.19 kernel: add patch that adds support for running threaded NAPI poll functions 2020-08-22 07:02:01 +02:00
hack-5.4 kernel: bump 5.4 to 5.4.63 2020-09-06 19:55:19 +02:00
image treewide: replace nbd@openwrt.org with nbd@nbd.name 2016-06-07 08:58:42 +02:00
other-files kernel: move initramfs's init script out of base-files 2017-04-04 14:06:40 +02:00
pending-4.19 kernel: add patch that adds support for running threaded NAPI poll functions 2020-08-22 07:02:01 +02:00
pending-5.4 mediatek/ramips: remove an ethernet optimization patch that was reported to cause a regression 2020-09-09 11:51:47 +02:00
config-4.19 kernel: add CGROUPS and IOSCHED_BFQ back to config 2020-08-12 14:03:17 +02:00
config-5.4 kernel: add options needed for SELinux 2020-08-31 01:15:41 +01:00
PATCHES kernel: update PATCHES with a stricter policy 2013-07-09 20:52:07 +00:00