From patchwork Mon Apr 15 00:26:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 1085406 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rEhJcYmP"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44j8FB2H9Lz9s55 for ; Mon, 15 Apr 2019 10:16:43 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4ADFF86AE5; Mon, 15 Apr 2019 00:16:38 +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 NHqAL4CnQxzx; Mon, 15 Apr 2019 00:16:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id D3CC6867A8; Mon, 15 Apr 2019 00:16:32 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 0F29E1BF35F for ; Mon, 15 Apr 2019 00:16:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0B57C24763 for ; Mon, 15 Apr 2019 00:16:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gkrn4Uq6dzA7 for ; Mon, 15 Apr 2019 00:16:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by silver.osuosl.org (Postfix) with ESMTPS id 121582083F for ; Mon, 15 Apr 2019 00:16:31 +0000 (UTC) Received: by mail-lf1-f52.google.com with SMTP id o19so7292293lfl.4 for ; Sun, 14 Apr 2019 17:16:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=PFoA6XKOyNYxPqtYolQ7BLCcsdahkKQFYjaDQQ1tujc=; b=rEhJcYmPwBgTiEeNmVnQZhLN4hW/X69FPlLagVYRrZUWFv4LlI4IkGSQN+tc9j7+QO 7/b5MRzzRdkZD0eZAVYv3fwHvKXbXNI3yOGErCcKr/V2LmZjcvUsvpGuIlJYKwLLK4JV VFbuP0BXHFCrIFb9gkPv4DCj12OE4fXsLcN7fDnL2k6BzVDSoP77rsvwL59yunbPcBZ1 sTYRTAIS38H7QbXqVgbx3oiomKYBREGeCWy6z3XLxwkX+rICoIsnB++7ccylkAMzV7oy mRRwsiBVT1hdvytSKFPe+tn5FFoPAbi9c1zkjDXnL7eJ3Adpwsf/AqvuPQct0zWFdtsy ZbFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PFoA6XKOyNYxPqtYolQ7BLCcsdahkKQFYjaDQQ1tujc=; b=HIpy6ATCA5hxo/Gax+nSR6qK0BQoeMRPVxD2fs5ztCspydI49IXMvp+2vD05nfuOjm 5WCW7zg35NSC+85A9Fheovr3ZEvk67J7yTFmvpQ1ilvjkVZItRY6Ap0xc/eCdZyLe7lZ tYnT4p79kdoM0SVGJkf9bXdkbbALIn3ETcSjoyKUY8wxof79R0Hmqz7Y87wcw+F0yGLJ yd9/YG4cjnO8x4KbbtSdKG7bG4DDGuCsPj5abG6KKDlkRzheaejA/NjrjcgC/bKrA1B+ e+E9kG0dlVDKcIj1as7H60/ca8SjLN+ZGaeLhB3OZKhiap1E+1ptcvj7XYyvpEPvLDYP 89FQ== X-Gm-Message-State: APjAAAXziUQ/xtR1TMLypeDm4mauZ1kSYQihF/6d4opCeNW5YVV2FD+m znlSKV8GKZf394/bkA+mamrh9Ci+ X-Google-Smtp-Source: APXvYqzYtAxUoLNXcbqqyI1gbUYTA6qFtXP8gkoJ8fk42jnbzh9JNlRHRP9TNI9ib1vCKhiiwXWmKg== X-Received: by 2002:a19:e619:: with SMTP id d25mr9579940lfh.66.1555287388951; Sun, 14 Apr 2019 17:16:28 -0700 (PDT) Received: from vkochan-ThinkPad-T470p.lan ([93.75.250.209]) by smtp.gmail.com with ESMTPSA id e14sm10615719ljk.45.2019.04.14.17.16.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Apr 2019 17:16:28 -0700 (PDT) From: Vadim Kochan To: buildroot@buildroot.org Date: Mon, 15 Apr 2019 03:26:35 +0300 Message-Id: <20190415002635.3656-1-vadim4j@gmail.com> X-Mailer: git-send-email 2.14.1 Subject: [Buildroot] [RFC 1/1] infra/pkg-generic: Add rootfs post gen hook X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vadim Kochan , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add ability to generate image by custom package, and one of the way to do it - is to add new $(PKG)_ROOTFS_POST_GEN_HOOK which will be called after rootfs image is ready. This allows to have easier alternative to post-image script in form of package, which might be just selected by the user (or this package might be automatically selected already already). Signed-off-by: Vadim Kochan --- fs/common.mk | 1 + package/pkg-generic.mk | 2 ++ 2 files changed, 3 insertions(+) diff --git a/fs/common.mk b/fs/common.mk index 4ad51fdd0a..3288406af6 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -152,6 +152,7 @@ ifneq ($$(ROOTFS_$(2)_COMPRESS_CMD),) PATH=$$(BR_PATH) $$(ROOTFS_$(2)_COMPRESS_CMD) $$@ > $$@$$(ROOTFS_$(2)_COMPRESS_EXT) endif $$(foreach hook,$$(ROOTFS_$(2)_POST_GEN_HOOKS),$$(call $$(hook))$$(sep)) + $$(foreach hook,$$(ROOTFS_POST_GEN_HOOKS),$$(call $$(hook))$$(sep)) rootfs-$(1)-show-depends: @echo $$(ROOTFS_$(2)_DEPENDENCIES) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index a83813e28d..332e3c3cc1 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -724,6 +724,7 @@ $(2)_PRE_LEGAL_INFO_HOOKS ?= $(2)_POST_LEGAL_INFO_HOOKS ?= $(2)_TARGET_FINALIZE_HOOKS ?= $(2)_ROOTFS_PRE_CMD_HOOKS ?= +$(2)_ROOTFS_POST_GEN_HOOKS ?= ifeq ($$($(2)_TYPE),target) ifneq ($$(HOST_$(2)_KCONFIG_VAR),) @@ -1052,6 +1053,7 @@ PACKAGES_USERS += $$($(2)_USERS)$$(sep) endif TARGET_FINALIZE_HOOKS += $$($(2)_TARGET_FINALIZE_HOOKS) ROOTFS_PRE_CMD_HOOKS += $$($(2)_ROOTFS_PRE_CMD_HOOKS) +ROOTFS_POST_GEN_HOOKS += $$($(2)_ROOTFS_POST_GEN_HOOKS) ifeq ($$($(2)_SITE_METHOD),svn) DL_TOOLS_DEPENDENCIES += svn