[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to build an initrd image?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed 2007-04-04 05:59:20 -0400, Maxime Tierrie wrote:

> I'm almost a newbie with Linux and I'm trying to learn how to build
> embedded Linux systems based on ARM.  I have already compiled a 2.6.19
> kernel for arm with a x86_64 host, apparently without any problem.  My
> question is how build an initrd file ? I don't really get how to do
> that with a cross-compile platform.  I aim to run my kernel with an
> emulator (Qemu?).  If you have some hints for me, don't hesitate!

For modern kernels like you've got, initrd's are just gzip'ed CPIO
archives.  (debian uses the term "initramfs" for this, as distinct
from an "initrd", which, in debian packaging refers to a cramfs file
- -- slightly different.)

the typical way to build an initramfs is to make a tree of all the
files that you want in the initramfs.  let's say you make it in a
directory named "fubar".  Then do:

 cd fubar
 find . | cpio -o -H newc | gzip > ../fubar_initramfs.gz

you can now use fubar_initramfs.gz as an initramfs for your kernel.

Here's a link that might be useful:

  http://lldn.timesys.com/docs/initramfs

  --dkg
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ <http://mailcrypt.sourceforge.net/>

iD8DBQFGE+IliXTlFKVLY2URAm+PAKDrneHYrHhzgzKu53CBH11R54w7+QCgkkWI
o5vA9fr6Zm864LFRozdNw8A=
=OBdy
-----END PGP SIGNATURE-----



Reply to: