Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to use the kernel source to cross compile an .ko kernel module?

Featured Replies

I could set up the `armbian/build` repository to compile the kernel for my board. I would like to compile an out-of-tree kernel module on the host machine and copy it to the target machine. I understand that my target machine (Nano Pi Neo Air) has enough resource to compile the module but I just want to try this out. I built the kernel with the following command:

./compile.sh BOARD=nanopiair BRANCH=current KERNEL_CONFIGURE=prebuilt KERNEL_ONLY=yes CLEAN_LEVEL="" KERNEL_CONFIGURE=no CLEAN_LEVEL= KERNEL_KEEP_CONFIG=yes BUILD_MINIMAL=yes BUILD_DESKTOP=no
EXTERNAL=no

The problem I encountered was that the kernel source (~/build/cache/sources/linux-mainline/orange-pi-5.10) will clear after build, so if I build my kernel module with this source, it prompted that files like 

`./scripts/basic/fixdep` are missing. I tried to fixed it by running `make  ARCH=arm CROSS_COMPILE=.....` . The compilation succeeded. But the kernel module compiled with this source is not compatible with my kernel, because the vermagic (modinfo) is `5.10.60+ SMP mod_unload ARMv7 thumb2 p2v8` rather than `5.10.60-sunxi SMP mod_unload ARMv7 thumb2 p2v8`.

 

I wonder how could I retain the kernel build after running `./complile.sh` so that I can reuse it for kernel module cross compilation purpose?

 

Thank you!

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.