diff mbox

[OpenWrt-Devel] include/image.mk: use KERNEL_SUFFIX in Device/Build/initramfs

Message ID 1446744887-6848-1-git-send-email-abrodkin@synopsys.com
State Changes Requested
Headers show

Commit Message

Alexey Brodkin Nov. 5, 2015, 5:34 p.m. UTC
In case if we're interested in generation of non-binary images
(for example if we want images to be valid .elfs - and that's what we
want for ARC now) we have to instruct Device/Build/initramfs target to
use input file with some extension (in case of ARC it will be
essentially .elf).

Otherwise default binary vmlinux (without extension) is used and
resulting images then are binaries instead of elfs.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Felix Fietkau <nbd@openwrt.org>
Cc: John Crispin <blogic@openwrt.org>
---
 include/image.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Felix Fietkau Nov. 6, 2015, 10:34 a.m. UTC | #1
On 2015-11-05 18:34, Alexey Brodkin wrote:
> In case if we're interested in generation of non-binary images
> (for example if we want images to be valid .elfs - and that's what we
> want for ARC now) we have to instruct Device/Build/initramfs target to
> use input file with some extension (in case of ARC it will be
> essentially .elf).
> 
> Otherwise default binary vmlinux (without extension) is used and
> resulting images then are binaries instead of elfs.
> 
> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
> Cc: Felix Fietkau <nbd@openwrt.org>
> Cc: John Crispin <blogic@openwrt.org>
> ---
>  include/image.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/image.mk b/include/image.mk
> index 43980bc..ea7cf34 100644
> --- a/include/image.mk
> +++ b/include/image.mk
> @@ -462,7 +462,7 @@ define Device/Build/initramfs
>    $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
>  	cp $$^ $$@
>  
> -  $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_NAME)-initramfs
> +  $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_NAME)-initramfs$$(KERNEL_SUFFIX)
KERNEL_SUFFIX is already used for a different purpose, so this change
will break other targets. I suggest adding a KERNEL_INITRAMFS_NAME
variable, which defaults to $(KERNEL_NAME)-initramfs, and change all
existing references to the initramfs kernel.

- Felix
diff mbox

Patch

diff --git a/include/image.mk b/include/image.mk
index 43980bc..ea7cf34 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -462,7 +462,7 @@  define Device/Build/initramfs
   $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
 	cp $$^ $$@
 
-  $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_NAME)-initramfs
+  $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/$$(KERNEL_NAME)-initramfs$$(KERNEL_SUFFIX)
 	@rm -f $$@
 	$$(call concat_cmd,$$(KERNEL_INITRAMFS))
 endef