01-08-2018 09:40 AM
I have done an experiment to see if it is possible to get Petalinux 2016.4 to install under Windows 10 WSL (Windows subsystem for Linux) using Ubuntu 16.04 LTS.
I definitely made some progress on getting some of the process to work, but it still needs some work. I thought I would post my current steps for anyone who may also be interested in doing this.
I have seen where others have gotten Yocto itself working or nearly working, so I think it may actually be possible with some work.
I'm not advocating everyone being build in an unsupported environment, but for those who may be interested, here goes:
The first problem you run into is memory contraints trying to run the installer straight away:
This can be circumvented by using 7-zip to extract the tarball from the ".run" file. We will be extracting the tar file manually instead.
From a clean Ubuntu 16.04LTS WSL session, do the following:
$ sudo dpkg --add-architecture i386 && sudo apt-get update
$ sudo apt-get install tofrodos iproute gawk gcc git-core make net-tools libncurses5-dev tftpd zlib1g-dev libssl-dev flex bison libselinux1 lib32z1 lib32ncurses5 lib32stdc++6 xvfb texinfo gcc-multilib libsdl1.2-dev libglib2.0-dev chrpath socat autoconf libtool zlib1g:i386 tftp lib32stdc++6-4.7-dev screen
$ mkdir petalinux-v2016.4
$ cd petalinux-v2016.4/
$ tar -xvf /mnt/c/iso/petalinux-v2016.4-final-installer1 <== Unpacking the installer manually succeeds
$ sudo dpkg-reconfigure dash <== select No for use Dash?
$ sudo apt-get install diffstat xterm unzip
$ source settings.sh <== should be successful at this point, but we still have further to go
$ cd components/yocto
$ mkdir source
$ cd source
$ ~/petalinux-v2016.4/tools/yocto-esdk/petalinux-glibc-x86_64-petalinux-minimal-aarch64-toolchain-ext-2016.4.sh <== enter aarch64 for install folder
$ ~/petalinux-v2016.4/tools/yocto-esdk/petalinux-glibc-x86_64-petalinux-minimal-cortexa9hf-neon-toolchain-ext-2016.4.sh <== enter arm for install folder
$ ~/petalinux-v2016.4/tools/yocto-esdk/petalinux-glibc-x86_64-petalinux-minimal-microblazeel-v10.0-bs-cmp-ml-toolchain-ext-2016.4.sh <== enter microblaze_lite for install folder
$ ~/petalinux-v2016.4/tools/yocto-esdk/petalinux-glibc-x86_64-petalinux-minimal-microblazeel-v10.0-bs-cmp-mh-div-toolchain-ext-2016.4.sh <== enter microblaze_full for install folder
Note, that above esdk's did not install perfectly clean (there are some warnings and errors I have yet to resolve which could mean we need more pre-req's)
Now that we have extracted everything manually, and installed the yocto esdk's, we can try to build a petalinux project
First get your project from rev system or copy it in (I use svn)
$ sudo apt-get install subversion
$ svn checkout --username user --password 'mypassword' https://server/svn/Repo/MyProj/trunk/MyProj /home/username/MyProj
$ cd MyProj/
$ sed -i "s,^\(CONFIG_TMP_DIR_LOCATION=\).*,\1'/home/username/MyProj/build/tmp'," project-spec/configs/config <== don't forget to change the temp folder!!!
$ mkdir .petalinux <== don't forget to make the webtalk folder even if you don't use webtalk
At this point, it will start the build and fail internally at xsct. ERROR: Failed to Kconfig project. Doing an strace lets you find out that the version of rlwrap referenced is getting a seg fault.
You can replace rlwrap:
$ sudo apt-get install rlwrap
$ cd petalinux-v2016.4/tools/hsm/bin/unwrapped/lnx64.o/
$ mv rlwrap Xrlwrap <== backup Xilinx's ver of rlwrap
$ cp /usr/bin/rlwrap . <== put in one that works
Now we get quite a bit further (at least in my project). But it fails in the while generating u-boot config files. (file "/home/username/petalinux-v2016.4/etc/hsm/scripts/petalinux_hsm_bridge.tcl" line 488)
ERROR: Failed to generate u-boot configuration files.
[INFO] building project
[INFO] generating Kconfig for project
[INFO] oldconfig project
[INFO] sourcing bitbake
[INFO] generating plnxtool conf
[INFO] generating meta-plnx-generated layer
[INFO] generating machine configuration
[INFO] generating bbappends for project . This may take time !
[INFO] generating u-boot configuration files
ERROR: Failed to generate u-boot configuration files
ERROR: Failed to build project
webtalk failed:PetaLinux statistics:extra lines detected:notsent_nofile!
webtalk failed:Failed to get PetaLinux usage statistics!
That's as far as I was able to get, but will follow up here if I make any further progress (when time allows)
01-08-2018 03:50 PM
We don't support installing petalinux on Windows 10 WSL Ubuntu.
04-29-2019 06:17 AM - edited 04-29-2019 06:20 AM
Installing and using Petalinux 2018.3 on Ubuntu 16.04 WSL works fine (at least so far).
After adding the needed libraries (as you have shown in your answer), I installed it using
(Yes, the explicit bash call is important to avoid ENOMEM error)
A different version of PetaLinux, but maybe it helps :-).
04-29-2019 07:04 AM
Hi @niklaslindskog ,
As I mentioned earlier Yocto/PetaLinux is not supported Windows 10 Ubuntu WSL. AFAIK Yocto doesn't work and community doesn't have any roadmap to support this feature.
05-02-2019 10:30 AM
05-02-2019 11:43 AM
05-08-2019 06:06 PM
Hi @drjohnsmith ,
I have tried in 2017.1 release and widows crashed 2-3 times with blue screen. During build its pretty slow on my laptop with Intel Xeon with 32GB RAM.
05-09-2019 02:40 AM
Interesting to know what it does not work on,
the fact you persisted thorugh so many BSOD is a comendation to you wa sit 2 or three you had ?
as for speed, well, the current WSL 1.0 is known to be slow file access, but 2.0 is anounced, with native file access speeds, so that will b einteresting.
But the fact you got it working is the main thing I take for mthis, well done,
06-28-2020 08:31 AM
Hi @drjohnsmith ,
That was 3 years back when first Microsoft released WSL when I try to build it crazed the windows I agree that it could have bugs. Yocto project is now compatible with WSLv2 but community is not supporting officially.
As you already know we support other Linux distribution OS mentioned in UG1144 https://www.xilinx.com/support/documentation/sw_manuals/xilinx2019_2/ug1144-petalinux-tools-reference-guide.pdf where customer can use it on native machine or using VM.
My recommendation let’s not go with this path. If you still need please go ahead and there will be no support from Xilinx.
Once Yocto community start supporting Windows 10 WSL https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#detailed-supported-distros we will plan to adopt in PetaLinux. Below screen shot is from Yocto 3.1(Dunfell) release. Xilinx latest petalinux release is based on Yocto 3.0
06-29-2020 02:48 AM