[ELDK] Read ramdisk informations when running...

Wolfgang Denk wd at denx.de
Wed Oct 14 23:26:44 CEST 2009

Dear jonathan.orditz at selectron.ch,

In message <OFE8881A5A.0C7A4AD5-ONC125764F.0059C429-C125764F.005A89AC at schneider-electric.com> you wrote:
> Is it possible to read the name of the ramdisk while it is running ?

There is no such thing as a "name of the ramdisk"

> An example: when the ramdisk is created with "mkimage -T ramdisk -C gzip 
> -n 'Simple Embedded Linux Framework' -d ramdisk.gz new_Ramdisk", the name 
> "Simple Embedded Linux Framework" is given to the ramdisk and is displayed 

This is not correct. The name is not assigned to the ramdisk, but to
the ramdisk _image_. It is stored in the image header which is used by
U-Boot, and by U-Boot only. when Linux mounts the ramdisk, this header
is no longer available anywhere.

> when the ramdisk is started. But is it possible to read this information 
> while the ramdisk is running ?

No, in general this is impossible. IOf course you can read it from the
ramdisk _image_ if this should be still available somewhere, for
example when stored in flash and you have sufficient MTD support
enabled in the kernel. But then you still could have several images in
the flash, and you cannot know which of these is running.

You can, however, assign a name (a file system label) to many file
system types.

> The purpose of this, is to give a version to the ramdisk (and its 
> content), for example "SELF v1.1.2", to read it from an application 
> running on the ramdisk and to display it on a setup/support page. So when 
> customers report a problem or missing binaries, etc... they can reference 
> this name "SELF v1.1.2" and I know directly that they maybe have to update 
> to "SELF v1.3.1" or I can consult the bugs or problems known for "SELF 
> v1.1.2"...

It doesn't work like that. Also note that using a ramdisk image is
almost always the worst choice for a root file system. See for example

Best regards,

Wolfgang Denk

DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Superior ability breeds superior ambition.
	-- Spock, "Space Seed", stardate 3141.9

More information about the eldk mailing list