11-20-2018 11:00 AM
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.
11-21-2018 01:05 AM
11-21-2018 04:59 AM
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.
11-21-2018 06:15 PM
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".
11-22-2018 05:33 AM
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