Hi,

On Thu, 20 Apr 2006 08:05:50 -0500 "Johnson, Maurice E CTR NSWCDL-K74"
<[EMAIL PROTECTED]> wrote:

> Need to find a better tutorial on initramfs. One that doesn't rely on
> tools that automate the process.

In fact, an initramfs doesn't differ much from other root fs'es.
Physically, it is a gzipped cpio archive. The kernel will compile it
into the kernel itself if you tell it so (kernel configuration:
configure a patch for initramfs data). If you want to create it
manually and load it like a ram disk (i.e. use the boot loader to pass
the initramfs to the kernel) you can rely on a script that is in
your kernels ./scripts/ directory and an executable that gets compiled
in ./usr/ like this:

gen_initramfs_list.sh /path/to/initramfs/data | gen_init_cpio /dev/stdin | gzip 
-9 > initramfs.gz

Inside the initramfs you can create a userland. Kernel's entry point
will be /init, which is supposed to be executable.

You'll want to read

/usr/src/linux/Documentation/early-userspace/README

for the basics and then read

/usr/src/linux/Documentation/initrd.txt
(be careful to ignore the first part which is only initrd specific).

You can put anything you want into your initramfs. If it's just some
simple script that should be run, you're probably done with a
statically compiled "busybox" executable and /init being a shell
script. At the end of the script, you'll want to pivot_root into the
real root filesystem and maybe delete initramfs data afterwards.

I've never found really good documentation, but everything just works
as expected. There's really nothing special with initramfs.

Feel free to ask more questions here.

-hwh
-- 
gentoo-user@gentoo.org mailing list

Reply via email to