From patchwork Wed Feb 6 21:49:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 218775 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id B00EC2C029C for ; Thu, 7 Feb 2013 08:51:15 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 006AD8C692; Wed, 6 Feb 2013 21:51:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1M3FRXmt2CpQ; Wed, 6 Feb 2013 21:51:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 80B368C716; Wed, 6 Feb 2013 21:50:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 788478F7A0 for ; Wed, 6 Feb 2013 21:50:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0064F8C786 for ; Wed, 6 Feb 2013 21:50:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 82erjOwN6G8N for ; Wed, 6 Feb 2013 21:50:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [94.23.35.102]) by whitealder.osuosl.org (Postfix) with ESMTP id 0A7178C2A8 for ; Wed, 6 Feb 2013 21:50:15 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 360E9826; Wed, 6 Feb 2013 22:50:15 +0100 (CET) Received: from localhost (humanoidz.org [82.247.183.72]) by mail.free-electrons.com (Postfix) with ESMTPSA id CD225899 for ; Wed, 6 Feb 2013 22:49:09 +0100 (CET) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Wed, 6 Feb 2013 22:49:02 +0100 Message-Id: <1360187346-30258-2-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360187346-30258-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1360187346-30258-1-git-send-email-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [PATCH v2 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 d9e5f24..3996d01 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)) @@ -555,6 +557,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 fa01d91..94ef70b 100644 --- a/system/Config.in +++ b/system/Config.in @@ -276,4 +276,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