All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] update-linux-headers.sh fails on clean kernel dir
@ 2017-01-24  4:39 Sam Bobroff
  2017-01-24 10:32 ` Marc-André Lureau
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Bobroff @ 2017-01-24  4:39 UTC (permalink / raw)
  To: qemu-devel

Hi QEMU developers,

If I run scripts/update-linux-headers.sh from a clean checkout of QEMU
and point it at a clean checkout of a recent linux kernel (4.10-rc1 or
later), it fails:

$ scripts/update-linux-headers.sh ~/tmp/linux/

...

scripts/Makefile.headersinst:62: *** Missing generated UAPI file ./arch/arm/include/generated/uapi/asm/unistd-common.h.  Stop.

This seems to be because the script passes the arch to the kernel
makefile using "SRCARCH" rather than "ARCH".

(SRCARCH seems to be intended as an internal value, and setting it does
not propagate the setting to ARCH. Because ARCH is left empty, the
prerequisites that should generate unistd-common.h fail. If ARCH is set,
SRCARCH is set automatically and everything works.)

Changing the script to use "ARCH" seems to fixe the problem.

(Note: when testing this be careful: unistd-common.h is not removed by
"make clean" in the kernel directory.)

Does this seem correct?

Should I send a patch even though it's a very small change?

Cheers,
Sam.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] update-linux-headers.sh fails on clean kernel dir
  2017-01-24  4:39 [Qemu-devel] update-linux-headers.sh fails on clean kernel dir Sam Bobroff
@ 2017-01-24 10:32 ` Marc-André Lureau
  2017-01-25  0:25   ` Sam Bobroff
  0 siblings, 1 reply; 3+ messages in thread
From: Marc-André Lureau @ 2017-01-24 10:32 UTC (permalink / raw)
  To: Sam Bobroff, qemu-devel

Hi

On Tue, Jan 24, 2017 at 8:41 AM Sam Bobroff <sam.bobroff@au1.ibm.com> wrote:

> Hi QEMU developers,
>
> If I run scripts/update-linux-headers.sh from a clean checkout of QEMU
> and point it at a clean checkout of a recent linux kernel (4.10-rc1 or
> later), it fails:
>
> $ scripts/update-linux-headers.sh ~/tmp/linux/
>
> ...
>
> scripts/Makefile.headersinst:62: *** Missing generated UAPI file
> ./arch/arm/include/generated/uapi/asm/unistd-common.h.  Stop.
>
> This seems to be because the script passes the arch to the kernel
> makefile using "SRCARCH" rather than "ARCH".
>
> (SRCARCH seems to be intended as an internal value, and setting it does
> not propagate the setting to ARCH. Because ARCH is left empty, the
> prerequisites that should generate unistd-common.h fail. If ARCH is set,
> SRCARCH is set automatically and everything works.)
>
> Changing the script to use "ARCH" seems to fixe the problem.
>

That's also what Documentation/kbuild/headers_install.txt documents.


> (Note: when testing this be careful: unistd-common.h is not removed by
> "make clean" in the kernel directory.)
>
> Does this seem correct?
>
> Should I send a patch even though it's a very small change?
>
>
I think so, thanks

> Cheers,
> Sam.
>
>
> --
Marc-André Lureau

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] update-linux-headers.sh fails on clean kernel dir
  2017-01-24 10:32 ` Marc-André Lureau
@ 2017-01-25  0:25   ` Sam Bobroff
  0 siblings, 0 replies; 3+ messages in thread
From: Sam Bobroff @ 2017-01-25  0:25 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: qemu-devel

On Tue, Jan 24, 2017 at 10:32:36AM +0000, Marc-André Lureau wrote:
> Hi
> 
> On Tue, Jan 24, 2017 at 8:41 AM Sam Bobroff <sam.bobroff@au1.ibm.com> wrote:
> 
> > Hi QEMU developers,
> >
> > If I run scripts/update-linux-headers.sh from a clean checkout of QEMU
> > and point it at a clean checkout of a recent linux kernel (4.10-rc1 or
> > later), it fails:
> >
> > $ scripts/update-linux-headers.sh ~/tmp/linux/
> >
> > ...
> >
> > scripts/Makefile.headersinst:62: *** Missing generated UAPI file
> > ./arch/arm/include/generated/uapi/asm/unistd-common.h.  Stop.
> >
> > This seems to be because the script passes the arch to the kernel
> > makefile using "SRCARCH" rather than "ARCH".
> >
> > (SRCARCH seems to be intended as an internal value, and setting it does
> > not propagate the setting to ARCH. Because ARCH is left empty, the
> > prerequisites that should generate unistd-common.h fail. If ARCH is set,
> > SRCARCH is set automatically and everything works.)
> >
> > Changing the script to use "ARCH" seems to fixe the problem.
> >
> 
> That's also what Documentation/kbuild/headers_install.txt documents.
> 
> 
> > (Note: when testing this be careful: unistd-common.h is not removed by
> > "make clean" in the kernel directory.)
> >
> > Does this seem correct?
> >
> > Should I send a patch even though it's a very small change?
> >
> >
> I think so, thanks

Thanks for the quick answer, I'll post a patch ASAP.

Perhaps you wouldn't mind commenting on this followup issue, since that
fix isn't enough to get the script working nicely...

With that fixed, update-linux-headers.sh still doesn't work as I would
expect. It seems that since commit
7e71da7f124fc47a2f2bc1fbfb32f0e8ee3e7d44
QEMU makes use of virtio_mmio.h but that file isn't installed by the
kernel's "install_headers" target so running update-linux-headers.sh
causes virtio_mmio.h to be deleted from the QEMU source rather than
updated.

(It looks like virtio_mmio.h was manually added by commit
5878b13642ddf8da44186ef93ac91319ff53668b )

It looks like the reason virtio_mmio.h isn't installed is that it's not
a uapi header and the reason this causes the deletion is that the file
has been placed in include/standard-headers/...

So, it seems there are several possible approaches:
(1) Move QEMU's copy of the file out of standard-headers.
(2) Ask the kernel to make virtio_mmio.h a uapi header.
(3) Change update-linux-headers.sh to manually copy that file.
(4) Manually copy that file in after running the script.

(1) seems to be the easiest to me, and (2) possibly the cleanest, but
what would you recommend? Should I try posting a patch for this too?

Thanks,
Sam.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-25  0:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-24  4:39 [Qemu-devel] update-linux-headers.sh fails on clean kernel dir Sam Bobroff
2017-01-24 10:32 ` Marc-André Lureau
2017-01-25  0:25   ` Sam Bobroff

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.