kernel: bump 5.4 to 5.4.136
[openwrt/openwrt.git] / include / image-commands.mk
index 4c9075c35b01f17704a7752c10da5d00cc7e5004..fa368850388d095131245c796c0f644fa5d2eda6 100644 (file)
@@ -33,11 +33,11 @@ endef
 
 ifdef IB
 define Build/append-image-stage
-       dd if=$(STAGING_DIR_IMAGE)/$(DEVICE_IMG_PREFIX)-$(1) >> $@
+       dd if=$(STAGING_DIR_IMAGE)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))-$(DEVICE_NAME)-$(1) >> $@
 endef
 else
 define Build/append-image-stage
-       dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) of=$(STAGING_DIR_IMAGE)/$(DEVICE_IMG_PREFIX)-$(1)
+       dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) of=$(STAGING_DIR_IMAGE)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))-$(DEVICE_NAME)-$(1)
        dd if=$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1) >> $@
 endef
 endif
@@ -198,7 +198,7 @@ define Build/elx-header
                        dd bs=20 count=1 conv=sync; \
                echo -ne "$$(printf '%08x' $$(stat -c%s $@) | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \
                        dd bs=8 count=1 conv=sync; \
-               echo -ne "$$($(STAGING_DIR_HOST)/bin/mkhash md5 $@ | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \
+               echo -ne "$$($(MKHASH) md5 $@ | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \
                        dd bs=58 count=1 conv=sync; \
        ) > $(KDIR)/tmp/$(DEVICE_NAME).header
        $(call Build/xor-image,-p $(xor_pattern) -x)
@@ -272,8 +272,11 @@ define Build/jffs2
 endef
 
 define Build/kernel2minor
-       kernel2minor -k $@ -r $@.new $(1)
-       mv $@.new $@
+       $(eval temp_file := $(shell mktemp))
+       cp $@ $(temp_file)
+       kernel2minor -k $(temp_file) -r $(temp_file).new $(1)
+       mv $(temp_file).new $@
+       rm -f $(temp_file)
 endef
 
 define Build/kernel-bin