From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EBB6C48BE5 for ; Wed, 16 Jun 2021 20:39:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2877460E0C for ; Wed, 16 Jun 2021 20:39:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2877460E0C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6C8QKgpX5FC6oZMwCNmbNX8DlV6Fv1sy5NKCWNwkx7Y=; b=bzN3r3dpwsfzic EqmZtEg6/Dby8FVXmNHV7R80LBnG3R7mdYR/M5Sm3OZAgDUyDTOlOeSn73QF6b+ueqGZ1pIbEKX+5 oixpunRL1PotXBw3ai4MUD2kMV5VLU0OgIHg10kr8LvBIeyG61MzcNTJgel0AJ2TaaMxm1HVblk+z OOLQS0hYkmBOqZ7twzAA50Pz5EBqyt9AT/qDZ+OQaRPmRyfZYe9A9NAgW8LGS0LiXLAnEf0DK4t7r KdFOkKVy7syH4Z58piU9+yNpLSZ0PFGl/xKg7mOIpiGGnF9jsBdWyzckO81ATwQmiuL9HO9TgjCgC byJX3WgvpRW3weJK679A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltcI6-007fyS-1V; Wed, 16 Jun 2021 20:37:38 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltcI2-007fxg-B5 for linux-arm-kernel@lists.infradead.org; Wed, 16 Jun 2021 20:37:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Yr7s40blvYnH5DPxe1o7l7xYHf6o16YpNSFzjqJyFQs=; b=dXR9wiDJxfv873y0AABAbZeqr Cx2FU/2cG4ZTb6mSjS71k9H9z86rd/zqbpJ9UCnxxNvRguMbamW/K4WoIfLcm9fsc7+xa1IWeUfbR yv9Vl3L+T5/f4g8hsprbDT7tIL8Ngddw3ouIqYKYMC2Nj3v8BXRJ/WR9b/7N41gYzUUwGz6Ov1ZT9 d7f8fZgZEngOR8XqN+BR3pp5cGzbjdvXuFPLWN0NWqOnvXPlOXll9pgSdEVm7fiK2fHuLi8DgsCJL fwligSkygX1Gkch0jGDasvj9akf+4q5M+P3xAosb2WbcMebmrPaJ3tMPE0qLPos1JvrDPUMWPnoX4 sbP9D8F8g==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45086) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltcI0-0007oo-LB; Wed, 16 Jun 2021 21:37:32 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1ltcI0-0006LJ-9O; Wed, 16 Jun 2021 21:37:32 +0100 Date: Wed, 16 Jun 2021 21:37:32 +0100 From: "Russell King (Oracle)" To: Tim Harvey Cc: Linux ARM Mailing List Subject: Re: make modules_prepare failing Message-ID: <20210616203732.GJ22278@shell.armlinux.org.uk> References: <20210616195529.GI22278@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210616_133734_417077_20DC3DE4 X-CRM114-Status: GOOD ( 44.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 16, 2021 at 01:21:36PM -0700, Tim Harvey wrote: > On Wed, Jun 16, 2021 at 12:55 PM Russell King (Oracle) > wrote: > > > > 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-. 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. > > Russell, > > Thanks for the response. > > I thought that Ubuntu's linux-headers-* package also provided enough > to build out of tree modules but perhaps I'm wrong. Here is what I did > to try and figure out what was in the linux-headers file on an Ubuntu > bionic system: Maybe it does - I don't use it, so I don't really know. If you do want to see how ubuntu creates the package, you could grab the source for the package and look at how they build it - that's what I would do. Of course, such a source package would mean downloading the entire kernel source tarball. You'll also have to look at disabling other stuff that ubuntu builds (like the kernel binary packages themselves.) -- 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