How could I run programs from ramdisk?

I want to make a ramdisk so that some programs can be run after the kernel loaded.For example, I copy the /sbin/ifconfig from the rehhat system to initrd(to /bin/ifconfig),and add line "/bin/ifconfig eth0 up" in the linuxrc. But when running ,it failed:ERROR:/bin/ifconfig exited abnormally! MY QUESTION: How could I run /sbin/ifconfig correctly in initrd? which configuration should i add? Thanks!

Reply to
Alan
Loading thread data ...

Unless it is statically linked, /bin/ifconfig (usually /sbin/ifconfig) needs the C library (e.g. libc.so.6) and the dynamic loader (e.g. /lib/ld-linux.so.2). The dynamic loader also needs a couple of support files (see man ld.so).

--

Tauno Voipio
tauno voipio (at) iki fi
Reply to
Tauno Voipio

also i beleive to run ifconfig u will need the proc filesystem just my 2 cents

Reply to
Amit Limaye

Alan. May I suggest you to look at one of these tiny floppy based distributions? Most (if not all) of them are ramdisk based and can provide you with a template for what you need, assuming I understood your question. You may also get the ramdisk image from a boot disquete generated with syslinux, such as debian's or redhat's.

Regards.

Elder.

Reply to
Elder Costa

There are lots of examples and development tools, as using Floppy, network or Boot-Flash as a boot medium usually asks for having the root filer system in RAM.

I once successfully tried ELINOS as a "distribution maker", with all three (Floppy, Network and Boot-Flash). It comes with tools to create a file system and uses free booting code.

-Michael

Reply to
Michael Schnell

Tauno.Thanks for your suggestion. But I compile the file "ifconfig" as a static file. it failed again,The Error is : eth0:unknown interface:no such device!

why the eth0 can't be f>> I want to make a ramdisk so that some programs can be run after the

Reply to
Alan

You do not have the Ethernet card driver compiled in the kernel and a module driver is not loaded yet.

Would you please tell why you need to get the interface up before the root file system is available.

If you're attempting to run with a NFS-mounted root file system, get and read the following HOWTO's from the Linux Documentation Project: - Diskless-root-NFS-HOWTO, - Diskless-root-NFS-other-HOWTO

--

Tauno Voipio
tauno voipio (at) iki fi
Reply to
Tauno Voipio

"Michael Schnell" ??????: snipped-for-privacy@viruswall.lumino.de...

Michael,could you tell me the name of development tools or show me some examples ? Thanks for your help. Alan

Reply to
Alan

formatting link

formatting link
talks about several boot strategies, all of which use RAM base root file systems: e.g. ROLO (a free open source tool by the ElinOS makers "SysGo" boots from a boot flash.

-Michael

Reply to
Michael Schnell

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.