From patchwork Wed May 15 23:12:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Spenser Gilliland X-Patchwork-Id: 244200 X-Patchwork-Delegate: arnout@mind.be 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 CEAC02C00A8 for ; Thu, 16 May 2013 09:12:34 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id DB5B18D522; Wed, 15 May 2013 23:12:30 +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 dbNq3Mn6cN8Y; Wed, 15 May 2013 23:12:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 651798D53D; Wed, 15 May 2013 23:12:22 +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 796238F76F for ; Wed, 15 May 2013 23:12:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2EE4281C29 for ; Wed, 15 May 2013 23:12: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 F5bPUO-OX4eu for ; Wed, 15 May 2013 23:12:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-oa0-f41.google.com (mail-oa0-f41.google.com [209.85.219.41]) by whitealder.osuosl.org (Postfix) with ESMTPS id 756998D51C for ; Wed, 15 May 2013 23:12:12 +0000 (UTC) Received: by mail-oa0-f41.google.com with SMTP id n9so2988225oag.0 for ; Wed, 15 May 2013 16:12:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=cefG4ARLAShDEAtIzFB+0ATfreAEcH2bBd2x+c+qcnY=; b=CgKI+p31EJhUKXGz5Qe3APjFFu5AbjKNRhvaFmXU7MUKh2UkpRX/LFAmhNidntvq8y CBL05xm9pn7k8jyguIhF+TOlf3FdFXWSEv6+opc4GpNgF08P7Bc+CGbqbLLxFizPtnkA GQ29YwqQ8yZhgyZsauM5Wz75tGhOU+d6uK/vzvl/6IWytWafFlV87kfVAYgx4zb9u5Go 1eAkhZ9GXW3Ob63ZuvWkOaoDaT4+09+QeS5gfl5yvoTbxyU+Z77P7oaMfXRqg0lsIRt6 2vrgVIFEgxxnq4ZBaIDSl+TFTyFTK2bPyXuB33e7lOmeTr0PZDb8UG7/ESltoTMdyiv1 h8VQ== X-Received: by 10.60.47.81 with SMTP id b17mr12648183oen.63.1368659531450; Wed, 15 May 2013 16:12:11 -0700 (PDT) Received: from bourban.gateway.2wire.net (108-90-245-135.lightspeed.cicril.sbcglobal.net. [108.90.245.135]) by mx.google.com with ESMTPSA id jt1sm5320799oeb.5.2013.05.15.16.12.10 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 May 2013 16:12:10 -0700 (PDT) From: Spenser Gilliland To: buildroot@busybox.net Date: Wed, 15 May 2013 18:12:03 -0500 Message-Id: <1368659524-21154-2-git-send-email-spenser@gillilanding.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1368659524-21154-1-git-send-email-spenser@gillilanding.com> References: <1368659524-21154-1-git-send-email-spenser@gillilanding.com> X-Gm-Message-State: ALoCoQlmCDzZlshF16ap7H5+iXXXdRXkUyztuv06rmf7MRy7/nkBMh5kZLVya1H9zKprr0fhiqFB Cc: Spenser Gilliland Subject: [Buildroot] [PATCH 2/3] fs: add uimage support w/ example for cpio 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 From: Spenser Gilliland Adds uimage support for various root filesystems. Uimage support is needed when using the bootm command in uboot. This provides both a simple infrastructure similar to the current BR2_TARGET_ROOTFS_$(2)_GZ for adding compression. To define the a rootfs should have a UIMAGE wrapper simply create the BR2_TARGET_ROOTFS_$(2)_UIMAGE symbol. Signed-off-by: Spenser Gilliland Tested-by: Soren Brinkmann --- fs/common.mk | 22 +++++++++++++++++++++- fs/cpio/Config.in | 7 +++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/fs/common.mk b/fs/common.mk index 36da2dd..f456025 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -31,6 +31,8 @@ # BR2_TARGET_ROOTFS_$(FSTYPE)_LZMA exist and are enabled, then the # macro will automatically generate a compressed filesystem image. +MKIMAGE_RAMDISK = $(HOST_DIR)/usr/bin/mkimage -A $(BR2_ARCH) -T ramdisk -C $(1) -d $(2) $(2).uboot + FAKEROOT_SCRIPT = $(BUILD_DIR)/_fakeroot.fs FULL_DEVICE_TABLE = $(BUILD_DIR)/_device_table.txt ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE) \ @@ -40,7 +42,11 @@ USERS_TABLE = $(BUILD_DIR)/_users_table.txt define ROOTFS_TARGET_INTERNAL # extra deps -ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZO),host-lzop) $$(if $$(BR2_TARGET_ROOTFS_$(2)_XZ),host-xz) +ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs \ + $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) \ + $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZO),host-lzop) \ + $$(if $$(BR2_TARGET_ROOTFS_$(2)_XZ),host-xz) \ + $$(if $$(BR2_TARGET_ROOTFS_$(2)_UIMAGE),host-uboot-tools) $$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES) @$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)") @@ -79,6 +85,20 @@ endif ifeq ($$(BR2_TARGET_ROOTFS_$(2)_XZ),y) $(XZ) -9 -C crc32 -c $$@ > $$@.xz endif +ifeq ($$(BR2_TARGET_ROOTFS_$(2)_UIMAGE),y) +ifeq ($$(BR2_TARGET_ROOTFS_$(2)_NONE),y) + $$(call MKIMAGE_RAMDISK,none,$$@) +endif +ifeq ($$(BR2_TARGET_ROOTFS_$(2)_GZIP),y) + $$(call MKIMAGE_RAMDISK,gzip,$$@.gz) +endif +ifeq ($$(BR2_TARGET_ROOTFS_$(2)_BZIP2),y) + $$(call MKIMAGE_RAMDISK,bzip2,$$@.bz2) +endif +ifeq ($$(BR2_TARGET_ROOTFS_$(2)_LZMA),y) + $$(call MKIMAGE_RAMDISK,lzma,$$@.lzma) +endif +endif rootfs-$(1)-show-depends: @echo $$(ROOTFS_$(2)_DEPENDENCIES) diff --git a/fs/cpio/Config.in b/fs/cpio/Config.in index 87dde64..3e82dc5 100644 --- a/fs/cpio/Config.in +++ b/fs/cpio/Config.in @@ -5,6 +5,13 @@ config BR2_TARGET_ROOTFS_CPIO used for an initial RAM filesystem that is passed to the kernel by the bootloader. +config BR2_TARGET_ROOTFS_CPIO_UIMAGE + bool "Add U-Boot header to the root filesystem" + depends on BR2_TARGET_ROOTFS_CPIO + help + Add a u-boot header to the cpio root filesystem. This allows + the image to be booted by the bootm command in uboot. + choice prompt "Compression method" default BR2_TARGET_ROOTFS_CPIO_NONE