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: 
Participant kallensf
Participant
207 Views
Registered: ‎07-31-2017

Peta 2019.1 strips symbols from kernel modules when copying to rootfs

Copying kernel modules to rootfs in 2018.3 works, but 2019.1 strips symbols.

For example, my_mod.ko is 200k.  In 2018.3, it is copied to rootfs at /usr/local/bin and is still 200k.  In 2019.1, it is only 20k.  In 2019.1, insmod reports module has no symbols.

Build process: In 2018.3, I copy mymod.ko to my peta project to:

project-spec\my_files\mymod.ko

I have a recipe in project-spec\meta-user\recipes-apps\rootfssetup\rootfssetup.bb

In this recipe, there’s instructions to copy project-spec\my_files\mymod.ko to /usr/local/bin in the rootfs:

BIN_PATH = "${ROOTFS_PATH}/usr/local/bin"

do_install() {

           install -p -m 0755 ${SOURCE_PATH}/mymod.ko ${BIN_PATH}

2018.3 copies as is without symbol stripping.

Using the same process in a 2019.1 peta build, I copy boot.bin and image.ub to my sd card and boot then I check the size of mymod.ko in /usr/local/bin.  It is only 20kb! 

Please let me know what I need to do to prevent 2019.1 from stripping symbols.  Thanks in advance.

 

0 Kudos
3 Replies
Scholar watari
Scholar
154 Views
Registered: ‎06-16-2013

Re: Peta 2019.1 strips symbols from kernel modules when copying to rootfs

Hi @kallensf 

 

It depends on kernel version.

You need to recompile it's with same kernel source.

 

Best regards,

0 Kudos
Highlighted
Participant kallensf
Participant
121 Views
Registered: ‎07-31-2017

Re: Peta 2019.1 strips symbols from kernel modules when copying to rootfs

This isnt about compiling.  If I make two copies of the kernel module, one copied to the sd card via simple linux copy and the other is copied by petalinux 2019.1 during peta build, the copy of petalinux strips the symbols so insmod fails:

Example, the module copied by petalinux 2019.1:

cd /usr/local/bin

insmod mymod.ko

- insmod fails, error is 'module has no symbols'

 

The module on sd card:

cd /mnt/card

insmod mymod.ko

- insmod sucess

The module on the sd card is fine, so the kernel compile is fine.  Somehow, 2019.1 petalinux modifies the module when it installs it to rootfs.  Peta 2018.3 doesn't modify the module.

0 Kudos
Observer eliezer
Observer
69 Views
Registered: ‎03-21-2019

Re: Peta 2019.1 strips symbols from kernel modules when copying to rootfs

I don't kknow if this applies to 2019.1, but here in 2018.3, you can place an option into <project root>/build/conf/local.conf that prevents package strip (I needed this to insert my modules in my petalinux 2018.3 project):

 

INHIBIT_PACKAGE_STRIP = "1"

 

(Note: do not copypaste this line directly, these forums use a fancy quotation mark character that petalinux will not like when you try to build)

0 Kudos