[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMj1kXGzSK0YxdiGsK9b4ph8dqt08fXFQkWYBg9VFerSwowZUg@mail.gmail.com>
Date: Fri, 18 Apr 2025 09:05:10 +0200
From: Ard Biesheuvel <ardb@...nel.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: Dave Hansen <dave.hansen@...el.com>, linux-kernel@...r.kernel.org,
linux-tip-commits@...r.kernel.org, "H. Peter Anvin" <hpa@...or.com>,
Ian Campbell <ijc@...lion.org.uk>, Linus Torvalds <torvalds@...ux-foundation.org>, x86@...nel.org
Subject: Re: [tip: x86/build] x86/boot: Drop CRC-32 checksum and the build
tool that generates it
On Sat, 12 Apr 2025 at 10:48, Ingo Molnar <mingo@...nel.org> wrote:
>
>
> * Dave Hansen <dave.hansen@...el.com> wrote:
>
> > On 4/11/25 12:33, Dave Hansen wrote:
> > ...
> > > The only weird thing I'm doing is booting the kernel with qemu's -kernel
> > > argument.
> >
> > I lied. I'm doing other weird things. I have a local script named
> > "truncate" that's not the same thing as /usr/bin/truncate. Guess what
> > this patch started doing:
> >
> > > quiet_cmd_image = BUILD $@
> > > -silent_redirect_image = >/dev/null
> > > -cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
> > > - $(obj)/zoffset.h $@ $($(quiet)redirect_image)
> > > + cmd_image = cp $< $@; truncate -s %4K $@; cat $(obj)/vmlinux.bin >>$@
> >
> > ^ right there
>
> Oh that sucks ...
>
> > I'm an idiot. That was a poorly named script and it cost me a kernel
> > bisect and poking at the patch for an hour. <sigh>
> >
> > Sorry for the noise.
>
> I feel your pain, I too once overlaid a well-known utility with my own
> script in ~/bin/. After that incident I started adding the .sh postfix
> to my own scripts, that way there's a much lower chance of namespace
> collisions.
>
There was another report about this, but in that case, the problem was
that busybox's truncate clone does not understand the % notation (even
though the very first original truncate version that I found from 2008
already supported that)
In any case, we might change this to
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -59,7 +59,7 @@
$(obj)/bzImage: asflags-y := $(SVGA_MODE)
quiet_cmd_image = BUILD $@
- cmd_image = cp $< $@; truncate -s %4K $@; cat $(obj)/vmlinux.bin >>$@
+ cmd_image = (dd if=$< bs=4096 conv=sync status=none; cat
$(obj)/vmlinux.bin) >$@
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin FORCE
$(call if_changed,image)
which is slightly cleaner - I'll send out a patch once I receive
confirmation that busybox dd implements conv=sync (which takes care of
the padding) correctly.
Powered by blists - more mailing lists