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,SPF_PASS,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 EFA2DC48BE6 for ; Wed, 16 Jun 2021 19:57:11 +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 B7FAA61375 for ; Wed, 16 Jun 2021 19:57:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7FAA61375 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=KXR8TVKoFo53olEhGDNF9WubRz7RhS7zNxZPv1s4oz8=; b=Kas8ResrwpwJkc FbkokFD3QJFnbAm7qUXo5AT8XqOUqQI+6AngJ8yZtyzf2nCy1F4oIfEuXfx1IqUhntx9K2/V/pZzf V6WOEeYXqdjpT6eRbVsWfeiXPsZpPAOki2Qy0bN5NyzMCw87KNPR+sMPSB/YUVx8ezhSaWkb9xy79 OV4/f0uqPMKJY76Gr4u0CH64gI3GxRiqsPEteKKiqTrrPga305qNod3662GoDKmo6liL2tiCN+eMB 2N61RbXnKfMk6G+0g82BzwFmH/D2/SKy96TK1QUgDozlXRSHC+/nOyp39epfLacr6+RuU9Yd1nS6a LGZMtwUNCqkZlZR9s8Mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltbdQ-007cJv-Ih; Wed, 16 Jun 2021 19:55:36 +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 1ltbdM-007cJR-SQ for linux-arm-kernel@lists.infradead.org; Wed, 16 Jun 2021 19:55:34 +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=TmX5RnPbPlOYRkZZeV+gm1TIk2SrQO/ZIf7kvR5ZJ1A=; b=G60oYHWce7Oml04VY70kHN2ko 8985OQRMUc9wsvNVdbVnxP/3Y9k527juaMANTEV/I4f+pvQX0U3rKIgci0hMFgmZcGX2nj6n5zawV M6aHVxx49WOMo6q1OJgx5PiZMk/1fRqVcdqdHhGAT8sOL9v1sfdP3nXLVAkS11JFBb9TXDokhCWsc 2LkxjzisQUtjG0kROIVHLQEzTU1UwMuXRks+3RKOmS4fExMwPu050t7CRv+rQRAyHUAN/E6H/z112 Gr2oN6unOV/ZjjzIsTpVVJJduYVREiOqMrYNAokrbFjQR1kSJqoDGsL/1uLUy+uf18Wgx9easNam1 X+0QCx7ZA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45084) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltbdK-0007nR-Dt; Wed, 16 Jun 2021 20:55:30 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1ltbdJ-0006K9-Om; Wed, 16 Jun 2021 20:55:29 +0100 Date: Wed, 16 Jun 2021 20:55:29 +0100 From: "Russell King (Oracle)" To: Tim Harvey Cc: Linux ARM Mailing List Subject: Re: make modules_prepare failing Message-ID: <20210616195529.GI22278@shell.armlinux.org.uk> References: 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_125533_103571_81B3A414 X-CRM114-Status: GOOD ( 27.99 ) 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 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. -- 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