[U-Boot-Users] Special Procedure to prepare own Ramdisk for U-boot ?!!

Matej Kupljen matej.kupljen at ultra.si
Wed Jun 2 09:01:51 CEST 2004


Hi

>        Thanks for ur reply. i want to know is there any special
> procedure to create my own RAMDISK. 

I create my RAMDISK using loop back device, like this:
# dd if=/dev/zero of=initrd.img bs=1k count=4096
# mkfs.ext2 -F -v -M0 initrd.img
# mount -o loop initrd.img <path to mount point>
Now copy all the files needed for RAMDISK to the <path to mount point>
Also create the linuxrc script on the /, which will get started when 
the initrd is mounted.
# umount <path to mount point>
# gzip -9 < initrd.img > initrd.bin

Use initrd.bin as the image for the RAMDISK. 

>  root=/dev/ram0 rw console=ttyS0,115200
> 
>       I dont know ..where u-boot load the RAMDISK n pass the address to
> Kernel. i tried this one also ... 
> 
>  root=/dev/ram0 rw initrd=0x00800000,4M console=ttyS0,115200

I use this cmd line:

ip=bootp; root=/dev/hda2 rw initrd=0xa1200000,0x400000
console=ttyS00,115200n8

I use my RAMDISK to set up the CF card, which has the rootfs on the
second partition. I checked the Linux source code and if you are using 
the initrd, the linuxrc on the initrd will automatically be called,
so there is no need to explicitly state the the root is /dev/ram0.

Check the prepare_namespace in the init/do_mounts.c
When initrd is loaded it calls handle_initrd which then creates the
kernel thread, do_linuxrc, which executes the linuxrc script on the
/. 

Hope that helps.

Regards,
Matej





More information about the U-Boot mailing list