Wednesday, June 15, 2016

petalinux on (l)ubuntu 16.04

Well, recently I moved my development environment from Lubuntu 15.10 to 16.04 LTS. After installing XSDK and Petalinux 15.2 (yeah... I am still at 15.02 because I don't want my client to update to a new XSDK in the middle of the project and cause a number of problems...)

$ petalinux-build
INFO: Checking component...
INFO: Generating make files and build linux
...
[INFO ] install linux/kernel
[ERROR] ERROR: Invalid ELF file '/home/om/labcyte.git/lc-ddring/peta/plnx-ddring/images/linux/vmlinux'
[ERROR] make[1]: *** [package-subsystem-FIT] Error 255
ERROR: Failed to build linux

Hmm... What a bummer!

After searching for a while, I found this topic in xilinx forum
Following the advice on the link, I executed
 
$ 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

Reading package lists... Done
Building dependency tree     
Reading state information... Done
E: Unable to locate package lib32bz2-1.0
E: Couldn't find any package by glob 'lib32bz2-1.0'
E: Couldn't find any package by regex 'lib32bz2-1.0'


Hm... Looks like lib32bz2-1.0 is not present. Can it be renamed to something else?
Further searching using google yielded this link
The fix was easy.
sudo dpkg --add-architecture i386
root@E6420:~# apt-get update 

...
 apt-get install libbz2-1.0:i386
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following NEW packages will be installed:
  libbz2-1.0:i386
...


$ 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  lib32stdc++6 libselinux1
Reading package lists... Done
Building dependency tree      
Reading state information... Done
bison is already the newest version (2:3.0.4.dfsg-1).
flex is already the newest version (2.6.0-11).
gawk is already the newest version (1:4.1.3+dfsg-0.1).
gcc is already the newest version (4:5.3.1-1ubuntu1).
libncurses5-dev is already the newest version (6.0+20160213-1ubuntu1).
libselinux1 is already the newest version (2.4-3build2).
make is already the newest version (4.1-6).
...


$ petalinux-build
...

[INFO ] post-install linux/rootfs/uWeb
[INFO ] package zImage
[INFO ] zImage linux/kernel
[INFO ] install linux/kernel
[INFO ] Package HDF bitstream
$


Great! Petalinux started building.