* [Buildroot] [OT] How to get rootfs.cpio combined with a kernel?
@ 2012-04-23 16:24 Grant Edwards
2012-04-27 20:12 ` Arnout Vandecappelle
0 siblings, 1 reply; 3+ messages in thread
From: Grant Edwards @ 2012-04-23 16:24 UTC (permalink / raw)
To: buildroot
I've been trying to figure out how to combined the rootfs.cpio created
by Buildroot with an externally built kernel, and I'm a little
stumped. The "standard" way to do it is to set
CONFIG_INITRAMFS_SOURCE to point to the cpio archive and have the
kernel build pull in the rootfs cpio archive when the kernel is built.
That works, but not a very good solution when it comes to
configuration management for a shipping project. I need to be able to
build and manage/version the kernel and rootfs as separate objects --
then combine the kernel and rootfs together into a single uImage file.
IOW, I'd like to do two _separate_ builds:
1) Build rootfs.cpio (using Buildroot).
2) Build vmlinux.o (not sure if that's the right file).
Those would both be controlled and versioned as separate objects.
Then I'd like to link those two files together and create a uImage
file from them.
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?
--
Grant Edwards grant.b.edwards Yow! ANN JILLIAN'S HAIR
at makes LONI ANDERSON'S
gmail.com HAIR look like RICARDO
MONTALBAN'S HAIR!
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [OT] How to get rootfs.cpio combined with a kernel?
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
2012-04-28 14:48 ` Grant Edwards
0 siblings, 1 reply; 3+ messages in thread
From: Arnout Vandecappelle @ 2012-04-27 20:12 UTC (permalink / raw)
To: buildroot
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [OT] How to get rootfs.cpio combined with a kernel?
2012-04-27 20:12 ` Arnout Vandecappelle
@ 2012-04-28 14:48 ` Grant Edwards
0 siblings, 0 replies; 3+ messages in thread
From: Grant Edwards @ 2012-04-28 14:48 UTC (permalink / raw)
To: buildroot
On 2012-04-27, Arnout Vandecappelle <arnout@mind.be> wrote:
> On Monday 23 April 2012 18:24:20 Grant Edwards wrote:
>>[...]
>>
>> 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.
That's pretty much what I had concluded.
> 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.
I was reluctant to do that because I wanted to distribute them as a
single uImage and store them in a single flash partition. But...
> If you're using U-Boot, you can even combine them in one uImage.
That's something I hadn't discovered, and I think that is the right
answer: build the kernel and rootfs separately, and then combine them
into a single uImage for installation in flash in booting by U-Boot.
I'll study the U-Boot docs...
Thanks!
--
Grant
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-28 14:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-04-28 14:48 ` Grant Edwards
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox