Skip to main content.
Navigation:
DENX
>
DULG
>
HowToAddFiles
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
DULG
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
DULG Home
BoardSelect
Manual
FAQ
Application Notes
Changes
Index
List of pages in DULG
Search
%SECTION0{name=HowToAddFiles}% How to Add Files to a SELF Ramdisk It is not always necessary to rebuild a SELF based ramdisk image if you want to modify or to extend it. Especially during development it is often eaiser to unpack it, modify it, and re-pack it again. To do so, you have to understand the internal structure of the =uRamdisk= (resp. =pRamdisk=) images files as used with the U-Boot (old: <nop>PPCBoot) boot loader: The =uRamdisk= image contains two parts: * a 64 byte U-Boot header * a (usually =gzip= compressed) ramdisk image To modify the contents you have to extract, uncompress and mount the ramdisk image. This can be done as follows: 1 Extract compressed ramdisk image (=ramdisk.gz=) <verbatim> bash$ dd if=uRamdisk bs=64 skip=1 of=ramdisk.gz 21876+1 records in 21876+1 records out </verbatim> 1 Uncompress ramdisk image (if it was a compressed one) <verbatim> bash$ gunzip -v ramdisk.gz ramdisk.gz: 66.6% -- replaced with ramdisk </verbatim> 1 Mount ramdisk image <verbatim> bash# mount -o loop ramdisk /mnt/tmp </verbatim> Now you can add, remove, or modify files in the =/mnt/tmp= directory. If you are done, you can re-pack the ramdisk into a U-Boot image: 1 Unmount ramdisk image: <verbatim> bash# umount /mnt/tmp </verbatim> 1 Compress ramdisk image <verbatim> bash$ gzip -v9 ramdisk ramdisk: 66.6% -- replaced with ramdisk.gz </verbatim> 1 Create new U-Boot image (=new-uRamdisk=) <verbatim> bash$ mkimage -T ramdisk -C gzip -n 'Simple Embedded Linux Framework' \ > -d ramdisk.gz new-uRamdisk Image Name: Simple Embedded Linux Framework Created: Sun May 4 13:23:48 2003 Image Type: PowerPC Linux RAMDisk Image (gzip compressed) Data Size: 1400121 Bytes = 1367.31 kB = 1.34 MB Load Address: 0x00000000 Entry Point: 0x00000000 </verbatim> Instead of re-packing into a U-boot ramdisk image you can of course also just extract the contents of the SELF image and re-use it as base of a (known to be working) root filesystem. * For example, you can create a JFFS2 filesystem using the =mkfs.jffs2= command that comes with the [[MTD Tools]]: %IF{ %BIG_ENDIAN% eq "true" }% <verbatim> bash# mkfs.jffs2 -r /mnt/tmp -e 0x10000 -o image.jffs2 -b </verbatim> %ELSE% <verbatim> bash# mkfs.jffs2 -r /mnt/tmp -e 0x10000 -o image.jffs2 </verbatim> %ENDIF% * Or you can create a <nop>CramFS filesystem with =mkcramfs=: <verbatim> bash# mkcramfs -r /mnt/tmp image.cramfs Swapping filesystem endian-ness ... Everything: 1656 kilobytes Super block: 76 bytes CRC: 7f34cae4 </verbatim>
14.4. Self
1. Abstract
14.4.2. How to Increase the Size of the Ramdisk
Prev
Home
Next