UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
162 Views
Registered: ‎12-21-2012

Petalinux adds '-xilinx' suffix to kernel release number after building the kernel from external source.

I grabbed the source of version 4.14.0 from https://github.com/torvalds/linux. After building the kernel in Petalinux and booting from it, command `uname -r` returns 4.14.0-xilinx.

When I build a module against this kernel, make returns:

-------------------------------------------------------------------------------------------

make -C /usr/src/linux-source-4.14.0-xilinx M=/home/test/apps/dma modules_install
make[1]: Entering directory '/usr/src/linux-source-4.14.0-xilinx'
DEPMOD 4.14.0
make[1]: Leaving directory '/usr/src/linux-source-4.14.0-xilinx'

-------------------------------------------------------------------------------------------

So the .ko file is installed in /lib/modules/4.14.0/. But the modprobe command always try to find the file with the kernel release:

-------------------------------------------------------------------------------------------

modprobe ds-axidma
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.14.0-xilinx/modules.dep.bin'
modprobe: FATAL: Module ds-axidma not found in directory /lib/modules/4.14.0-xilinx

-------------------------------------------------------------------------------------------

Thus I can't install the module.

How can I solve this problem? Thank you.

0 Kudos
3 Replies
Moderator
Moderator
83 Views
Registered: ‎02-07-2018

Re: Petalinux adds '-xilinx' suffix to kernel release number after building the kernel from external source.

HI @fiedel 

Can you please try to add extra string to CONFIG_LOCALVERSION like below in your kernel configuration file.

 CONFIG_LOCALVERSION="-xilinx"

 

Thanks & regards

Aravind

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

0 Kudos
Adventurer
Adventurer
56 Views
Registered: ‎12-21-2012

Re: Petalinux adds '-xilinx' suffix to kernel release number after building the kernel from external source.

Thank you @aravindb.

I did all the compilation from Petalinux and I'm not quite familiar with the configuration from editing the files, so I'm not sure where to define the string. I did a search in the source directory and found the in file: components/ext_sources/linux-4.14/arch/arm/configs/xilinx_zynq_defconfig

This definition already exists. So I made it as

CONFIG_LOCALVERSION=""

After that I ran petalinux-build, boot the board with the created images. The kernel release is still 4.14.0-xilinx.

Should I define the string somewhere else, or some extra configuration is needed to make it effective?

0 Kudos
Adventurer
Adventurer
37 Views
Registered: ‎12-21-2012

Re: Petalinux adds '-xilinx' suffix to kernel release number after building the kernel from external source.

OK. I defined the string in project-spec/meta-plnx-generated/recipes-kernel/linux/configs/plnx_kernel.cfg. Now the system booted and the kernel version seems to be 4.14.0.

Again I compiled the module:

# make
make -C /usr/src/linux-source-4.14.0 M=/home/test/apps/dma modules_install
make[1]: Entering directory '/usr/src/linux-source-4.14.0'
  INSTALL /home/test/apps/dma/ds-axidma.ko
  DEPMOD  4.14.0
make[1]: Leaving directory '/usr/src/linux-source-4.14.0'

But modprobe is not successful:

# modprobe ds-axidma
modprobe: ERROR: ../libkmod/libkmod.c:514 lookup_builtin_file() could not open builtin file '/lib/modules/4.14.0/modules.builtin.bin'
modprobe: ERROR: could not insert 'ds_axidma': Exec format error

Do I still have kernel version inconsistance somewhere?

0 Kudos