diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-05-30 22:55:40 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-05-30 22:55:40 +0000 |
commit | 64b789db561adae1a9097f692ba4e78d0bd4f238 (patch) | |
tree | 5629b2d7fe3874c251f9a2b6a8ad7b809e960cdd /target/linux/ar71xx/image/Makefile | |
parent | 531a7e469aabdd50685dffa49b8f997378ba7e96 (diff) | |
download | mtk-20170518-64b789db561adae1a9097f692ba4e78d0bd4f238.zip mtk-20170518-64b789db561adae1a9097f692ba4e78d0bd4f238.tar.gz mtk-20170518-64b789db561adae1a9097f692ba4e78d0bd4f238.tar.bz2 |
ar71xx: add Image/BuildLoaderPatched macro
In contrast to Image/BuildLoader, Image/BuildLoaderPatched first patches the
kernel command line in the image and then builds the loader without command
line. This allows building loaders for systems which don't boot correctly when
the kernel command line is provided by the loader (like the TP-LINK CPE series).
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
SVN-Revision: 45854
Diffstat (limited to 'target/linux/ar71xx/image/Makefile')
-rw-r--r-- | target/linux/ar71xx/image/Makefile | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index f32bc59..fc66908 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -842,6 +842,28 @@ define Image/BuildLoader endef # +# Embed patched lzma-compressed kernel inside lzma-loader. +# +# Specifying the command line via the lzma-loader doesn't work with some +# models (like the TP-LINK CPE series), so this version first patches the +# command line in the image and then builds the loader around it. +# +# $(1), suffix of output filename, e.g. generic, lowercase board name, etc. +# $(2), suffix of target file to build, e.g. bin, gz, elf +# $(3), kernel command line to pass from lzma-loader to kernel +# $(4), unused here +# $(5), suffix of kernel filename, e.g. -initramfs, or empty +define Image/BuildLoaderPatched + $(call PatchKernelLzma,$(1),$(3)) + -rm -rf $(KDIR)/lzma-loader + $(LOADER_MAKE) LOADER=loader-$(1).$(2) \ + LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \ + LOADER_DATA="$(KDIR_TMP)/vmlinux-$(1)$(5).bin.lzma" BOARD="$(1)" \ + compile loader.$(2) + -$(CP) $(KDIR)/loader-$(1).$(2) $(KDIR)/loader-$(1)$(5).$(2) +endef + +# # Build lzma-loader alone which will search for lzma-compressed kernel identified by # uImage header with magic "OKLI" at boot time. # |