All ARCHs have the same definition of MKIMAGE. Move it to Makefile.lib to avoid duplication. All ARCHs have similar definitions of cmd_uimage. Place a sufficiently parameterized version in Makefile.lib to avoid duplication.
Showing the changes to scripts (1 of 8 files). Show all
Unified · Split
| @@ -304,6 +304,30 @@ cmd_lzo = (cat $(filter-out FORCE,$^) | \ · 303 unmodified lines | ||
| 304 | 304 | lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ |
| 305 | 305 | (rm -f $@ ; false) |
| 306 | 306 | |
| 307 | +# U-Boot mkimage | |
| 308 | +# --------------------------------------------------------------------------- | |
| 309 | + | |
| 310 | +MKIMAGE := $(srctree)/scripts/mkuboot.sh | |
| 311 | + | |
| 312 | +# SRCARCH just happens to match slightly more than ARCH (on sparc), so reduces | |
| 313 | +# the number of overrides in arch makefiles | |
| 314 | +UIMAGE_ARCH ?= $(SRCARCH) | |
| 315 | +UIMAGE_COMPRESSION ?= $(if $(2),$(2),none) | |
| 316 | +UIMAGE_OPTS-y ?= | |
| 317 | +UIMAGE_TYPE ?= kernel | |
| 318 | +UIMAGE_LOADADDR ?= arch_must_set_this | |
| 319 | +UIMAGE_ENTRYADDR ?= $(UIMAGE_LOADADDR) | |
| 320 | +UIMAGE_NAME ?= 'Linux-$(KERNELRELEASE)' | |
| 321 | +UIMAGE_IN ?= $< | |
| 322 | +UIMAGE_OUT ?= $@ | |
| 323 | + | |
| 324 | +quiet_cmd_uimage = UIMAGE $(UIMAGE_OUT) | |
| 325 | + cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(UIMAGE_ARCH) -O linux \ | |
| 326 | + -C $(UIMAGE_COMPRESSION) $(UIMAGE_OPTS-y) \ | |
| 327 | + -T $(UIMAGE_TYPE) \ | |
| 328 | + -a $(UIMAGE_LOADADDR) -e $(UIMAGE_ENTRYADDR) \ | |
| 329 | + -n $(UIMAGE_NAME) -d $(UIMAGE_IN) $(UIMAGE_OUT) | |
| 330 | + | |
| 307 | 331 | # XZ |
| 308 | 332 | # --------------------------------------------------------------------------- |
| 309 | 333 | # Use xzkern to compress the kernel image and xzmisc to compress other things. |