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: 
Visitor amaye
Visitor
1,788 Views
Registered: ‎01-15-2008

Doe petalinux builds really require internet?

Hi There,

 

One of our customer is trying to build kernel images on a MIL environment (without internet connection) and there seem to be issues with that. Are you guys aware of any restriction forcing users to have an internet connection while building a petalinux image?

 

Best Regards,

Arnaud

0 Kudos
22 Replies
Moderator
Moderator
1,759 Views
Registered: ‎09-12-2007

Re: Doe petalinux builds really require internet?

You can download the sstate_cache from Xilinx.com:

https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools/2017-4.html

 

There is a readme file here too for the setup

0 Kudos
Participant tmonaghan84
Participant
1,585 Views
Registered: ‎04-19-2018

Re: Doe petalinux builds really require internet?

I have been reading this thread, and followed the Xilinx sstate_cache readme.

 

The Readme states as below 

1) Extract the downloaded tar contents of sstate-cache at any location

2) run petalinux-config

         -> Yocto Settings

             ->Local sstate feeds settings

                 ->local sstate feeds url

                         (press Enter)

3) Provide the path of sstate-cache from above

           Ex: file://<path>/aarch64 for ZynqMP projects

               file://<path>/arm     for Zynq projects

               file://<path>/mb-full for MB AXI full projects

 

However it is missing the prepending file:// (this has been added above) , this needs to be in front of the <path> entered in the petaLinux-config menu, otherwise PetaLinux shows a warning;

WARNING: Invalid protocol in SSTATE_MIRRORS: <FULL PATH ENTERED>

 

Xilinx could this be corrected the next release?

0 Kudos
Moderator
Moderator
1,572 Views
Registered: ‎04-24-2017

Re: Doe petalinux builds really require internet?

Hi all,

 

You need to set the BB_NO_NETWORK else bitbake tries to fetch the SRC_URI from mirror sites provided in recipes.

 

Below is the variables you need to take care.

 

  1. Download and untar 2018.2(latest) or respective version sstate-cache files from https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html
  2. Create a petalinux project here I'm using ZCU102 bsp project(xilinx-zcu102-v2018.2)
  3. Run below command and set the pre mirror downloads.

 

$ cd xilinx-zcu102-2018.2
$ petalinux-config ---> Yocto Settings ---> Add pre-mirror url ---> file:///opt/xilinx/petalinux/sstate-rel-v2018.2/downloads
$ petalinux-config ---> Yocto Settings ---> Local sstate feeds settings ---> local sstate feeds url ---> /opt/xilinx/petalinux/sstate-rel-v2018.2/aarch64
$ petalinux-config ---> Yocto Settings ---> [*] Enable BB NO NETWORK

 Note: Setting "local sstate feeds url" is optional for building petalinux project without network. Other two settings are mandatory.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Observer jsaxer
Observer
1,503 Views
Registered: ‎03-09-2015

Re: Do petalinux builds really require internet?

I am trying to use the directions you gave, and have not been successful. I am using 2017.3 (getting 2018.1 sstate-cache to try next) but after running "petalinux-config -v" and setting the yocto values as instructed (although your directions, and the ones in the sstate-cache readme, are not very good), the command still fails with "ERROR: Failed to source bitbake"

 

I have verified that the directories I am referencing in the yocto configurations exist. Your directions say "Provide the path of sstate-cache from above", without really defining it, so it is possible I am using the wrong path. Can you be more precise in what the actual paths need to be? For instance the downloaded tar image creates a directory named "sstate-rel-v2017.3", so do you intend that to be the final element in the path specified (as an example, if I extracted the tarball to "/opt/Xilinx", would I enter "/opt/Xilinx/sstate-rel-v2017.3/aarch64"?).

 

The same question exists for the "downloads" directory. For this example, would I enter "/opt/Xilinx/sstate-rel-v2017.3/downloads"?

 

Of course, having already done this, and have it fail, I expect something is still missing. Any ideas?

0 Kudos
Moderator
Moderator
1,497 Views
Registered: ‎04-24-2017

Re: Do petalinux builds really require internet?

Hi @jsaxer,

 

Config settings are same from 2017.3 to 2018.2 no changes.

 

#
# Yocto Settings
#

#
# TMPDIR Location
#
CONFIG_TMP_DIR_LOCATION="${PROOT}/build/tmp"

#
# Parallel thread execution
#
CONFIG_YOCTO_BB_NUMBER_THREADS=""
CONFIG_YOCTO_PARALLEL_MAKE=""

