From patchwork Wed Apr 17 19:07:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Spenser Gilliland X-Patchwork-Id: 237351 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 891A72C00D8 for ; Thu, 18 Apr 2013 05:33:45 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4928F31902; Wed, 17 Apr 2013 19:33:43 +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 j4YsUjHVdY-N; Wed, 17 Apr 2013 19:33:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id A85F3318E3; Wed, 17 Apr 2013 19:33:41 +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 186B78F7A4 for ; Wed, 17 Apr 2013 19:33:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6308D8CDB9 for ; Wed, 17 Apr 2013 19:33:39 +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 ynsjL7qCn76I for ; Wed, 17 Apr 2013 19:33:37 +0000 (UTC) X-Greylist: delayed 00:25:54 by SQLgrey-1.7.6 Received: from mail-ye0-f174.google.com (mail-ye0-f174.google.com [209.85.213.174]) by whitealder.osuosl.org (Postfix) with ESMTPS id 777038CD9B for ; Wed, 17 Apr 2013 19:33:37 +0000 (UTC) Received: by mail-ye0-f174.google.com with SMTP id l2so316567yen.19 for ; Wed, 17 Apr 2013 12:33:36 -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 :x-gm-message-state; bh=UOk/vQ/hT/WPcV6p2ykme/VNpME21Z3SBG3fujW12OI=; b=LtLkKyY+R3cJGlEHNj6t4Hycj+ZuvnntiKHsdCBNepYcKfhX9q5nIWoHHJ0hTTsOFZ TPd4VntHh4UeuNgIeAzNYJMUy8GCLXIhg0/jctzBkFG/PB8PxGGqB/clf/yneAtsTZxu WTHplEAk9RhfQvZeOrpFyk0DCNYUHVsBzlErqvvWopN2LBvNkPc3mEYdkU5xZkDl9aSd c3vJCSAs0wZoegEopo3tFF7rlkY5OBqDeWe/oj+ck/cbU4P1E27n5rc8UvDfvB0jtqo4 SA0zFCpWS5hhahhwEPw/neS+9AMTd344JkLatVqaudKlcqoyj3FnxAIEhf+uoaTZaiiw 2dbQ== X-Received: by 10.236.98.66 with SMTP id u42mr5037420yhf.157.1366225662053; Wed, 17 Apr 2013 12:07:42 -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 ESMTPS id 28sm11448317yhd.5.2013.04.17.12.07.40 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Apr 2013 12:07:41 -0700 (PDT) From: Spenser Gilliland To: buildroot@busybox.net Date: Wed, 17 Apr 2013 14:07:34 -0500 Message-Id: <1366225654-11562-1-git-send-email-spenser@gillilanding.com> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQmrdzVk8f/XUondL7LsQI/NjKQzUbFhLKxng6A+ww8JLEHSaM1nXF4fK5qXTqLQ7w7aijy4 Cc: Spenser Gilliland Subject: [Buildroot] [PATCH 1/1] 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 --- fs/common.mk | 20 +++++++++++++++++++- fs/cpio/Config.in | 7 +++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/fs/common.mk b/fs/common.mk index a0b7b39..10520bc 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) \ @@ -39,7 +41,9 @@ ROOTFS_DEVICE_TABLES = $(call qstrip,$(BR2_ROOTFS_DEVICE_TABLE) \ define ROOTFS_TARGET_INTERNAL # extra deps -ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) +ROOTFS_$(2)_DEPENDENCIES += host-fakeroot host-makedevs \ + $$(if $$(BR2_TARGET_ROOTFS_$(2)_LZMA),host-lzma) \ + $$(if $$(BR2_TARGET_ROOTFS_$(2)_UIMAGE),host-uboot-tools) $$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES) @$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)") @@ -70,6 +74,20 @@ endif ifeq ($$(BR2_TARGET_ROOTFS_$(2)_LZMA),y) $$(LZMA) -9 -c $$@ > $$@.lzma 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 0669a44..d2d2702 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