Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OP-TEE kernel headers for BCC #6796

Open
BoreaWolf opened this issue Apr 18, 2024 · 3 comments
Open

OP-TEE kernel headers for BCC #6796

BoreaWolf opened this issue Apr 18, 2024 · 3 comments

Comments

@BoreaWolf
Copy link

Hi all,
I am trying to use the python bcc library on OP-TEE 4.2.0 deployed on a Xilinx ZynqMP ZCU102 platorm.
The library is installed correctly, but at runtime I get the following error:

modprobe: can't change directory to '/lib/modules': No such file or directory
Unable to find kernel headers. try rebuilding kernel with CONFIG_IKHEADERS=m (module) or installing the kernel development package for your running kernel version.

I added the suggested CONFIG_IKHEADERS flag in the kconfig file and rebuilt the image but the '/lib/modules' directory still does not appear.
I also tried adding the CONFIG_HEADERS_INSTALL flag, but the result is the same.
Both flags are active as showed by checking the configuration at runtime:

# cat /proc/config.gz | gunzip | grep -i headers
CONFIG_IKHEADERS=m
CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
CONFIG_HEADERS_INSTALL=y

Can anyone help me to understand how the kernel headers file can be added in the compiled image, if possible?
Thank you very much for the help.

@jforissier
Copy link
Contributor

Hi @BoreaWolf, what is your build environment? Your build command?

@BoreaWolf
Copy link
Author

Hi @jforissier and thanks for looking into this.
I am cross-compiling op-tee from a Ubuntu 22.04 machine.
I followed the main instructions provided in the zynqmp wiki page.
To be specific, these are the commands that I used:

mkdir <optee_dir>
cd <optee_dir>
repo init -u https://github.com/OP-TEE/manifest.git -m zynqmp.xml
repo sync
cd build
make -j$(nproc) toolchains
make -j$(nproc) PLATFORM=zynqmp-zcu102 image

I downloaded the 2023.1 firmware from the soc-prebuilt-firmware github and updated the makefiles to refer to the new version.
I also made a test with the 2021.1 firmware without modifying any of the makefiles, but the result is the same.
To ensure that the changes made to the build/kconfigs/zynqmp.conf file were applied, before compiling the image I also recreate the linux-xlnx/.config file via make linux-defconfig-clean linux-defconfig.

@jforissier
Copy link
Contributor

There is a platform that supports building and installing kernel modules, it's Rockpi4. See LINUX_MODULES=y in rockpi4.mk and OP-TEE/build@366accb7. Perhaps you need something similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants