From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [OT] How to get rootfs.cpio combined with a kernel?
Date: Fri, 27 Apr 2012 22:12:07 +0200 [thread overview]
Message-ID: <201204272212.07280.arnout@mind.be> (raw)
In-Reply-To: <jn3vnk$go5$1@dough.gmane.org>
On Monday 23 April 2012 18:24:20 Grant Edwards wrote:
> I've been browsing around Linux kernel Makefiles and docs, trying to
> figure out what the "pre-rootfs" file is and how to combine it with
> the rootfs to produce the uImage file. There's plenty of info about
> how to specify or create an initramfs and the actual kernel startup
> works, but all I can find about how to actually link the kernel and
> initramfs together is "set CONFIG_INITRAMFS_SOURCE and do a kernel
> build".
>
> Having to re-compile the kernel when nothing in the kernel or it's
> configuration has changed (only the rootfs changed) just doesn't feel
> like an acceptable engineering practice.
>
> Any pointers to documentation on how one might combine a kernel object
> and a rootfs cpio image to get a uImage file?
Short answer: the kernel build system doesn't support it.
Long answer: the initramfs is compiled into one of the many builtin.o
files that are created all over the place. This is linked into vmlinux.
See "Build vmlinux" in the top-level Makefile of the kernel.
The good thing is that the command to build vmlinux is stored in
.vmlinux.cmd, so you can use that to re-run the link - but you'd have
to keep all the individual built-in.o files of course. The bad
thing, however, is that this is not the end. You probably want to
create a bzImage or similar, which is an additional, architecture-specific
linking step.
Conclusion: unless you're willing to spend a lot of effort on this,
you're better off to either keep the compiled kernel tree for linking
with the rootfs, or using a separate kernel and rootfs image. If you're
using U-Boot, you can even combine them in one uImage.
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
next prev parent reply other threads:[~2012-04-27 20:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 16:24 [Buildroot] [OT] How to get rootfs.cpio combined with a kernel? Grant Edwards
2012-04-27 20:12 ` Arnout Vandecappelle [this message]
2012-04-28 14:48 ` Grant Edwards
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=201204272212.07280.arnout@mind.be \
--to=arnout@mind.be \
--cc=buildroot@busybox.net \
/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