openwrt-mirror/target/linux
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
..
apm821xx apm821xx: provide legacy interrupts for PCIe in DT 2020-09-05 23:26:05 +02:00
arc770 arc770: drop support for kernel 4.14 2020-09-02 16:29:22 +02:00
archs38 treewide: use wpad-basic-wolfssl as default 2020-08-20 14:19:39 +02:00
armvirt kernel: set WATCHDOG_CORE dependency in kmod-hwmon-sch5627 2020-08-24 14:09:11 +02:00
at91 at91: explicitly set CONFIG_USB_SUPPORT for sam9x subtarget 2020-08-27 16:36:18 +02:00
ath25 ath25: disable devices with 4M flash 2020-09-06 19:50:36 +02:00
ath79 ath79: drop Build/loader-kernel-cmdline 2020-09-06 19:43:08 +02:00
bcm27xx kernel: bump 5.4 to 5.4.63 2020-09-06 19:55:19 +02:00
bcm47xx treewide: use wpad-basic-wolfssl as default 2020-08-20 14:19:39 +02:00
bcm53xx treewide: use wpad-basic-wolfssl as default 2020-08-20 14:19:39 +02:00
bcm63xx kernel: set WATCHDOG_CORE dependency in kmod-hwmon-sch5627 2020-08-24 14:09:11 +02:00
cns3xxx treewide: use wpad-basic-wolfssl as default 2020-08-20 14:19:39 +02:00
gemini gemini: Add swap partition to DNS-313 2020-07-31 18:34:40 +02:00
generic kernel: mtdsplit: support ELF loader splitting 2020-09-09 20:41:50 +03:00
imx6 kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-06 12:37:04 +02:00
ipq40xx kernel: bump 5.4 to 5.4.61 2020-08-30 19:44:47 +02:00
ipq806x kernel: bump 5.4 to 5.4.63 2020-09-06 19:55:19 +02:00
ipq807x kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-06 12:37:04 +02:00
kirkwood treewide: revert sysupgrade adjustments for early DSA-adopters 2020-09-08 19:27:15 +02:00
lantiq lantiq: remove vmmc node from FritzBox 7412 dts 2020-08-20 23:45:39 +02:00
layerscape kernel: bump 5.4 to 5.4.63 2020-09-06 19:55:19 +02:00
malta kernel: set WATCHDOG_CORE dependency in kmod-hwmon-sch5627 2020-08-24 14:09:11 +02:00
mediatek mediatek/ramips: remove an ethernet optimization patch that was reported to cause a regression 2020-09-09 11:51:47 +02:00
mpc85xx treewide: use wpad-basic-wolfssl as default 2020-08-20 14:19:39 +02:00
mvebu treewide: revert sysupgrade adjustments for early DSA-adopters 2020-09-08 19:27:15 +02:00
mxs treewide: make dependency on kmod-usb-net selective 2020-08-10 12:54:30 +02:00
octeon octeon: add support for Itus Shield Router 2020-08-16 02:15:06 +02:00
octeontx kernel: bump 5.4 to 5.4.60 2020-08-24 17:33:58 +02:00
omap treewide: use wpad-basic-wolfssl as default 2020-08-20 14:19:39 +02:00
oxnas oxnas: kd20: revert accedintally commited change 2020-08-29 01:16:24 +01:00
pistachio pistachio: drop support for kernel 4.14 2020-09-02 16:29:22 +02:00
ramips ramips: disable default build for Ravpower RP-WD03 2020-09-09 14:12:14 +02:00
rockchip kernel: bump 5.4 to 5.4.58 2020-08-18 18:14:54 +02:00
sunxi treewide: use wpad-basic-wolfssl as default 2020-08-20 14:19:39 +02:00
tegra treewide: use wpad-basic-wolfssl as default 2020-08-20 14:19:39 +02:00
uml uml: update to linux 5.4 2020-08-22 07:02:01 +02:00
x86 kernel: bump 5.4 to 5.4.63 2020-09-06 19:55:19 +02:00
zynq kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-06 12:37:04 +02:00
Makefile build: add 'make kernel_xconfig' command 2020-07-08 16:07:05 +02:00