From patchwork Sun Dec 16 16:56:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 206702 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 94F232C007B for ; Mon, 17 Dec 2012 03:59:21 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 425CC20224; Sun, 16 Dec 2012 16:59:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uwVM8CHsQTEy; Sun, 16 Dec 2012 16:59:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 410342FE42; Sun, 16 Dec 2012 16:58:17 +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 291A68F74B for ; Sun, 16 Dec 2012 16:57:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 85C098AA70 for ; Sun, 16 Dec 2012 16:57:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WJrOeuHzH3fb for ; Sun, 16 Dec 2012 16:57:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by whitealder.osuosl.org (Postfix) with ESMTPS id 176DF8AAB7 for ; Sun, 16 Dec 2012 16:57:09 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id hm2so1458636wib.10 for ; Sun, 16 Dec 2012 08:57:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references:mime-version:content-type :content-transfer-encoding; bh=iswAtzAHdqy2mpMBzyI3e6sUV/ftjluXwLJRoiQX53Y=; b=VXoFRkE1d9HP7LIwrPGY2rZ/ooaELEqx/1vktB5UflKeHkM3nxjivLee/WP+OGeKxB QNU/heBiH4ISqxtiSkD3KSXp3sWj8DsxHez+f39Oz/NYHigy65KVOagZfMC4nhdwq/6I AGdI16vuI7l1cqqEbs/DHkauwfCT/+JdcxNtsJE5mbywn7MFUrC0+0ndrEuLGBaU8MdY onduQn+JgHTbNNGDyP1dRT9QmurZZt29OkLZEpsFt04QuD2Cb1FkrSH8EoIN/fSGLUXB TBcEVzR4GpWG1yM53eoKBXCO4R+h9Q+ooVAxWpnMKD+6RY1C1ORw5vNhnlvlZ0t61h8q qS4Q== Received: by 10.180.20.176 with SMTP id o16mr11566732wie.10.1355677028219; Sun, 16 Dec 2012 08:57:08 -0800 (PST) Received: from localhost.localdomain (ARennes-256-1-41-119.w90-32.abo.wanadoo.fr. [90.32.24.119]) by mx.google.com with ESMTPS id bz12sm8243078wib.5.2012.12.16.08.57.06 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Dec 2012 08:57:07 -0800 (PST) From: "Yann E. MORIN" To: buildroot@busybox.net Date: Sun, 16 Dec 2012 17:56:26 +0100 Message-Id: <0331dd50a1f2e004f480def8628870ffd5009a29.1355676845.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] =?utf-8?q?=5BPATCH_19/19=5D_package/dtc=3A_add_option?= =?utf-8?q?_to_install_programs?= 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: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net By default, we only install the libfdt library. As suggested by Arnout, add an option that also installs the few dtc programs. Cc: Thomas Petazzoni Cc: Arnout Vandecappelle Signed-off-by: "Yann E. MORIN" --- dtdiff, a diff for device trees, requires bash. I did not add a 'depends on bash' (or a 'select' either), because requiring bash just for that is a bit far-fetched. Instead, at dtc install time, if bash is selected, dtdiff is installed as usual to the target rootfs; if bash is not selected, dtdiff is removed from the target rootfs. --- package/dtc/Config.in | 24 ++++++++++++++++++++++-- package/dtc/dtc.mk | 29 +++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/package/dtc/Config.in b/package/dtc/Config.in index 96225e3..1c65a10 100644 --- a/package/dtc/Config.in +++ b/package/dtc/Config.in @@ -1,9 +1,29 @@ config BR2_PACKAGE_DTC - bool "dtc" + bool "dtc (libfdt)" help The Device Tree Compiler, dtc, takes as input a device-tree in a given format and outputs a device-tree in another format. - Note that only the library is installed for now. + Note that only the library is installed. + If you want the programs, say 'y' here, and to "dtc programs", below. http://git.jdl.com/gitweb/?p=dtc.git (no home page) + +if BR2_PACKAGE_DTC + +config BR2_PACKAGE_DTC_PROGRAMS + bool "dtc programs" + help + Say 'y' here if you also want the programs on the target: + - convert-dtsv0 convert from version 0 to version 1 + - dtc the device tree compiler + - dtdiff compare two device trees (needs bash) + - fdtdump print a readable version of a flat device tree + - fdtget read values from device tree + - fdtput write a property value to a device tree + + Note: dtdiff requires bash, so if bash is not selected, dtdiff will + be removed from the target file system. Enable bash if you + need dtdiff on the target. + +endif diff --git a/package/dtc/dtc.mk b/package/dtc/dtc.mk index a0e1e35..42843d5 100644 --- a/package/dtc/dtc.mk +++ b/package/dtc/dtc.mk @@ -8,27 +8,44 @@ DTC_VERSION = e4b497f367a3b2ae99cc52089a14a221b13a76ef DTC_SITE = git://git.jdl.com/software/dtc.git DTC_LICENSE = GPLv2+/BSD-2c DTC_LICENSE_FILES = README.license GPL -# Note: the dual-license only applies to the library. -# The DT compiler (dtc) is GPLv2+, but we do not install it. DTC_INSTALL_STAGING = YES +ifeq ($(BR2_PACKAGE_DTC_PROGRAMS),y) +DTC_LICENSE += (for the library), GPLv2+ (for the executables) +# Use default goal to build everything +DTC_BUILD_GOAL = +DTC_INSTALL_GOAL = install +DTC_CLEAN_GOAL = clean +else # $(BR2_PACKAGE_DTC_PROGRAMS) != y +DTC_BUILD_GOAL = libfdt +# libfdt_install is our own install rule added by our patch +DTC_INSTALL_GOAL = libfdt_install +DTC_CLEAN_GOAL = libfdt_clean +ifeq ($(BR2_PACKAGE_BASH),) +DTC_POST_INSTALL_TARGET_HOOKS += DTC_POST_INSTALL_TARGET_RM_DTDIFF +endif +endif # $(BR2_PACKAGE_DTC_PROGRAMS) != y + define DTC_BUILD_CMDS $(TARGET_CONFIGURE_OPTS) \ CFLAGS="$(TARGET_CFLAGS)" \ - $(MAKE) -C $(@D) PREFIX=/usr libfdt + $(MAKE) -C $(@D) PREFIX=/usr $(DTC_BUILD_GOAL) endef -# libfdt_install is our own install rule added by our patch +# For staging, only the library is needed define DTC_INSTALL_STAGING_CMDS $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) PREFIX=/usr libfdt_install endef define DTC_INSTALL_TARGET_CMDS - $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) PREFIX=/usr libfdt_install + $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) PREFIX=/usr $(DTC_INSTALL_GOAL) +endef +define DTC_POST_INSTALL_TARGET_RM_DTDIFF + rm -f $(TARGET_DIR)/usr/bin/dtdiff endef define DTC_CLEAN_CMDS - $(MAKE) -C $(@D) libfdt_clean + $(MAKE) -C $(@D) $(DTC_CLEAN_GOAL) endef $(eval $(generic-package))