10-08-2015 05:28 AM
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?
10-12-2015 03:51 AM
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!
10-08-2015 05:58 AM
10-09-2015 12:45 AM
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?
10-09-2015 02:09 PM
10-12-2015 03:51 AM
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!
10-12-2015 11:19 AM
@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
10-18-2015 12:56 AM
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.
06-25-2016 02:33 PM
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 )
01-10-2017 02:49 AM
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"
...