cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
herrmannxilinx
Visitor
Visitor
15,011 Views
Registered: ‎11-13-2014

Petalinux 2015.2 Invalid ELF file .../vmlinux

Jump to solution

Hello,

 

I get the following error while building petalinux from Xilinx-ZC702-v2015.2.1-final.bsp:

 

[ERROR] ERROR: Invalid ELF file '/opt/petalinux/Xilinx-ZC702-2015.2/images/linux/vmlinux'
ERROR: Failed to build linux

 

I'm running on a VM with Ubuntu 14 LTS.

 

I have worked through several posts regarding this failure and could not find any solution. Haw can I debug this failure?

0 Kudos
1 Solution

Accepted Solutions
herrmannxilinx
Visitor
Visitor
26,148 Views
Registered: ‎11-13-2014

Hi linnj,

 

finally I maked a clean Ubuntu install and followed this instructions:

 

http://embeddedcentric.com/embedded-operating-systems/

 

installing this packeges:

 

sudo apt-get install tofrodos iproute tftpd-hpa gawk gcc git-core make net-tools libncurses5-dev zlib1g-dev libssl-dev flex bison lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 libselinux1

 

It works now. It's a pitty that I could find out the root cause. I'm sure it was a package dependency. I would wish to see that the petalinux installer displyes some information about wrong dependencies in future.

 

Thanks!

View solution in original post

0 Kudos
8 Replies
linnj
Xilinx Employee
Xilinx Employee
15,003 Views
Registered: ‎09-10-2008
Have you verified the elf is good using objdump?

It looks like petalinux-gen-fitimage is the issue, but I'm not confident.
0 Kudos
herrmannxilinx
Visitor
Visitor
14,988 Views
Registered: ‎11-13-2014

I have checked the elf files with "file" utility and they where all 32bit, little endian. Seems to be correct.

vmlinux itself is not a elf file but I will try it with objdump as you proposed. I will post the result on monday.

 

By the way, I couldn't find any binary like petalinux-gen-fitimage, I thought this will call mkimage to combine kernel, device tree and rootfs and put a u-boot header on it. Is this right?

0 Kudos
linnj
Xilinx Employee
Xilinx Employee
14,980 Views
Registered: ‎09-10-2008
I find it in the Petalinux install at

petalinux-v2015.2.1-final/tools/common/petalinux/utils/petalinux-gen-fitimage
0 Kudos
herrmannxilinx
Visitor
Visitor
26,149 Views
Registered: ‎11-13-2014

Hi linnj,

 

finally I maked a clean Ubuntu install and followed this instructions:

 

http://embeddedcentric.com/embedded-operating-systems/

 

installing this packeges:

 

sudo apt-get install tofrodos iproute tftpd-hpa gawk gcc git-core make net-tools libncurses5-dev zlib1g-dev libssl-dev flex bison lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 libselinux1

 

It works now. It's a pitty that I could find out the root cause. I'm sure it was a package dependency. I would wish to see that the petalinux installer displyes some information about wrong dependencies in future.

 

Thanks!

View solution in original post

0 Kudos
hs2
Visitor
Visitor
14,924 Views
Registered: ‎07-21-2015

@herrmannxilinx: Basically it's all about missing host system libs required by petalinux tools as you found out yourself. This thread is also related to this issue.

The installer should be better when checking dependencies ;)

HS2

0 Kudos
sugishima
Newbie
Newbie
14,883 Views
Registered: ‎10-18-2015

I am still worried about by the same error, even though I followed the instructions:
http://embeddedcentric.com/embedded-operating-systems/

I thinck the cause is that I cannot get lib32bz2-1.0.
I failed "apt-get install lib32bz2-1.0". Several servers rejected this access.
Are their any server which provide this package directly ?

The Site
http://askubuntu.com/questions/637113/unable-to-locate-package-lib32bz2-1-0
suggested "The package (32 bit) you are looking for is libbz2-1.0:i386, its 64 bit version is libbz2-1.0:amd64."
So,I tried:
sudo dpkg --add-architecture i386
sudo apt-get update.
sudo apt-get install libbz2-1.0:i386.

But it still doesn't work.
Complex packages install and remove prosess may cuase this situation.

0 Kudos
tux_mind
Newbie
Newbie
11,317 Views
Registered: ‎06-25-2016

There is another cause of this problem: locale.

 

long story short:

LANG=C LC_LANG=C petalinux-build

 

details:

petalinux-build parses the output of readelf to check generated kernel format.

If your locale differs from US the readelf output does not match the parser rules, which threat this as an invalid kernel.

 

For Xilinx developers:

A good solution to the problem is using libelf to parse the kernel, or libmagic, which provide some some good info about ELFs.

 

Have a good night :P

 

 

 

( tested with petalinux 2016.2 )

dennis-hsnr
Newbie
Newbie
8,421 Views
Registered: ‎01-10-2017

I solve my problem with petalinux-build :

ERROR: Invalid ELF file .../vmlinux

 

 

by changing the language from german to US-english:

"en_US"

 

$ locale

 

LANG=en_US.UTF-8

LANGUAGE=en_US:en_GB:en

LC_CTYPE="en_US.UTF-8"

 

...

 

 

0 Kudos