From patchwork Wed Nov 19 21:30:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 412515 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 5EEC9140170 for ; Thu, 20 Nov 2014 08:30:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id A57A2A3C40; Wed, 19 Nov 2014 21:30:52 +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 jJgHzFTP8rXO; Wed, 19 Nov 2014 21:30:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id CD0B1A3C41; Wed, 19 Nov 2014 21:30:50 +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 D55A51C68D1 for ; Wed, 19 Nov 2014 21:30:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CF1B092E26 for ; Wed, 19 Nov 2014 21:30:48 +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 nIrvACblUL8f for ; Wed, 19 Nov 2014 21:30:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lupi.sysmic.org (sysmic.org [62.210.89.17]) by whitealder.osuosl.org (Postfix) with ESMTPS id A7FF492DF3 for ; Wed, 19 Nov 2014 21:30:47 +0000 (UTC) Received: from lupi.online.net (sysmic.org [62.210.89.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jezz) by lupi.sysmic.org (Postfix) with ESMTPSA id 343B241B46; Wed, 19 Nov 2014 22:30:46 +0100 (CET) From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= To: buildroot@busybox.net Date: Wed, 19 Nov 2014 22:30:34 +0100 Message-Id: <1416432642-26005-2-git-send-email-jezz@sysmic.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416432642-26005-1-git-send-email-jezz@sysmic.org> References: <1416432642-26005-1-git-send-email-jezz@sysmic.org> MIME-Version: 1.0 Cc: "Yann E. MORIN" , =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Subject: [Buildroot] [PATCH v2 1/9] freescale-imx: Add helper to extract self-extractible binaries X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Jérôme Pouiller Reviewed-by: "Yann E. MORIN" --- package/freescale-imx/freescale-imx.mk | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/package/freescale-imx/freescale-imx.mk b/package/freescale-imx/freescale-imx.mk index c52fc11..ba5a786 100644 --- a/package/freescale-imx/freescale-imx.mk +++ b/package/freescale-imx/freescale-imx.mk @@ -7,4 +7,25 @@ FREESCALE_IMX_VERSION = 3.10.17-1.0.0 FREESCALE_IMX_SITE = http://www.freescale.com/lgfiles/NMG/MAD/YOCTO +# Helper for self-extracting binaries distributed by Freescale. +# The --force makes sure it doesn't fail if the source dir already exists. +# The --auto-accept skips the license check - not needed for us +# because we have legal-info +# Since there's a EULA in the bin file, extract it +# If you use this macro, don't forget to add "EULA" to LICENSE_FILES and set +# REDISTRIBUTE to "NO". Indeed, this is a legal minefield: +# the EULA specifies that the Board Support Package includes software +# and hardware (sic!) for which a separate license is needed... +define FREESCALE_IMX_EXTRACT_HELPER + awk 'BEGIN { start = 0; } \ + /^EOEULA/ { start = 0; } \ + { if (start) print; } \ + /< $(@D)/EULA + cd $(@D) && sh $(1) --force --auto-accept; + find $(@D)/$(basename $(1)) -mindepth 1 -maxdepth 1 -exec mv {} $(@D) \; + rmdir $(@D)/$(basename $(1)) +endef + + include $(sort $(wildcard package/freescale-imx/*/*.mk))