mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: bernhard@bwalle.de
To: ptxdist@pengutronix.de
Cc: Bernhard Walle <walle@corscience.de>
Subject: [ptxdist] [PATCH] platforms: Make it possible to create a uRamdisk with an initramfs
Date: Thu,  9 Feb 2012 18:20:31 +0100	[thread overview]
Message-ID: <1328808031-28760-1-git-send-email-bernhard@bwalle.de> (raw)

From: Bernhard Walle <walle@corscience.de>

This patch adds a choice to make it possible to create the uRamdisk file
not as initrd but as initramfs. One advantage is that you don't have to
know the maximum size in advance.

The patch also beautifies the output a bit (all other images are created
silently, so we can also run this mkimage silently).

Signed-off-by: Bernhard Walle <walle@corscience.de>
---
 platforms/image_uimage.in      |   26 ++++++++++++++++++++++++--
 rules/post/image_uramdisk.make |   14 +++++++++++---
 2 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/platforms/image_uimage.in b/platforms/image_uimage.in
index 62119c4..e273726 100644
--- a/platforms/image_uimage.in
+++ b/platforms/image_uimage.in
@@ -4,13 +4,35 @@ menuconfig IMAGE_UIMAGE
 	bool
 	prompt "Generate images/uRamdisk      "
 	select HOST_UMKIMAGE
-	select IMAGE_EXT2
-	select IMAGE_EXT2_GZIP
 	help
 	  The file images/uRamdisk can be loaded separatly by the bootloader U-Boot
 
 if IMAGE_UIMAGE
 
+choice
+	prompt "Type of uRamdisk"
+	default IMAGE_UIMAGE_RAMDISK
+	help
+	  specify the type of the uRamdisk that is used.
+
+config IMAGE_UIMAGE_RAMDISK
+	bool
+	prompt "ramdisk"
+	select IMAGE_EXT2
+	select IMAGE_EXT2_GZIP
+	help
+	  Use a gzip-compressed ext2 ramdisk image.
+
+config IMAGE_UIMAGE_INITRAMFS
+	bool
+	prompt "initramfs"
+	select IMAGE_CPIO
+	select IMAGE_CPIO_GZ
+	help
+	  Use a gzip-compressed initramfs (cpio).
+
+endchoice
+
 config IMAGE_UIMAGE_NAME
 	string
 	default "Application Ramdisk"
diff --git a/rules/post/image_uramdisk.make b/rules/post/image_uramdisk.make
index 2dc70ba..3de62c1 100644
--- a/rules/post/image_uramdisk.make
+++ b/rules/post/image_uramdisk.make
@@ -21,11 +21,19 @@ else
 MKIMAGE_ARCH := $(PTXCONF_ARCH_STRING)
 endif
 
+ifdef PTXCONF_IMAGE_UIMAGE_RAMDISK
+URAMDISK_IMAGEFILE := $(IMAGEDIR)/root.ext2.gz
+endif
+
+ifdef PTXCONF_IMAGE_UIMAGE_INITRAMFS
+URAMDISK_IMAGEFILE := $(IMAGEDIR)/root.cpio.gz
+endif
+
 #
 # TODO
 #
-$(IMAGEDIR)/uRamdisk: $(IMAGEDIR)/root.ext2.gz
-	@echo -n "Creating U-Boot ramdisk from root.ext2.gz...";
+$(IMAGEDIR)/uRamdisk: $(URAMDISK_IMAGEFILE)
+	@echo -n "Creating U-Boot ramdisk from $(notdir $(URAMDISK_IMAGEFILE))...";
 	@$(PTXCONF_SYSROOT_HOST)/bin/mkimage \
 		-A $(MKIMAGE_ARCH) \
 		-O Linux \
@@ -33,7 +41,7 @@ $(IMAGEDIR)/uRamdisk: $(IMAGEDIR)/root.ext2.gz
 		-C gzip \
 		-n $(PTXCONF_IMAGE_UIMAGE_NAME) \
 		-d $< \
-		$@
+		$@ > /dev/null
 	@echo "done."
 
 # vim: syntax=make
-- 
1.7.9


-- 
ptxdist mailing list
ptxdist@pengutronix.de

                 reply	other threads:[~2012-02-09 17:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328808031-28760-1-git-send-email-bernhard@bwalle.de \
    --to=bernhard@bwalle.de \
    --cc=ptxdist@pengutronix.de \
    --cc=walle@corscience.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox