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 ngagnon
Visitor
546 Views
Registered: ‎10-23-2018

PetaLinux 2018.2 tools required HOME environment variable been defined

Just to put you in context, I'm fairly new to PetaLinux and I'm taking over a colleague work. We are building in the context of a docker image and while I was performing restructuration of our build process I encounter a problem where tools (e.g. petalinux-util or petalinux-build) reported error such as "mkdir -p '//.PeltaLinux' failed because of permissions. I've googled and search Xilinx community without any information about what was causing my problem.

I've decided to compare changes I've made, looking at output between good and bad build and finally export environment variables to find out my "HOME" environment variable was empty. I did fix the empty HOME issue and now my system is building properly and thought I could save someone else time by sharing my experience.

 

0 Kudos
4 Replies
Moderator
Moderator
503 Views
Registered: ‎02-07-2018

Re: PetaLinux 2018.2 tools required HOME environment variable been defined

Hi @ngagnon

 

 

Thanks for sharing your answer. But if you can mention why that issue happen. then it will help even more.

 

Thanks & regards

Aravind

0 Kudos
Visitor ngagnon
Visitor
491 Views
Registered: ‎10-23-2018

Re: PetaLinux 2018.2 tools required HOME environment variable been defined

Hi Aravind,

Sure I can provide the reason it happen. I discover the problem when we attempt to run docker image with a user ID (e.g docker run -u `id -u`:`id -g`) where the ID was not part of the list and there was no home environment variable defined. At this point I was getting an error 'touch //.PetaLinux/.PetaLinux_data' permission denied.

Working with PetaLinux the context of docker his extremely painful due mostly to file permission and accessing the display for configuration. Our build strategy heavily rely on docker to avoid developer installation time and to produce consistent build.

Cheers,

Nicolas

 

0 Kudos
Scholar watari
Scholar
479 Views
Registered: ‎06-16-2013

Re: PetaLinux 2018.2 tools required HOME environment variable been defined

Hi @ngagnon

 

I'm interesting your post.

Because of I already prepared petalinux environment on docker image.

If possible, would you share your Dockerfile and explain how to build docker image ?

Maybe you manually did something to install petalinux. I'm sure that at least you install petalinux on docker image and ran "docker commit".

 

Best regards,

0 Kudos
Visitor ngagnon
Visitor
469 Views
Registered: ‎10-23-2018

Re: PetaLinux 2018.2 tools required HOME environment variable been defined

Hi, 

Our docker image has nothing really special about it and it is mostly Ubuntu 16-04 with required tools for PetaLinux. The real problem I was having is been able to build using docker while editing code and making changes from my guess system. At the end I've found a post recommending to export local credentials to the docker image to fix the problem. This way I've fixed my permission issue and my lack of HOME directory while not running as root.

docker run --rm -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/passwd:/etc/passwd -v /etc/group:/etc/group ...

I should have menton initially we don't have PetaLinux install in our docker but instead we are downloading an archive from docker and install it. This way we can support multiple version of Petalinux with the same build environment. I have attached the docker file for reference

Regards,

Nicolas

0 Kudos