mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] Getting error 'kernel' must depend on 'host-system-python3' for 'python3'!
Date: Thu, 28 Mar 2024 10:59:43 +0000	[thread overview]
Message-ID: <85d8e9a2-60fc-45cf-87e0-ffabf1508baf@mev.co.uk> (raw)
In-Reply-To: <ZgUmB_o911YDK_Ut@pengutronix.de>

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
>> <https://github.com/systemd/systemd/blob/main/README>.  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.

Kind regards,
Ian

-- 
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-




  reply	other threads:[~2024-03-28 11:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 17:17 Ian Abbott
2024-03-28  8:10 ` Michael Olbrich
2024-03-28 10:59   ` Ian Abbott [this message]
2024-03-28 11:36     ` Ian Abbott
2024-03-28 11:52       ` Ian Abbott
2024-03-28 15:04     ` Michael Olbrich

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=85d8e9a2-60fc-45cf-87e0-ffabf1508baf@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=ptxdist@pengutronix.de \
    /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