From patchwork Wed Jan 16 19:09:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 212989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id D24A52C0087 for ; Thu, 17 Jan 2013 06:10:14 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 842AEA021F; Wed, 16 Jan 2013 19:10:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gsKQAwsmIvj1; Wed, 16 Jan 2013 19:10:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id A7F42A0224; Wed, 16 Jan 2013 19:10:07 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id EF8C68F79F for ; Wed, 16 Jan 2013 19:10:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 76F1E1017BF for ; Wed, 16 Jan 2013 19:09:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id meGA-ivmSNrF for ; Wed, 16 Jan 2013 19:09:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [94.23.35.102]) by fraxinus.osuosl.org (Postfix) with ESMTP id E001D1013C0 for ; Wed, 16 Jan 2013 19:09:48 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id A85EA5EF6; Wed, 16 Jan 2013 20:09:58 +0100 (CET) Received: from localhost (humanoidz.org [82.247.183.72]) by mail.free-electrons.com (Postfix) with ESMTPSA id F4118656 for ; Wed, 16 Jan 2013 20:09:57 +0100 (CET) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Wed, 16 Jan 2013 20:09:48 +0100 Message-Id: <1358363393-29977-2-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358363393-29977-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1358363393-29977-1-git-send-email-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [PATCH 1/5] Add a post-image script mechanism X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Just like we have a post-build script mechanism that gets executed after the build of all packages but before the creation of the filesystem images, let's introduce a post-image script mechanism, that gets executed once all filesystem images have been generated. This can for example be used to call a tool building a firmware image from different images generated by Buildroot, or automatically extract the tarball root filesystem image into some location exported by NFS, or any other custom action. Signed-off-by: Thomas Petazzoni Tested-by: "Yann E. MORIN" Acked-by: "Yann E. MORIN" Acked-by: Luca Ceresoli --- Makefile | 9 +++++++++ system/Config.in | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Makefile b/Makefile index 6f8ed0e..88b5a85 100644 --- a/Makefile +++ b/Makefile @@ -353,6 +353,8 @@ endif include fs/common.mk +TARGETS+=target-post-image + TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS)) TARGETS_SOURCE:=$(patsubst %,%-source,$(TARGETS) $(BASE_TARGETS)) TARGETS_DIRCLEAN:=$(patsubst %,%-dirclean,$(TARGETS)) @@ -548,6 +550,13 @@ target-generatelocales: host-localedef done endif +target-post-image: +ifneq ($(BR2_ROOTFS_POST_IMAGE_SCRIPT),) + @$(call MESSAGE,"Executing post-image script\(s\)") + @$(foreach s, $(call qstrip,$(BR2_ROOTFS_POST_IMAGE_SCRIPT)), \ + $(s) $(BINARIES_DIR)$(sep)) +endif + toolchain-eclipse-register: ./support/scripts/eclipse-register-toolchain `readlink -f $(O)` $(notdir $(TARGET_CROSS)) $(BR2_ARCH) diff --git a/system/Config.in b/system/Config.in index 69863c4..1ffe8a0 100644 --- a/system/Config.in +++ b/system/Config.in @@ -265,4 +265,22 @@ config BR2_ROOTFS_POST_BUILD_SCRIPT only argument. Make sure the exit code of those scripts are 0, otherwise make will stop after calling them. +config BR2_ROOTFS_POST_IMAGE_SCRIPT + string "Custom script to run after creating filesystem images" + default "" + help + Specify a space-separated list of scripts to be run after + the build has finished and after Buildroot has packed the + files into selected filesystem images. + + This can for example be used to call a tool building a + firmware image from different images generated by Buildroot, + or automatically extract the tarball root filesystem image + into some location exported by NFS, or any other custom + action. + + These scripts are called with the images directory name as + first and only argument. The script is executed from the + main Buildroot source directory as the current directory. + endmenu