immortalwrt/target/linux
Sander Vanheule 00ee1498ac 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-10 17:27:30 +08:00
..
apm821xx apm821xx: provide legacy interrupts for PCIe in DT 2020-09-06 11:38:32 +08:00
arc770 kernel: set WATCHDOG_CORE dependency in kmod-hwmon-sch5627 2020-08-25 12:25:14 +08:00
archs38 kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-07 18:08:33 +08:00
armvirt kernel: set WATCHDOG_CORE dependency in kmod-hwmon-sch5627 2020-08-25 12:25:14 +08:00
at91 at91: explicitly set CONFIG_USB_SUPPORT for sam9x subtarget 2020-08-28 09:28:31 +08:00
ath25 ath25: eth: fix crash on skb DMA (un-)map 2020-09-07 17:08:58 +08:00
ath79 ath79: drop Build/loader-kernel-cmdline 2020-09-07 17:03:07 +08:00
bcm27xx Merge Mainline 2020-09-06 20:03:11 +08:00
bcm47xx kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-07 18:08:33 +08:00
bcm53xx Revert "bcm53xx: remove useless echo in 02_network" 2020-08-19 01:05:18 +08:00
bcm63xx kernel: set WATCHDOG_CORE dependency in kmod-hwmon-sch5627 2020-08-25 12:25:14 +08:00
cns3xxx Merge Mainline 2020-08-27 04:30:47 +08:00
gemini Merge Mainline 2020-08-03 00:45:53 +08:00
generic kernel: mtdsplit: support ELF loader splitting 2020-09-10 17:27:30 +08:00
imx6 treewide: fix undeclared function about backup in upgrade 2020-08-14 12:28:09 +08:00
ipq40xx kernel: bump 5.4 to 5.4.61 2020-08-27 05:42:59 +08:00
ipq806x kernel: bump 5.4 to 5.4.63 2020-09-06 19:56:39 +08:00
ipq807x kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-07 18:08:33 +08:00
kirkwood kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-07 18:08:33 +08:00
lantiq Merge Mainline 2020-08-22 02:27:01 +08:00
layerscape kernel: bump 5.4 to 5.4.63 2020-09-06 19:56:39 +08:00
malta kernel: set WATCHDOG_CORE dependency in kmod-hwmon-sch5627 2020-08-25 12:25:14 +08:00
mediatek mediatek/ramips: remove an ethernet optimization patch that was reported to cause a regression 2020-09-10 17:26:54 +08:00
mpc85xx mpc85xx: tidy up 10-fix-wifi-mac 2020-08-14 11:37:18 +08:00
mvebu kernel: bump 5.4 to 5.4.63 2020-09-06 19:56:39 +08:00
mxs kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-07 18:08:33 +08:00
octeon octeon: determine sysupgrade-* directory for upgrade automatically 2020-08-18 11:38:20 +08:00
octeontx kernel: bump 5.4 to 5.4.60 2020-08-22 03:33:14 +08:00
omap kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-07 18:08:33 +08:00
oxnas oxnas: kd20: revert accedintally commited change 2020-08-29 12:08:24 +08:00
pistachio pistachio: Use kernel 5.4 by default 2020-08-29 01:35:07 +08:00
ramips kernel: bump 5.4 to 5.4.63 2020-09-06 19:56:39 +08:00
rb532 kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-07 18:08:33 +08:00
rockchip rockchip: move the dependency of config to config 2020-08-29 12:38:21 +08:00
samsung kernel: Update kernel 4.14 to version 4.14.187 2020-07-05 11:53:32 +08:00
sunxi kernel: bump 5.4 to 5.4.63 2020-09-06 19:56:39 +08:00
tegra kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-07 18:08:33 +08:00
uml uml: update to linux 5.4 2020-08-23 01:14:31 +08:00
x86 kernel: bump 5.4 to 5.4.63 2020-09-06 19:56:39 +08:00
zynq kernel: unify CONFIG_GPIO_SYSFS in kernel configs 2020-08-07 18:08:33 +08:00
Makefile build: add 'make kernel_xconfig' command 2020-07-09 12:03:26 +08:00