From: tobias@gambas-buch.de (Tobias Boege)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Question on initrd and initramfs
Date: Sat, 29 Sep 2012 20:10:17 +0200 [thread overview]
Message-ID: <20120929181017.GC523@aurora> (raw)
In-Reply-To: <CAGdaadbJYWYvL7cs0aRjaRPGGUSgZ5ipsSo5w0Dyh+n2BAtfrg@mail.gmail.com>
On Sun, 30 Sep 2012, Mulyadi Santosa wrote:
> Hi...
>
> On Fri, Sep 28, 2012 at 5:56 PM, Ezequiel Garcia <elezegarcia@gmail.com> wrote:
> > Please note that the image you give qemu (or bootloader)
> > to use as initrd is *not* formatted using any mkfs.
> > It's just created with:
> >
> > $ find . | cpio -H newc -o > ../initramfs.cpio
>
> Yup I am aware of that :)
>
> > And the compiled kernel has no support for *any* filesystem.
> > So, the question is: how are those files formatted?
>
> Now that's something I can't answer definitively. I just guess that,
> somewhere inside kernel code, there is certain code that can't be
> toggled on or off i.e it is always enabled. And that code, one of
> them, is tackling this initramfs unpacking.
>
> > (Guess the answer is: look at the code)
>
> Eventually...well, yes :)
>
Have you read Documentation/filesystems/ramfs-rootfs-initramfs.txt? I didn't
but there are some eye-catching statements:
1. initramfs becomes a rootfs (l. 86)
2. rootfs is a special instance of ramfs (l. 73)
3. ramfs cannot be turned off (l. 29ff)
This means that initramfs cannot be turned off.
4. initramfs is a gzipped cpio archive and contained within the kernel
(l. 85) and so is the cpio extractor code (l. 166f)
5. initramfs is automatically loaded as rootfs (l. 86)
Consequently, all that is essential to the kernel. Or not?
You may want to continue l. 95ff where it goes about filesystems.
Code is (at least) in init/initramfs.c. Please, CMIIW.
Regards,
Tobi
next prev parent reply other threads:[~2012-09-29 18:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-27 16:57 Question on initrd and initramfs Ezequiel Garcia
2012-09-27 17:43 ` Autif Khan
2012-09-27 18:44 ` Ezequiel Garcia
2012-09-28 10:53 ` Ezequiel Garcia
2012-09-28 11:11 ` Ezequiel Garcia
2012-09-28 0:58 ` Mulyadi Santosa
2012-09-28 10:56 ` Ezequiel Garcia
2012-09-29 17:27 ` Mulyadi Santosa
2012-09-29 17:39 ` Ezequiel Garcia
2012-09-29 18:10 ` Tobias Boege [this message]
2012-09-30 8:01 ` Mulyadi Santosa
2012-10-05 19:25 ` Ezequiel Garcia
2012-10-07 0:36 ` Mulyadi Santosa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120929181017.GC523@aurora \
--to=tobias@gambas-buch.de \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).