From: Bernhard Walle <[email protected]> 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 <[email protected]> --- 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 [email protected]
