All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [git commit] linux: de-duplicate DTB and Linux image installation
Date: Sun, 20 Dec 2015 15:23:01 +0100	[thread overview]
Message-ID: <20151220142434.AC1B7821FC@busybox.osuosl.org> (raw)

commit: http://git.buildroot.net/buildroot/commit/?id=55b80d3bb92ebfe334ba4b2ba980c45d1d2f1c05
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Currently, the LINUX_INSTALL_DTB and LINUX_INSTALL_DTB_TARGET macros
are exactly the same, except for the target directory.

Similarly, LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET and
LINUX_INSTALL_IMAGES_CMDS are copying the kernel image, just to a
different place (and with a different strategy).

As a preparation for future additions, this commit de-duplicate this
code:

 - LINUX_INSTALL_DTB becomes a make macro that takes one argument: the
   destination directory.

 - LINUX_INSTALL_IMAGE is a new make macro that also takes on
   argument: the destination directory.

Both macros are used by LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET and
LINUX_INSTALL_IMAGES_CMDS to respectively install to the target
directory and the images directory.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 linux/linux.mk | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/linux/linux.mk b/linux/linux.mk
index f95bc58..5d6791a 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -262,14 +262,7 @@ define LINUX_INSTALL_DTB
 	cp $(addprefix \
 		$(KERNEL_ARCH_PATH)/boot/$(if $(wildcard \
 		$(addprefix $(KERNEL_ARCH_PATH)/boot/dts/,$(KERNEL_DTBS))),dts/),$(KERNEL_DTBS)) \
-		$(BINARIES_DIR)/
-endef
-define LINUX_INSTALL_DTB_TARGET
-	# dtbs moved from arch/<ARCH>/boot to arch/<ARCH>/boot/dts since 3.8-rc1
-	cp $(addprefix \
-		$(KERNEL_ARCH_PATH)/boot/$(if $(wildcard \
-		$(addprefix $(KERNEL_ARCH_PATH)/boot/dts/,$(KERNEL_DTBS))),dts/),$(KERNEL_DTBS)) \
-		$(TARGET_DIR)/boot/
+		$(1)
 endef
 endif
 endif
@@ -310,11 +303,14 @@ define LINUX_BUILD_CMDS
 	$(LINUX_APPEND_DTB)
 endef
 
+define LINUX_INSTALL_IMAGE
+	$(INSTALL) -m 0644 -D $(LINUX_IMAGE_PATH) $(1)/$(LINUX_IMAGE_NAME)
+endef
 
 ifeq ($(BR2_LINUX_KERNEL_INSTALL_TARGET),y)
 define LINUX_INSTALL_KERNEL_IMAGE_TO_TARGET
-	install -m 0644 -D $(LINUX_IMAGE_PATH) $(TARGET_DIR)/boot/$(LINUX_IMAGE_NAME)
-	$(LINUX_INSTALL_DTB_TARGET)
+	$(call LINUX_INSTALL_IMAGE,$(TARGET_DIR)/boot)
+	$(call LINUX_INSTALL_DTB,$(TARGET_DIR)/boot)
 endef
 endif
 
@@ -328,8 +324,8 @@ endef
 
 
 define LINUX_INSTALL_IMAGES_CMDS
-	cp $(LINUX_IMAGE_PATH) $(BINARIES_DIR)
-	$(LINUX_INSTALL_DTB)
+	$(call LINUX_INSTALL_IMAGE,$(BINARIES_DIR))
+	$(call LINUX_INSTALL_DTB,$(BINARIES_DIR))
 endef
 
 define LINUX_INSTALL_TARGET_CMDS

                 reply	other threads:[~2015-12-20 14:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151220142434.AC1B7821FC@busybox.osuosl.org \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.