[Buildroot] [PATCH] linux: use $(LINUX_INSTALL_IMAGE_CMDS) instead of plain 'cp'

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Mon Apr 25 12:06:15 UTC 2016


Hello,

On Mon, 25 Apr 2016 13:58:59 +0200, Sebastian Frias wrote:

> The target "$(LINUX_DIR)/.stamp_initramfs_rebuilt" uses its own
> 'cp' command, instead of LINUX_INSTALL_IMAGE/LINUX_INSTALL_IMAGES_CMDS
> provided by (or updated with) 055e6162bba7 ("linux: don't build appended DTB
> image in place and support multiple images") and thus is not operating
> properly when APPENDED_DTB is used.
> 
> Indeed, it copies a single image, and does not copy the one with the DTB
> appended.
> 
> This patch replaces the 'cp' command with $(LINUX_INSTALL_IMAGES_CMDS) which
> handles APPENDED_DTB. It also makes the copy verbose so that the user can
> see how many images were copied.
> 
> Fixes: 055e6162bba7 ("linux: don't build appended DTB image in place and
> support multiple images")

Thanks for reporting the problem, and thanks for your patch!

> diff --git a/linux/linux.mk b/linux/linux.mk
> index 317587f..1f93074 100644
> --- a/linux/linux.mk
> +++ b/linux/linux.mk
> @@ -330,7 +330,7 @@ ifeq ($(BR2_LINUX_KERNEL_APPENDED_DTB),y)
>  # appended DTBs.
>  define LINUX_INSTALL_IMAGE
>  	mkdir -p $(1)
> -	cp $(KERNEL_ARCH_PATH)/boot/$(LINUX_IMAGE_NAME).* $(1)
> +	cp -v $(KERNEL_ARCH_PATH)/boot/$(LINUX_IMAGE_NAME).* $(1)

I think you did this change for debugging (which is OK), but it should
be kept in your patch.

>  endef
>  else
>  # Otherwise, just install the unique image generated by the kernel
> @@ -447,8 +447,8 @@ $(LINUX_DIR)/.stamp_initramfs_rebuilt:
> $(LINUX_DIR)/.stamp_target_installed $(LI
>  	# Build the kernel.
>  	$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D)
> $(LINUX_TARGET_NAME)
>  	$(LINUX_APPEND_DTB)
> -	# Copy the kernel image to its final destination
> -	cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)
> +	# Copy the kernel image(s) to its(their) final destination
> +	$(LINUX_INSTALL_IMAGES_CMDS)

I think I would prefer to have:

	$(call LINUX_INSTALL_IMAGE,$(BINARIES_DIR))

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list