build: add UIMAGE_MAGIC to device variables
[openwrt/openwrt.git] / include / image-commands.mk
index 438f1e87e4d267276c2d0c23fdf5711b7dbd0ff1..979eafb15734a305320241f796ed735c8e4fe78b 100644 (file)
@@ -394,10 +394,17 @@ define Build/tplink-v2-image
 endef
 
 define Build/uImage
-       mkimage -A $(LINUX_KARCH) \
-               -O linux -T kernel \
-               -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-               -n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION))' -d $@ $@.new
+       mkimage \
+               -A $(LINUX_KARCH) \
+               -O linux \
+               -T kernel \
+               -C $(word 1,$(1)) \
+               -a $(KERNEL_LOADADDR) \
+               -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
+               -n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION))' \
+               $(if $(UIMAGE_MAGIC),-M $(UIMAGE_MAGIC)) \
+               $(wordlist 2,$(words $(1)),$(1)) \
+               -d $@ $@.new
        mv $@.new $@
 endef