#
# Add pre-mirror url 
#
CONFIG_PRE_MIRROR_URL="file:///opt/xilinx/petalinux/sstate-rel-v2017.3/downloads"

#
# Local sstate feeds settings
#

#
# Default sstate feeds ${PETALINUX}/components/yocto always added
#
CONFIG_YOCTO_LOCAL_SSTATE_FEEDS_URL="/opt/xilinx/petalinux/sstate-rel-v2017.3/aarch64"
# CONFIG_YOCTO_ENABLE_DEBUG_TWEAKS is not set
CONFIG_YOCTO_NETWORK_SSTATE_FEEDS=y

#
# Network sstate feeds URL
#
CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="http://petalinux.xilinx.com/sswreleases/rel-v2017.3/aarch64/sstate-cache"
CONFIG_YOCTO_BB_NO_NETWORK=y

#
# User Layers
#
CONFIG_USER_LAYER_0=""
CONFIG_SUBSYSTEM_BOOTARGS_GENERATED="earlycon clk_ignore_unused"

Yes you need to provide the path as /opt/Xilinx/sstate-rel-v2017.3/aarch64 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Observer jsaxer
Observer
1,492 Views
Registered: ‎03-09-2015

Re: Do petalinux builds really require internet?

thanks, but part of the problem appears to be that I am not getting a "build/conf" directory with any config files as referenced in the readme. There is a "project_spec/configs/config" file, so comparing that to the sample you sent, shows similar settings (CONFIG_PRE_MIRROR_URL starting with "file://", and LOCAL_SSTATE_FEEDS_URL only having a path, that is, no "file:// prefix).

 

However, on exiting the menu-config, I still get "Failed to source bitbake", so something is still missing.

 

Anything else I could be missing?

0 Kudos
Moderator
Moderator
1,488 Views
Registered: ‎04-24-2017

Re: Do petalinux builds really require internet?

Can you post the content of <plnx-proj-root>/project-spec/configs/config

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Explorer
Explorer
1,457 Views
Registered: ‎05-22-2008

Re: Do petalinux builds really require internet?

This may not be helpful, but you should note that if you make the configuration changes through the menuconfig, you will have to do that for every petalinux project.

 

To avoid this, what I did was, went into the template files from which the default values are loaded by the petalinux tools, in my case, for 2017.3 and for a ZynqMP:

 

/opt/petalinux/2017.3/etc/template/project/template-zynqMP/project-spec/configs/config

 

And made the following changes:

 

 

CONFIG_PRE_MIRROR_URL="file:///opt/sstate-rev-v2017.3/downloads"

CONFIG_YOCTO_LOCAL_SSTATE_FEEDS_URL="file:///opt/sstate-rev-v2017.3/aarch64"

 

By doing this, the above values are now the defaults upon project creation.

0 Kudos
Observer jsaxer
Observer
1,447 Views
Registered: ‎03-09-2015

Re: Do petalinux builds really require internet?

yes, but it will take some time - the builds are done on isolated machines without access to the internet, so I have to package up the data and request to get it sent to another machine with a connection. Sometimes this takes 10 minutes, sometimes it takes hours.

 

As soon as I have all the relevant data I will post it.

0 Kudos
Moderator
Moderator
1,346 Views
Registered: ‎04-24-2017

Re: Doe petalinux builds really require internet?

CAUTION!!! You are not supposed to modify the petalinux tools installation directory.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Observer jsaxer
Observer
1,345 Views
Registered: ‎03-09-2015

Re: Do petalinux builds really require internet?

what a great suggestion - I will add this to my system as I struggle to get this to work, as I am clearing and restarting over and over again.
0 Kudos
Observer jsaxer
Observer
1,339 Views
Registered: ‎03-09-2015

Re: Do petalinux builds really require internet?

So I tried this, and while the PRE_MIRROR entry shows up in menuconfig as expected (great!) the LOCAL_SSTATE entry does not, even though I entered it the same way. Any thoughts?

Happy to have one of them set (and I set a couple others things too while I was there) but it does seem odd that the second one did not take effect.
0 Kudos
Observer jsaxer
Observer
1,333 Views
Registered: ‎03-09-2015

Re: Do petalinux builds really require internet?

here is the config file - but I have not found anything interesting in it to account for this.

 

Is it possible there is something else wrong in the command chain? I say this because another developer here has an image that they can build, but when I try it I get the same "bitbake source failed" error, so I am suspicious something else is wrong or missing.

 

Is there a way to see what the actual commands that are generating the errors? petalinux-create does not have a "-v" option, so I am not sure what else I can do to see the actual commands.

0 Kudos
Explorer
Explorer
1,328 Views
Registered: ‎05-22-2008

Re: Doe petalinux builds really require internet?

@sandeepg

 

Maybe not, but when you are fighting down tool issues, manually entering a long URL consumes time and adds the potential for a keying error everytime you enter it. Maybe Xilinx can add a supported mechanism for changing the default parameters?   

0 Kudos
Explorer
Explorer
1,316 Views
Registered: ‎05-22-2008

Re: Do petalinux builds really require internet?

@jsaxer

 

This might be unhelpful as well, but do you have write and or execute permissions on your petalinux installation directory and it's subdirectories?

0 Kudos
Observer jsaxer
Observer
1,314 Views
Registered: ‎03-09-2015

Re: Do petalinux builds really require internet?

I am in a subdirectory of my home directory, so I don't think it is a permission issue. I am reinstalling the 2017.3 petalinux tools to be certain something has not been screwed up, but I have low expectations that this is the issue.
0 Kudos
Observer jsaxer
Observer
1,282 Views
Registered: ‎03-09-2015

Re: Do petalinux builds really require internet?

I think I found it!

 

There seems to be some issues on my system with various versions of python, and it looks like during some RPM updates, I ended up with "/usr/bin/python" pointing at "/usr/bin/python3", and it seems the petalinux build tools require python 2 (I have 2.7). Moving the link from python3 to python2 appears to have fixed the "Failed to source bitbake" error, allowing the tools to continue.

 

Sure wish there was a way for the tool to detect if it has an incorrect verson of python and warn us, instead of just exiting with an obscure error.

Observer jsaxer
Observer
1,276 Views
Registered: ‎03-09-2015

Re: Do petalinux builds really require internet?

In addition, once I have determined that the sstate-cache is working correctly on my isolated machine, I will post a followup.
0 Kudos
Observer come0088
Observer
1,222 Views
Registered: ‎01-03-2018

Re: Doe petalinux builds really require internet?

Hi,

I used the lib bitbake recipe on git download model successfully install libto the petalinux .Now we have a problem is we should use the petalinux offline ,and I modify the librecipe on local model,but I don't know how to create a package for lib ,how the yocto unzip the package ,and this is the petalinux-build debug info and my local-package recipe bitbake file.

Thanks

0 Kudos
Moderator
Moderator
860 Views
Registered: ‎04-24-2017

Re: Doe petalinux builds really require internet?

Hi @come0088,

 

Can you post your recipe we can get fixed.

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Visitor dcherkus
Visitor
119 Views
Registered: ‎04-26-2018

Re: Do petalinux builds really require internet?

Regarding permissions, what permissions are needed for the sstate directory:

/opt/xilinx/petalinux/sstate-rel-v2017.3/aarch64

 Can this be read-only, or must it have write permissions for the users doing builds?

0 Kudos
Visitor dcherkus
Visitor
45 Views
Registered: ‎04-26-2018

Re: Do petalinux builds really require internet?

Following up on my own question, the Yocto Project Mega Manual says:

Use a Shared State Cache (sstate) among groups of developers who are on a fast network. The best way to share sstate is through a Network File System (NFS) share. The first user to build a given component for the first time contributes that object to the sstate, while subsequent builds from other developers then reuse the object rather than rebuild it themselves.  Although it is possible to use other protocols for the sstate such as HTTP and FTP, you should avoid these. Using HTTP limits the sstate to read-only and FTP provides poor performance.

So it seems Xilinx treats sstate-cache as a (presumably read-only?) way to provide pre-built state to its customers, whereas Yocto treats it as a world-writeable way for ongoing development to add/change this state?

Or does Xilinx also expect future builds to be changing the sstate-cache it provides?

Is there a way we could keep the Xilinx-provided sstate cache read-only (since our IT doesn't like writeable things in /opt and we'd want to preserve anything provided by a third party anyway) and use a second shared NFS mount for the purposes Yocto intends (a world-writeable place for ongoing development to add/change this state)?

Above Sandeep wrote:

Note: Setting "local sstate feeds url" is optional for building petalinux project without network. Other two settings are mandatory.

It seems Petalinux uses this to add a URL to SSTATE_MIRRORS?

If so can more than one URL be added?

I would try this on my system but am not able to do so right now.

0 Kudos