linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Tim Harvey <tharvey@gateworks.com>
Cc: Linux ARM Mailing List <linux-arm-kernel@lists.infradead.org>
Subject: Re: make modules_prepare failing
Date: Wed, 16 Jun 2021 20:55:29 +0100	[thread overview]
Message-ID: <20210616195529.GI22278@shell.armlinux.org.uk> (raw)
In-Reply-To: <CAJ+vNU1TfUOSc5Ot=xTKf+E+HF744LXdsB=5QNSxsvsm6zd59g@mail.gmail.com>

On Wed, Jun 16, 2021 at 12:35:16PM -0700, Tim Harvey wrote:
> Greetings,
> 
> I'm trying to understand how to use the 'modules_prepare' target to
> prepare kernel headers on a dev host appropriate for building
> out-of-tree modules on a target board. I'm interested in the minimum
> headers necessary and have noticed the Ubuntu 'linux-headers-*'
> packages are only about 24MiB.
> 
> I've looked over
> https://www.kernel.org/doc/Documentation/kbuild/modules.txt and it
> does not provide an example showing how to build the headers in a
> different directory.
> 
> $ make O=foo modules_prepare
> make[1]: Entering directory '/usr/src/venice/bsp/linux/foo'
> ***
> *** The source tree is not clean, please run 'make mrproper'
> *** in /usr/src/venice/bsp/linux
> ***
> /usr/src/venice/bsp/linux/Makefile:512: recipe for target
> 'outputmakefile' failed
> make[1]: *** [outputmakefile] Error 1
> make[1]: Leaving directory '/usr/src/venice/bsp/linux/foo'
> Makefile:179: recipe for target 'sub-make' failed
> make: *** [sub-make] Error 2

This means your tree (/usr/src/venice/bsp/linux) is not clean, it
is not referring to "foo". It is only possible to do a split source/
object tree build with a clean source tree.

So, this is telling you to do "make mrproper" with nothing else in
the source directory - no O= argument. If that is still failing,
then it suggests there is a file somewhere in the source tree that
shouldn't be there.

> The 'modules_prepare' does work if I don't try to output to a
> different directory but then it isn't clear what to package compared
> to the entire >1GiB kernel source tree.

I'm not sure you're going about this in the correct way. Doing a
split object tree build does not mean everything you need to build
modules is in the object tree - much depends on the source tree for
the kernel build infrastructure and the other header files in the
include subdirectory, as well as other places (such as picking up
architecture options from arch/*/Makefile and the architecture
specific header files.)

So, if you are thinking "I can just package up the object tree to
build modules" that is not correct.

> I wish https://www.kernel.org/doc/Documentation/kbuild/modules.txt had
> an example expalining how a distro packager would create
> linux-headers-<foo>. I'm not familiar enough with Ubuntu packaging to
> understand how to disect how their packages are created.

Isn't that package used for building the C library rather than for
modules? That will likely be created by "make headers_install" which
gives you all the headers for userspace to use with kernel internals
sanitised away.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-06-16 19:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 19:35 make modules_prepare failing Tim Harvey
2021-06-16 19:55 ` Russell King (Oracle) [this message]
2021-06-16 20:21   ` Tim Harvey
2021-06-16 20:37     ` Russell King (Oracle)

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=20210616195529.GI22278@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=tharvey@gateworks.com \
    /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;
as well as URLs for NNTP newsgroup(s).