[klibc] Query regarding initramfs

Andreas Jellinhaus aj at ciphirelabs.com
Mon Feb 14 03:39:04 PST 2005

On Mon, 2005-02-14 at 15:54 +0530, Rachita Kothiyal wrote:
> I had some doubts regarding what all the init application should do:
> >> so, that should that application do?
> >>  - mount /dev/hda1 /new-root
> >>  - cd /new-root
> >>  - run-init
> 1. Of what I understand, before exitting, init should mount the realroot
> and execute the init process.
>     Is realroot the '/' or the empty directory created (in the cpio
> archive) ?

initramfs has / as root. the real root (i.e. the root for your real
system) is whatever you mount whereever you mount it. 
above commands mount "/dev/hda1" to the empty directory "/new-root".

>     How should I go about it? Using pivot_root, chroot ...? Am  not very
> clear with these.

no, use "run-init", it is an utility program included in klibc.

> 2. At the time init(from initrmafs) is called, is there any file system
> mounted?

yes, / is a tmpfs and the content are the files that where in the
initramfs cpio. unlike initrd this initramfs is writeable, so you
can do any changes and create any number of new files (up to your ram

also unlike initrd - as far as I know - there is no size contraint.
I have some 8+ MB initramfs based on glibc and they work fine.

Good luck!


---------------------[ Ciphire Signature ]----------------------
From: aj at ciphirelabs.com signed email body (987 characters)
Date: on 14 February 2005 at 11:39:12 UTC
To:   rachitako at in.ibm.com, klibc at zytor.com
: Ciphire has secured this email against identity theft.
: Free download at www.ciphire.com. The garbled lines
: below are the sender's verifiable digital signature.
------------------[ End Ciphire Signed Message ]----------------

More information about the klibc mailing list