[source] treewide: do not use IMG_PREFIX in Image/Prepare

LEDE Commits lede-commits at lists.infradead.org
Thu Oct 26 03:27:47 PDT 2017


jogo pushed a commit to source.git, branch master:
https://git.lede-project.org/6f528dfbd91f8e687e36300ab9284d16b78475b4

commit 6f528dfbd91f8e687e36300ab9284d16b78475b4
Author: Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Fri Oct 13 14:21:53 2017 +0200

    treewide: do not use IMG_PREFIX in Image/Prepare
    
    IMG_PREFIX can be modified in ImageBuilder by passing EXTRA_IMAGE_NAME
    on command line, but Image/Prepare is not run in ImageBuilder. This
    causes missing files when IMG_PREFIX is used for target file names in
    Image/Prepare, then as source file names in Image/BuildKernel or
    Image/Build.
    
    Fix this by using a fixed output file name in Image/Prepare, and copy to
    the expected file name in Image/BuildKernel instead, which is run by
    ImageBuilder.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
---
 target/linux/gemini/image/Makefile  | 18 +++++++++---------
 target/linux/ipq806x/image/Makefile |  4 ++--
 target/linux/malta/image/Makefile   |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile
index 1c51b62..2cea857 100644
--- a/target/linux/gemini/image/Makefile
+++ b/target/linux/gemini/image/Makefile
@@ -10,19 +10,19 @@ include $(INCLUDE_DIR)/image.mk
 ifeq ($(SUBTARGET),wiligear)
 define Image/Prepare
 # WBD111: mach id 1690 (0x69a)
-	echo -en "\x06\x1c\xa0\xe3\x9a\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-wbd111-zImage
-	cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-wbd111-zImage
+	echo -en "\x06\x1c\xa0\xe3\x9a\x10\x81\xe3" > $(KDIR)/wbd111-zImage
+	cat $(KDIR)/zImage >> $(KDIR)/wbd111-zImage
 # WBD222: mach id 2753 (0xAC1)
-	echo -en "\x0a\x1c\xa0\xe3\xc1\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-wbd222-zImage
-	cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-wbd222-zImage
+	echo -en "\x0a\x1c\xa0\xe3\xc1\x10\x81\xe3" > $(KDIR)/wbd222-zImage
+	cat $(KDIR)/zImage >> $(KDIR)/wbd222-zImage
 endef
 endif
 
 ifeq ($(SUBTARGET),raidsonic)
 define Image/Prepare
 # NAS4220: mach id 2038 (0x7F6)
-	echo -en "\x07\x1c\xa0\xe3\xf6\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-nas4220-zImage
-	cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-nas4220-zImage
+	echo -en "\x07\x1c\xa0\xe3\xf6\x10\x81\xe3" > $(KDIR)/nas4220-zImage
+	cat $(KDIR)/zImage >> $(KDIR)/nas4220-zImage
 endef
 endif
 
@@ -30,9 +30,9 @@ ifeq ($(SUBTARGET),wiligear)
 define Image/BuildKernel
 # workaround the bootloader's bug with extra nops
 	echo -en "\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $(BIN_DIR)/$(IMG_PREFIX)-wbd111-zImage
-	cat $(KDIR)/$(IMG_PREFIX)-wbd111-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd111-zImage
+	cat $(KDIR)/wbd111-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd111-zImage
 	echo -en "\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $(BIN_DIR)/$(IMG_PREFIX)-wbd222-zImage
-	cat $(KDIR)/$(IMG_PREFIX)-wbd222-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd222-zImage
+	cat $(KDIR)/wbd222-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd222-zImage
 endef
 endif
 
@@ -74,7 +74,7 @@ define Image/Build
 	dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img of=$(BIN_DIR)/rd.gz bs=6144k count=1
 #	dd if=/dev/zero of=$(BIN_DIR)/hddapp.tgz bs=6144k count=1
 	dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img of=$(BIN_DIR)/hddapp.tgz bs=6144k count=1 seek=1
-	cp $(KDIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/
+	cp $(KDIR)/nas4220-zImage $(BIN_DIR)/$(IMG_PREFIX)-nas4220-zImage
 	cp $(BIN_DIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/zImage
 	cp ./ImageInfo-ib4220 $(BIN_DIR)/ImageInfo
 	(cd $(BIN_DIR); tar -czf $(IMG_PREFIX)-sysupgrade-ib4220.tar.gz ImageInfo zImage rd.gz hddapp.tgz)
diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index 3a76c7f..f6f7f42 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -6,11 +6,11 @@ include $(INCLUDE_DIR)/image.mk
 UBIFS_OPTS = -m 2048 -e 124KiB -c 4096 -U -F
 
 define Image/Prepare
-	$(CP) $(LINUX_DIR)/vmlinux $(KDIR)/$(IMG_PREFIX)-vmlinux.elf
+	$(CP) $(LINUX_DIR)/vmlinux $(KDIR)/vmlinux-unstripped.elf
 endef
 
 define Image/BuildKernel
-	$(CP) $(KDIR)/$(IMG_PREFIX)-vmlinux.elf $(BIN_DIR)
+	$(CP) $(KDIR)/vmlinux-unstripped.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
 endef
 
 define Image/Build/squashfs
diff --git a/target/linux/malta/image/Makefile b/target/linux/malta/image/Makefile
index 31eb7ca..d49d4a7 100644
--- a/target/linux/malta/image/Makefile
+++ b/target/linux/malta/image/Makefile
@@ -22,7 +22,6 @@ define MkuImage
 endef
 
 define Image/Prepare
-	cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
 	$(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
 	$(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma)
 	$(call CompressGzip,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.gz)
@@ -30,6 +29,7 @@ define Image/Prepare
 endef
 
 define Image/BuildKernel
+	cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
 	cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(IMG_PREFIX)-uImage-lzma
 	cp $(KDIR)/uImage.gz $(BIN_DIR)/$(IMG_PREFIX)-uImage-gzip
 endef



More information about the lede-commits mailing list