* [Buildroot] [bug] bootwrapper runs before linking initrd
@ 2015-09-03 22:00 Hollis Blanchard
2015-09-04 8:54 ` Thomas Petazzoni
0 siblings, 1 reply; 5+ messages in thread
From: Hollis Blanchard @ 2015-09-03 22:00 UTC (permalink / raw)
To: buildroot
I have a BR config that includes the following:
BR2_LINUX_KERNEL=y
BR2_TARGET_ROOTFS_INITRAMFS=y
BR2_TARGET_BOOT_WRAPPER_AARCH64=y
I expect that Buildroot will:
1. build the kernel
2. build rootfs.cpio
3. link rootfs.cpio into the kernel as an initrd
4. run boot-wrapper-aarch64 on the kernel+initrd
When I do a build, however, I can clearly see that step 4 happens before
step 3. In fact, "Rebuilding kernel with initramfs" is the very last
step of the build. "boot-wrapper-aarch64 Installing to images directory"
happened much earlier.
(Side note: the error is far more catastrophic than a simple "couldn't
find root filesystem" panic; it looks like big chunks of the kernel's
data section are zeroed, so that kernel messages aren't even logged, to
say nothing of no serial output. I don't know why this is.)
A workaround is to remember to manually "make
boot-wrapper-aarch64-rebuild" after a regular build has completed.
What's the real solution? Thanks!
--
Hollis Blanchard
Mentor Graphics Emulation Division
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [bug] bootwrapper runs before linking initrd
2015-09-03 22:00 [Buildroot] [bug] bootwrapper runs before linking initrd Hollis Blanchard
@ 2015-09-04 8:54 ` Thomas Petazzoni
2015-09-04 9:51 ` Peter Korsgaard
2015-09-04 19:52 ` Arnout Vandecappelle
0 siblings, 2 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2015-09-04 8:54 UTC (permalink / raw)
To: buildroot
Hollis,
On Thu, 3 Sep 2015 15:00:49 -0700, Hollis Blanchard wrote:
> I have a BR config that includes the following:
> BR2_LINUX_KERNEL=y
> BR2_TARGET_ROOTFS_INITRAMFS=y
> BR2_TARGET_BOOT_WRAPPER_AARCH64=y
Yes, this is not working right now.
> I expect that Buildroot will:
>
> 1. build the kernel
> 2. build rootfs.cpio
> 3. link rootfs.cpio into the kernel as an initrd
> 4. run boot-wrapper-aarch64 on the kernel+initrd
>
> When I do a build, however, I can clearly see that step 4 happens before
> step 3. In fact, "Rebuilding kernel with initramfs" is the very last
> step of the build. "boot-wrapper-aarch64 Installing to images directory"
> happened much earlier.
>
> (Side note: the error is far more catastrophic than a simple "couldn't
> find root filesystem" panic; it looks like big chunks of the kernel's
> data section are zeroed, so that kernel messages aren't even logged, to
> say nothing of no serial output. I don't know why this is.)
>
> A workaround is to remember to manually "make
> boot-wrapper-aarch64-rebuild" after a regular build has completed.
>
> What's the real solution? Thanks!
See http://lists.busybox.net/pipermail/buildroot/2014-July/101052.html
for a possible solution. I remember we discussed this patch during the
Buildroot Summer camp, but I thought we had sent some comments for
Jeremy to improve the patch. But it seems it wasn't done. Arnout, do
you remember the conclusion of our discussion?
I must say I'm not thrilled by making such major changes to Buildroot
just for the sake of this very specific use-case. But we probably don't
have much choice.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [bug] bootwrapper runs before linking initrd
2015-09-04 8:54 ` Thomas Petazzoni
@ 2015-09-04 9:51 ` Peter Korsgaard
2015-09-04 10:39 ` Thomas Petazzoni
2015-09-04 19:52 ` Arnout Vandecappelle
1 sibling, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2015-09-04 9:51 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
Hi,
> See http://lists.busybox.net/pipermail/buildroot/2014-July/101052.html
> for a possible solution. I remember we discussed this patch during the
> Buildroot Summer camp, but I thought we had sent some comments for
> Jeremy to improve the patch. But it seems it wasn't done. Arnout, do
> you remember the conclusion of our discussion?
> I must say I'm not thrilled by making such major changes to Buildroot
> just for the sake of this very specific use-case. But we probably don't
> have much choice.
I don't know any details of this boot wrapper, but perhaps we could
change the package to only build the host tool and simply ask people to
write a post-image script to invoke it with the correct arguments once
the build is completely done, similar to what we do for other custom
"post processing" tasks?
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [bug] bootwrapper runs before linking initrd
2015-09-04 9:51 ` Peter Korsgaard
@ 2015-09-04 10:39 ` Thomas Petazzoni
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2015-09-04 10:39 UTC (permalink / raw)
To: buildroot
Dear Peter Korsgaard,
On Fri, 04 Sep 2015 11:51:33 +0200, Peter Korsgaard wrote:
> > I must say I'm not thrilled by making such major changes to Buildroot
> > just for the sake of this very specific use-case. But we probably don't
> > have much choice.
>
> I don't know any details of this boot wrapper, but perhaps we could
> change the package to only build the host tool and simply ask people to
> write a post-image script to invoke it with the correct arguments once
> the build is completely done, similar to what we do for other custom
> "post processing" tasks?
Doesn't work: the kernel image is *linked* into the boot wrapper. So
really, it's not just a post-processing tool, you need the kernel image
to build the wrapper.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Buildroot] [bug] bootwrapper runs before linking initrd
2015-09-04 8:54 ` Thomas Petazzoni
2015-09-04 9:51 ` Peter Korsgaard
@ 2015-09-04 19:52 ` Arnout Vandecappelle
1 sibling, 0 replies; 5+ messages in thread
From: Arnout Vandecappelle @ 2015-09-04 19:52 UTC (permalink / raw)
To: buildroot
[Adding Jeremy Kerr in CC - he's the author of
http://patchwork.ozlabs.org/patch/366549/ ]
On 04-09-15 10:54, Thomas Petazzoni wrote:
> Hollis,
>
> On Thu, 3 Sep 2015 15:00:49 -0700, Hollis Blanchard wrote:
>> I have a BR config that includes the following:
>> BR2_LINUX_KERNEL=y
>> BR2_TARGET_ROOTFS_INITRAMFS=y
>> BR2_TARGET_BOOT_WRAPPER_AARCH64=y
>
> Yes, this is not working right now.
[snip]
>> What's the real solution? Thanks!
>
> See http://lists.busybox.net/pipermail/buildroot/2014-July/101052.html
> for a possible solution. I remember we discussed this patch during the
> Buildroot Summer camp, but I thought we had sent some comments for
> Jeremy to improve the patch. But it seems it wasn't done. Arnout, do
> you remember the conclusion of our discussion?
I did send it:
http://lists.busybox.net/pipermail/buildroot/2015-July/132686.html
(mailmain/pipermail threading sucks)
TL;DR:
It was a long discussion, mainly because it doesn't really solve the problem
(which BTW is mainly in the approach we take for linux-with-initramfs - that's
just a huge hack).
That said, we basically agree with the approach. So if you're stilling willing
to do it, please post a full series including the change to
boot-wrapper-aarch64, taking into account the comments below. We've marked this
patch as Changes Requested in patchwork.
_However_, I may have an idea for an alternative approach that confines the
hack to boot-wrapper-aarch64 itself. The following may work:
boot-wrapper-aarch64-rebuild-with-initramfs: linux-rebuild-with-initramfs
$(TARGET_MAKE_ENV) $(MAKE) -C $(BOOT_WRAPPER_AARCH64_SRCDIR)
cp $(BOOT_WRAPPER_AARCH64_SRCDIR)/linux-system.axf $(BINARIES_DIR)
ROOTFS_INITRAMFS_POST_TARGETS += boot-wrapper-aarch64-rebuild-with-initramfs
I.e., rerun the build and install commands as part of the rootfs-initramfs build
step. Note that no conditions are needed, since this target will anyway only
come into play when rootfs-initramfs is built.
Can someone give that a try and post a patch?
Regards,
Arnout
>
> I must say I'm not thrilled by making such major changes to Buildroot
> just for the sake of this very specific use-case. But we probably don't
> have much choice.
>
> Thomas
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
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: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-09-04 19:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-03 22:00 [Buildroot] [bug] bootwrapper runs before linking initrd Hollis Blanchard
2015-09-04 8:54 ` Thomas Petazzoni
2015-09-04 9:51 ` Peter Korsgaard
2015-09-04 10:39 ` Thomas Petazzoni
2015-09-04 19:52 ` Arnout Vandecappelle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox