From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 28 Mar 2024 16:04:22 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rprIk-009Xo8-0q for lore@lore.pengutronix.de; Thu, 28 Mar 2024 16:04:22 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rprIj-0006XX-MQ; Thu, 28 Mar 2024 16:04:21 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rprIQ-0006TM-L0; Thu, 28 Mar 2024 16:04:02 +0100 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rprIQ-0091mc-2I; Thu, 28 Mar 2024 16:04:02 +0100 Received: from mol by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rprIP-003Duz-3A; Thu, 28 Mar 2024 16:04:01 +0100 Date: Thu, 28 Mar 2024 16:04:01 +0100 From: Michael Olbrich To: Ian Abbott Message-ID: Mail-Followup-To: Ian Abbott , ptxdist@pengutronix.de References: <4cfc5e0b-86fd-452d-8f1d-ea8a109673f1@mev.co.uk> <85d8e9a2-60fc-45cf-87e0-ffabf1508baf@mev.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <85d8e9a2-60fc-45cf-87e0-ffabf1508baf@mev.co.uk> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain Subject: Re: [ptxdist] Getting error 'kernel' must depend on 'host-system-python3' for 'python3'! X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false On Thu, Mar 28, 2024 at 10:59:43AM +0000, Ian Abbott wrote: > On 28/03/2024 08:10, Michael Olbrich wrote: > > On Wed, Mar 27, 2024 at 05:17:21PM +0000, Ian Abbott wrote: > > > I'm getting this error when trying to build a kernel that has "Kernel > > > hacking > Compile-time checks and compiler options > Generate BTF typeinfo > > > (DEBUG_INFO_BTF)" enabled in the configuration: > > > > > > -------------------------------------------------------------------- > > > ---------------------- > > > target: kernel.compile > > > ---------------------- > > > > > > make: Entering directory '/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21' > > > make[1]: Entering directory '/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21-build' > > > GEN Makefile > > > DESCEND bpf/resolve_btfids > > > CALL /mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21/scripts/checksyscalls.sh > > > GEN /mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21-build/tools/bpf/resolve_btfids/libbpf/bpf_helper_defs.h > > > INSTALL libsubcmd_headers > > > > > > 'kernel' must depend on 'host-system-python3' for 'python3'! > > > > > > make[5]: *** [Makefile:160: /mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21-build/tools/bpf/resolve_btfids/libbpf/bpf_helper_defs.h] > > > Error 1 > > > make[5]: *** Deleting file '/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21-build/tools/bpf/resolve_btfids/libbpf/bpf_helper_defs.h' > > > make[4]: *** [Makefile:63: /mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21-build/tools/bpf/resolve_btfids//libbpf/libbpf.a] > > > Error 2 > > > make[4]: *** Waiting for unfinished jobs.... > > > make[3]: *** [Makefile:76: bpf/resolve_btfids] Error 2 > > > make[2]: *** [/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21/Makefile:1355: > > > tools/bpf/resolve_btfids] Error 2 > > > make[1]: *** [/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21/Makefile:234: > > > __sub-make] Error 2 > > > make[1]: Leaving directory '/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21-build' > > > make: *** [Makefile:234: __sub-make] Error 2 > > > make: Leaving directory '/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21' > > > make: *** [/mnt/lindata/work/abbotti/ptxdist/ptxdist/ptxdist_git/ptxdist/rules/kernel.make:251: /home/abbotti/work/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/state/kernel.compile] > > > Error 2 > > > -------------------------------------------------------------------- > > > > > > I could live without it. It is required for RestrictFileSystems= in systemd > > > service units according to > > > . But is there an easy > > > fix? > > > > Put this in "platforms/kernel.fixup.in" in your BSP: > > ------------------------------->8---------------------------- > > ## SECTION=base_kernel > > > > config KERNEL > > select HOST_SYSTEM_PYTHON3 > > > > ------------------------------->8---------------------------- > > > > > I'm currently using ptxdist 2024.03.0 but is also reproducible on the > > > ptxdist master branch. > > > > We should add that dependency Upstream as well. Something like > > > > config KERNEL_PYTHON3 > > prompt "ensure Python3 is available" > > bool > > help > > Python3 is needed at build-time when CONFIG_DEBUG_INFO_BTF is > > enabled. > > Thanks. I combined the two and added the following to > "platforms/kernel.fixup.in" in my BSP: > > ------------------------------->8---------------------------- > ## SECTION=base_kernel > > config KERNEL > select HOST_SYSTEM_PYTHON3 if KERNEL_PYTHON3 > > config KERNEL_PYTHON3 > prompt "ensure Python3 is available" > bool > select HOST_SYSTEM_PYTHON3 > help > Python3 is needed at build-time when CONFIG_DEBUG_INFO is > enabled > ------------------------------->8---------------------------- > > Then I enabled KERNEL_PYTHON3 in my platformconfig. > > The kernel build gets further than before, but stops here: > > ------------------------------->8---------------------------- > ---------------------- > target: kernel.compile > ---------------------- > > make: Entering directory '/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21' > make[1]: Entering directory '/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21-build' > GEN Makefile > DESCEND bpf/resolve_btfids > CALL /mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21/scripts/checksyscalls.sh > INSTALL libsubcmd_headers > UPD include/generated/utsversion.h > CC init/version-timestamp.o > BTF: .tmp_vmlinux.btf: pahole (false) is not available > Failed to generate BTF for vmlinux > Try to disable CONFIG_DEBUG_INFO_BTF > make[3]: *** [/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21/scripts/Makefile.vmlinux:37: > vmlinux] Error 1 > make[2]: *** [/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21/Makefile:1165: > vmlinux] Error 2 > make[1]: *** [/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21/Makefile:234: > __sub-make] Error 2 > make[1]: Leaving directory '/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21-build' > make: *** [Makefile:234: __sub-make] Error 2 > make: Leaving directory '/mnt/lindata/work/abbotti/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/build-target/linux-6.6.21' > make: *** [/mnt/lindata/work/abbotti/ptxdist/ptxdist/releases/ptxdist-2024.03.0/rules/kernel.make:251: /home/abbotti/work/ptxdist/projects/its-ipt4-demo/platform-its-ipt4-demo/state/kernel.compile] > Error 2 > ------------------------------->8---------------------------- > > I guess that is because of these lines in the upstream "rules/kernel.make": > > ------------------------------->8---------------------------- > KERNEL_SHARED_OPT = \ > $(KERNEL_MODULE_OPT) \ > PAHOLE=false > ------------------------------->8---------------------------- > > So it would probably require more work to upstream to support the > CONFIG_DEBUG_INFO_BTF kernel option in ptxdist. Right, so we need a host-pahole package and select it as well. Regards, Michael -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |