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

[Question] How to support Kprobes in armbian linux kernel? #3883

Closed
diyism opened this issue Jun 11, 2022 · 6 comments
Closed

[Question] How to support Kprobes in armbian linux kernel? #3883

diyism opened this issue Jun 11, 2022 · 6 comments
Labels
Discussion Issue is being discussed. Undetermined.

Comments

@diyism
Copy link
Collaborator

diyism commented Jun 11, 2022

When I try to build anbox-module in Armbian_22.05.1_Pine64_focal_current_5.15.43, it complains:

$ apt install linux-headers-current-sunxi64
$ git clone https://github.com/diyism/anbox-modules.git
$ cd anbox-modules
$ ./INSTALL.sh
DKMS make.log for anbox-ashmem-1 for kernel 5.15.43-sunxi64 (aarch64)
Sat 11 Jun 2022 08:56:51 PM HKT
make -C /lib/modules/5.15.43-sunxi64/build V=0 M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-5.15.43-sunxi64'
  CC [M]  /var/lib/dkms/anbox-ashmem/1/build/deps.o
  CC [M]  /var/lib/dkms/anbox-ashmem/1/build/ashmem.o
/var/lib/dkms/anbox-ashmem/1/build/deps.c:9:3: error: #error "Your kernel does not support KProbes, but this is required to compile ashmem as a kernel module on kernel 5.7 and later"
    9 | # error "Your kernel does not support KProbes, but this is required to compile ashmem as a kernel module on kernel 5.7 and later"

How to support Kprobes in armbian linux kernel?

@EvilOlaf
Copy link
Member

I suggest to build your own kernel package using the build framework and enable CONFIG_KPROBES during the process.
https://docs.armbian.com/Developer-Guide_Build-Preparation/

@diyism
Copy link
Collaborator Author

diyism commented Jun 11, 2022

@EvilOlaf Thanks, I'll give a try.

@EvilOlaf EvilOlaf added the Discussion Issue is being discussed. Undetermined. label Jun 11, 2022
@igorpecovnik
Copy link
Member

igorpecovnik commented Jun 11, 2022

You can also send a PR with enabling this everywhere so this will work next time you will need it. And for others. Here:
https://github.com/armbian/build/tree/master/config/kernel
Some has it, some don't.

@diyism
Copy link
Collaborator Author

diyism commented Jun 11, 2022

No luck, I modified "build/config/kernel/linux-sunxi64-current.config" to enable "CONFIG_KPROBES=y"
and then exec:


./compile.sh BOARD=pine64 BRANCH=current KERNEL_ONLY=yes RELEASE=focal
...
  CC      spl/lib/elf.o
  AR      spl/lib/built-in.o
  LD      spl/u-boot-spl
  OBJCOPY spl/u-boot-spl-nodtb.bin
  SYM     spl/u-boot-spl.sym
  COPY    spl/u-boot-spl.bin
  MKIMAGE spl/sunxi-spl.bin
  BINMAN  all
[ o.k. ] Building deb [ linux-u-boot-current-pine64_22.08.0-trunk_arm64.deb ]
[ error ] ERROR in function compile_uboot [ main.sh:588 -> main.sh:481 -> compilation.sh:321 -> general.sh:0 ]
[ error ] Building u-boot package failed 
[ o.k. ] Process terminated

@igorpecovnik
Copy link
Member

It must be some host dependency problem if you can't pass u-boot compilation. Use Docker.

@iav
Copy link
Contributor

iav commented Jun 11, 2022

And use KERNEL_CONFIGURE=yes option to invoke kernel config. then you get kernel config in output subtree, and copy it into userpatches directory for use in future.

diyism added a commit to diyism/build that referenced this issue Jun 11, 2022
igorpecovnik added a commit that referenced this issue Jun 14, 2022
* Update linux-sunxi64-current.config

anbox-modules needs kprobes
#3883

* Enable this everywhere

sed -i -- 's/# CONFIG_KPROBES is not set/CONFIG_KPROBES=y/g' *.config

Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
eebssk1 pushed a commit to eebssk1/armbian_build that referenced this issue Jun 14, 2022
* Update linux-sunxi64-current.config

anbox-modules needs kprobes
armbian#3883

* Enable this everywhere

sed -i -- 's/# CONFIG_KPROBES is not set/CONFIG_KPROBES=y/g' *.config

Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
eebssk1 pushed a commit to eebssk1/armbian_build that referenced this issue Jun 14, 2022
* Update linux-sunxi64-current.config

anbox-modules needs kprobes
armbian#3883

* Enable this everywhere

sed -i -- 's/# CONFIG_KPROBES is not set/CONFIG_KPROBES=y/g' *.config

Co-authored-by: Igor Pecovnik <igor.pecovnik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Issue is being discussed. Undetermined.
Development

No branches or pull requests

4 participants