[Gllug] Getting initramfs to work

Peter Grandi pg_gllug at gllug.for.sabi.co.UK
Tue Aug 9 16:01:19 UTC 2005


>>> On Tue, 09 Aug 2005 13:37:09 +0100, Adrian McMenamin
>>> <adrian at mcmen.demon.co.uk> said:

adrian> X compiling a 2.6.12.3 kernel for a device with no
adrian> disk. Normally I'd NFS-Root mount some disk space but
adrian> due to an apparent bug in Fedora Core 4 I cannot do that
adrian> right now [ ... ]

The error you report «rpc.idmapd: nfsdreopen: Opening '' failed»
is of course on the server, and probably you can find a fixed
'idmapd' somewhere. If it is a bug... Also I notice that you are
trying to mount the root filesystem rw, which may not be a good
idea.

But the RH NFS has some less common extensions, and perhaps
showing the contents of '/etc/exports' might help.

Also looking at

  http://WWW.LTSP.org/documentation/ltsp-3.0.0/ltsp-3.0.html#AEN624
  http://Kent.dl.SourceForge.net/sourceforge/ltsp/lts_tsguide_v2.2.html

might help. In this other report of a seemingly identical cause:

  https://Bugzilla.RedHat.com/bugzilla/long_list.cgi?buglist=144556

it is reported it has been fixed, but it does not seem your
case, unless your exported root dir, or _any_ dir leading to it
is longer than 12KiB.

adrian> So I want to use initramfs, rather than an old style
adrian> initrd. I've been able to getr the kernel to build a
adrian> .cpio file

Weird phrase -- «the kernel to build a .cpio file» :-). In
'initramfs' setups the kernel _unpacks_ a '.cpio' file; the
kernel build process just if so specified appends that '.cpio'
file to the kernel image.

But the main issue is that you have to put into that '.cpio'
whatever you want to have in the RAM fs, and that must usually
be arranged in a specific way.

The ''canonical'' documentation specific to 'initramfs' is in
the kernel source tree under:

  .../Documentation/early-userspace/README
  http://WWW.iBiblio.org/peanut/Kernel-2.6.12/early-userspace/README

If the document above is too technical, there are some more or
less helpful complementary bits. For example:

* There is a a short and fairly clear introduction (for the
  limited purpose of showing a splash image, but it applies
  generally) here:

    http://Gentoo-Wiki.com/HOWTO_fbsplash#Making_An_initramfs_Image

* Another one with an extensive example of an building an
  'initramfs' configuration here:

    http://LinuxGazette.net/113/kapil.html

* There is some more technical discussion on the general issues
  here:

    http://LWN.net/Articles/14776/
    http://WWW.StillHQ.com/extracted/phd/references/hpa-initramfs_klibc_and_early_userspace.pdf

* 'yaird' is a tool to generated 'initramfs' images:

    http://WWW.XS4ALL.NL/~ekonijn/yaird/yaird.html

* Other interesting resources:

    http://readList.com/lists/vger.kernel.org/linux-kernel/1/5846.html
    http://WWW.CELinuxForum.org/pubwiki/moin.cgi/EarlyUserSpace

In essence, 'initramfs' is a variants on the 'initrd' concept,
where the initial ram disk is populated from a ''new cpio''
archive, which can be appended to the kernel image, instead of
from a (possibly compressed) filesystem image.

Therefore all the usual tips and techniques for building and
running 'initrd' filesystems apply. Some links:

  http://WWW.Linux-boot.net/RootFS/
  http://WWW.Linux-boot.net/InitRD/
  http://WWW.LinuxForum.com/linux-filesystem/initrd.html
  http://WWW.Intra2Net.com/opensource/diskless-howto/howto.html

adrian> but it doesn't want to seem to boot it.

Given the (customary) lack of clarity here, both as to what you
are trying to do and the consequences, it is hard to guess what
is not booting... The '.cpio' file? The kernel? Whatever...

There may be several reasons why ''it dont work mate'' as
applied to 'initramfs', for example:

* the '.cpio.gz' data has not been appended to the kernel
  image;

* the '.cpio' is not in the new CRC format ('-H crc');

* the filesystem in the '.cpio' image does not contain
  some essential bits and pieces;

* the kernel is missing some essential drivers;

* the '.cpio.gz' image is not named "usr/initramfs_data.cpio.gz"
  in the kernel build directory;

* ...

adrian> I can't really find a beginners guide to using initramfs

Really surprising... :-)

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list