Difference between revisions of "DaVinci Initrd 1.0"

From eLinux.org
Jump to: navigation, search
Line 2: Line 2:
  
 
<code><pre>
 
<code><pre>
# dd if=/dev/zero of=uRamdisk.img bs=1k count=20480
+
> dd if=/dev/zero of=uRamdisk.img bs=1k count=20480
# mkfs.ext2 -F -v -M0 uRamdisk.img
+
> mkfs.ext2 -F -v -M0 uRamdisk.img
# mount -o loop uRamdisk.img <path to mount point>
+
> mount -o loop uRamdisk.img <path to mount point>
 
</pre></code>
 
</pre></code>
 
Now copy all the files needed for RAMDISK to the <path to mount point>.. that would be busybox and/or other apps and libs.
 
Now copy all the files needed for RAMDISK to the <path to mount point>.. that would be busybox and/or other apps and libs.
  
 
<code><pre>
 
<code><pre>
# umount <path to mount point>
+
> umount <path to mount point>
# gzip -9 < uRamdisk.img > uRamdisk
+
> gzip -9 < uRamdisk.img > uRamdisk
 
</pre></code>
 
</pre></code>
 
Installing the Ramdisk (/tftpboot/uRamdisk) via u-boot
 
Installing the Ramdisk (/tftpboot/uRamdisk) via u-boot
Line 17: Line 17:
  
 
<code><pre>
 
<code><pre>
# install_ramdisk 'tftp 0x2200000 uRamdisk; era 0x2200000 +${filesize};cp.b 0x85000000 0x2200000 ${filesize}'
+
UBOOT# install_ramdisk 'tftp 0x2200000 uRamdisk; era 0x2200000 +${filesize};cp.b 0x85000000 0x2200000 ${filesize}'
 
</pre></code>
 
</pre></code>
 
Save the ramdisk size into an environmental variable:
 
Save the ramdisk size into an environmental variable:
  
 
<code><pre>
 
<code><pre>
# setenv ramdisksize 0x${filesize}; saveenv
+
UBOOT# setenv ramdisksize 0x${filesize}; saveenv
 
</pre></code>
 
</pre></code>
 
Update the boot parameters:
 
Update the boot parameters:
  
 
<code><pre>
 
<code><pre>
# setenv bootargs 'mem=120M console=ttyS0,115200n8 ip=dhcp root=/dev/ram0 rw initrd=0x85000000,8M'
+
UBOOT# setenv bootargs 'mem=120M console=ttyS0,115200n8 ip=dhcp root=/dev/ram0 rw initrd=0x85000000,8M'
# setenv bootcmd 'cp.b 0x2200000 0x85000000 ${ramdisksize}; bootm'
+
UBOOT# setenv bootcmd 'cp.b 0x2200000 0x85000000 ${ramdisksize}; bootm'
 
</pre></code>
 
</pre></code>

Revision as of 13:35, 4 July 2007

Create initrd Procedure (note change count to your required filesystem size):

> dd if=/dev/zero of=uRamdisk.img bs=1k count=20480
> mkfs.ext2 -F -v -M0 uRamdisk.img
> mount -o loop uRamdisk.img <path to mount point>

Now copy all the files needed for RAMDISK to the <path to mount point>.. that would be busybox and/or other apps and libs.

> umount <path to mount point>
> gzip -9 < uRamdisk.img > uRamdisk

Installing the Ramdisk (/tftpboot/uRamdisk) via u-boot

Copy the data into RAM then flash:

UBOOT# install_ramdisk 'tftp 0x2200000 uRamdisk; era 0x2200000 +${filesize};cp.b 0x85000000 0x2200000 ${filesize}'

Save the ramdisk size into an environmental variable:

UBOOT# setenv ramdisksize 0x${filesize}; saveenv

Update the boot parameters:

UBOOT# setenv bootargs 'mem=120M console=ttyS0,115200n8 ip=dhcp root=/dev/ram0 rw initrd=0x85000000,8M'
UBOOT# setenv bootcmd 'cp.b 0x2200000 0x85000000 ${ramdisksize}; bootm'