Jump to content

Building Kernel modules that work with official distributions


bcoggs

Recommended Posts

We are trying to compile a modified kernel module for this version of Armbian downloaded in October

image.png.18ecd8aced246c80601e603f74265abd.png

 

When running it reports:

 

$cat /etc/armbian-release


# PLEASE DO NOT EDIT THIS FILE
BOARD=orangepizero
BOARD_NAME="Orange Pi Zero"
BOARDFAMILY=sun8i
BUILD_REPOSITORY_URL=https://github.com/armbian/build
BUILD_REPOSITORY_COMMIT=ba704f4740
LINUXFAMILY=sunxi
ARCH=arm
IMAGE_TYPE=stable
BOARD_TYPE=csc
INITRD_ARCH=arm
KERNEL_IMAGE_TYPE=zImage
FORCE_BOOTSCRIPT_UPDATE=
VENDOR=Armbian
BOOTSCRIPT_FORCE_UPDATE="no"
BOOTSCRIPT_DST="boot.cmd"
VERSION=23.8.3
REVISION=23.8.3
BRANCH=current

 

uname -a

Linux orangepizero 6.1.53-current-sunxi #3 SMP Wed Sep 13 07:43:05 UTC 2023 armv7l GNU/Linux

 

cat /boot/config-6.1.53-current-sunxi  | grep -i MODULE_FORCE

# CONFIG_MODULE_FORCE_LOAD is not set

 

We assume that if CONFIG_MODULE_FORCE_LOAD is not set that modprobe --force will not work and we will have to compile with the exact headers. 

 

 

Note that we've also tried compiling on the target but :

sudo apt-get install linux-headers-$(uname -r)

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-headers-6.1.53-current-sunxi
E: Couldn't find any package by glob 'linux-headers-6.1.53-current-sunxi'
E: Couldn't find any package by regex 'linux-headers-6.1.53-current-sunxi'

 

For cross-compiling, what branch/tag do we checkout from https://github.com/armbian/build that will result in the correct headers?

 

Alternately how do we modify the .ko from a near-similar build to overcome CONFIG_MODULE_FORCE_LOAD not set? 

 

Thank you in advance!

 

 

Link to comment
Share on other sites

4 hours ago, bcoggs said:

Note that we've also tried compiling on the target but :

sudo apt-get install linux-headers-$(uname -r)

 

sudo armbian-config -> software -> headers install

Link to comment
Share on other sites

Attempting to follow documentation on how to build kernel modules here fails https://docs.armbian.com/User-Guide_Advanced-Features/#how-to-build-a-wireless-driver 

 

armbian-config -> install kernel headers exit

cd /usr/src/linux-headers-$(uname -r) 
make scripts

cd
git clone https://github.com/pvaret/rtl8192cu-fixes.git
cd rtl8192cu-fixes
make ARCH=arm
make ARCH=arm CROSS_COMPILE= -C /lib/modules/6.1.53-current-sunxi/build M=/home/bartrack/tmp/rtl8192cu-fixes  modules
make[1]: Entering directory '/usr/lib/modules/6.1.53-current-sunxi/build'
make[1]: *** No rule to make target 'modules'.  Stop.
make[1]: Leaving directory '/usr/lib/modules/6.1.53-current-sunxi/build'
make: *** [Makefile:595: modules] Error 2

ls /usr/lib/modules/6.1.53-current-sunxi/build
./  ../

 

The problem appears to be that  /usr/lib/modules/6.1.53-current-sunxi/build is empty.

 

Where do I get the needed contents?

 

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines