From patchwork Fri Oct 3 13:43:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yegor Yefremov X-Patchwork-Id: 396240 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 C557814012D for ; Fri, 3 Oct 2014 23:44:25 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5C50A92D9C; Fri, 3 Oct 2014 13:44:24 +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 hoozzRHaTEFS; Fri, 3 Oct 2014 13:44:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id D82F792D94; Fri, 3 Oct 2014 13:44:21 +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 58DA61C20E8 for ; Fri, 3 Oct 2014 13:44:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 53B8A92D88 for ; Fri, 3 Oct 2014 13:44:20 +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 3IZxWvJ-KPmj for ; Fri, 3 Oct 2014 13:44:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by whitealder.osuosl.org (Postfix) with ESMTPS id 03B8892D91 for ; Fri, 3 Oct 2014 13:44:18 +0000 (UTC) Received: by mail-wi0-f181.google.com with SMTP id hi2so2142256wib.14 for ; Fri, 03 Oct 2014 06:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=A7ts3+OJF0UFaQI5co16xLlFE5+OPJ9ofk21s2Gqy2E=; b=E/eOnoUuMzHv2CwGvOm7yxRvPWwLAApLZPqKElK0M9PO+CqE2pVaVvDXgVTaoPtjjH jm6+xcypJf9W2kXOb6pmqmuaZVZsqM34ckiBKbb6TbEtEa9GSe25fZHGnlgJQRBqumzE owt3Gs0m4viH2pD4ZymkN+J5KHd7eh7B75x4LHYLyc2TosJeyVIY2c96sFtS4p66VHO7 VTUq5SWwThuVbc6uk1hxvhRPP6Fd+oSRg5liHi9+9Gz8mHtQjJHSSsW5IcqAD0bAw7am Q6KzaWfkzp155TqbmSIonzdcWdrYqbymJgtiVj2tFw4v6lVz1KvtxDgC8sDTGnE9fiFO GQfg== X-Received: by 10.180.212.48 with SMTP id nh16mr12903902wic.44.1412343857416; Fri, 03 Oct 2014 06:44:17 -0700 (PDT) Received: from user-Lenovo-IdeaPad-Z500.localdomain (x2f0048c.dyn.telefonica.de. [2.240.4.140]) by mx.google.com with ESMTPSA id ju1sm8058061wjc.1.2014.10.03.06.44.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 06:44:16 -0700 (PDT) From: Yegor Yefremov To: buildroot@busybox.net Date: Fri, 3 Oct 2014 15:43:54 +0200 Message-Id: <1412343834-2532-1-git-send-email-yegorslists@googlemail.com> X-Mailer: git-send-email 1.8.3.2 Cc: thomas.petazzoni@free-electrons.com Subject: [Buildroot] [PATCH v5] Add support for Flattened Image Trees 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: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch introduces a new file system image type FIT. User can specify one or more *.its files, that will be compiled and copied into images or installed into /boot directory. Signed-off-by: Yegor Yefremov --- Changes: v5: change patch description v4: add support for multiple *.its files, reduce code duplication v3: fix syntax errors, remove itb name, add uboot-tools dependency v2: moved configuration to fs infra instead of linux fs/Config.in | 1 + fs/fit/Config.in | 31 +++++++++++++++++++++++++++++++ fs/fit/fit.mk | 29 +++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 fs/fit/Config.in create mode 100644 fs/fit/fit.mk diff --git a/fs/Config.in b/fs/Config.in index 5853113..8d882d0 100644 --- a/fs/Config.in +++ b/fs/Config.in @@ -4,6 +4,7 @@ source "fs/cloop/Config.in" source "fs/cpio/Config.in" source "fs/cramfs/Config.in" source "fs/ext2/Config.in" +source "fs/fit/Config.in" source "fs/initramfs/Config.in" source "fs/iso9660/Config.in" source "fs/jffs2/Config.in" diff --git a/fs/fit/Config.in b/fs/fit/Config.in new file mode 100644 index 0000000..f05b2a7 --- /dev/null +++ b/fs/fit/Config.in @@ -0,0 +1,31 @@ +config BR2_TARGET_ROOTFS_FIT + bool "Flattened Image Tree support" + select BR2_PACKAGE_HOST_UBOOT_TOOLS + help + Compile a flattened image tree sources into a flattened + image tree blobs. Specify the *.its files to compile in + the options below. + + Please note, that all files referenced in *.its files, + should be available in output/images folder. + +if BR2_TARGET_ROOTFS_FIT + +config BR2_FIT_PATH + string "Flattened Image Tree source file paths" + help + Paths to the image tree source files. You can + provide a list of *.its paths to copy and build, + separated by spaces. + + Please note, that all *.its files must be named uniquely, + otherwise the files with the same name will be overwritten. + +config BR2_FIT_INSTALL_TARGET + bool "Install Flattened Image Tree blobs to /boot in target" + depends on !BR2_TARGET_ROOTFS_INITRAMFS + help + Select this option to have the FIT images installed to + /boot in the target root filesystem. + +endif diff --git a/fs/fit/fit.mk b/fs/fit/fit.mk new file mode 100644 index 0000000..68a9557 --- /dev/null +++ b/fs/fit/fit.mk @@ -0,0 +1,29 @@ +################################################################################ +# +# Build the FIT image +# +################################################################################ + +ROOTFS_FIT_DEPENDENCIES = host-uboot-tools + +FIT_SRCS = $(addprefix $(BINARIES_DIR)/,$(notdir $(call qstrip,$(BR2_FIT_PATH)))) +FIT_BLOBS = $(addsuffix .itb, $(basename $(FIT_SRCS))) + +ifeq ($(BR2_FIT_INSTALL_TARGET),y) +define FIT_INSTALL_ITB_TARGET + mkdir -p $(TARGET_DIR)/boot/ && \ + cp $(FIT_BLOBS) $(TARGET_DIR)/boot/ +endef +else +define FIT_INSTALL_ITB_TARGET + true +endef +endif + +define ROOTFS_FIT_CMD + cp $(BR2_FIT_PATH) $(BINARIES_DIR) && \ + $(foreach its,$(FIT_SRCS),$(HOST_DIR)/usr/bin/mkimage -f $(its) $(basename $(its)).itb &&) \ + $(FIT_INSTALL_ITB_TARGET) +endef + +$(eval $(call ROOTFS_TARGET,fit))