From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from moutng.kundenserver.de ([212.227.17.9]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1RvXhS-0001aW-IB for ptxdist@pengutronix.de; Thu, 09 Feb 2012 18:22:27 +0100 From: bernhard@bwalle.de Date: Thu, 9 Feb 2012 18:20:31 +0100 Message-Id: <1328808031-28760-1-git-send-email-bernhard@bwalle.de> Subject: [ptxdist] [PATCH] platforms: Make it possible to create a uRamdisk with an initramfs Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: Bernhard Walle From: Bernhard Walle 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 --- 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