Jump to content
  • 0

Install petalinux as normal user


mihai5

Question

Posted

Hi,

    At the first time i run the petalinux installer with sudo rights. At build one project i got the error :

mihai@mihai-VirtualBox:~/petalinuxOS/accelerator$ petalinux-build 
[INFO] building project
[INFO] sourcing bitbake
ERROR: Failed to source bitbake
ERROR: Failed to build project
webtalk failed:PetaLinux statistics:extra lines detected:notsent_nofile!
webtalk failed:Failed to get PetaLinux usage statistics!

After searching a little i found in this thread that this problem is generated because i did not install the petalinux as a normal user.

I tried to reinstall as a normal user, but i saw in the entire log that the comm "Cannot utime: Operation not permitted" or "Cannot open: File exists" was everywhere:

...........................
tar: ./tools/hsm: Cannot utime: Operation not permitted
tar: ./tools: Cannot utime: Operation not permitted
tar: ./settings.sh: Cannot open: File exists
tar: .: Cannot utime: Operation not permitted
tar: Exiting with failure status due to previous errors
*********************************************
ERROR: Failed to install PetaLinux SDK into "/opt/PetaLinux//."
*********************************************

I also set before :

mihai@mihai-VirtualBox:~$ source /opt/Xilinx/Vivado/2017.2/settings64.sh 

Is there anyone who met this problem?

Regards,

Mihai

10 answers to this question

Recommended Posts

Posted

Hi,

  It seems that installing in home(~/PetaLinux) directory instead of /opt/PetaLinux solved my problem. I installed with normal user rights.

I also wanted to marked this question as solved but i cannot find how.

Mihai

Posted

@mihai5,

Yes, I have come across this problem often ... just not with petalinux.

The problem is basically that you have installed files that are now owned by root, and that as a normal user you don't have the rights/privileges to delete them.

You'll need to find those files, and either "rm -f" them, or "sudo rm -f" them.  Another approach I've used is to use the find command to find all of the files in the directory I'm working with, and change them all to have my username as owner.  If you own them, the install will proceed without a problem.

I wish I could be more specific, but ... not having done a petalinux install before, I'm not sure if you have a simple working directory that you are working with, or whether it has installed files elsewhere.  Hence why my counsel is "You'll need to find those files", rather than telling you where they'd be.

Dan

Posted

@D@n

     I do not want to delete anything. I just want to build a petalinux project but i'm stuck into that error "ERROR: Failed to source bitbake". Maybe someone came across this problem ?

When i install with sudo rights i get into this error but when i try to install with normal user rights i get problems with permissions. Can anyone help me with this issue?

Mihai

Posted

@mihai5,

To explain the problem, let's create a directory and place a file within it:

mkdir EXAMPLEd
touch EXAMPLEd/EXAMPLE.txt

Now, if you want, you can delete this file, or this directory without any problems:

rm EXAMPLEd/EXAMPLE.txt
rm -rf EXAMPLEd

Now, let's repeat with sudo:

sudo mkdir EXAMPLEd
sudo touch EXAMPLEd/EXAMPLE.txt

Now, when you try to EXAMPLE.txt, you are going to get an error saying that the operation is not permitted.

This is what's going on within bitbake.  Bitbake is downloading archive files, and then asking tar to expand them.  tar cannot, though, because the prior files were owned by root.  It doesn't have the permissions needed to overwrite them.

How would you like to fix this problem?  If you "don't want to delete anything", then you have two options that I know of:

  • You can leave this build, partially done but in a broken state, and start over somewhere else.
  • You can also go back to the root owned files, and "sudo chown" them so that they are owned by you.  The last time I did this with find, as in
sudo find . -exec chown user:user \{\} \;
  • You might also need to adjust file permissions (it's been a while)
sudo find . -exec chmod a+w \{\} \;

This will be required if any of the directories bitbake created were created with read-only permissions.  (Not likely, but I've had it happen with my own stuff ...)

Be careful, though, you only want to apply these recursive operations to the products of bitbake, not to your root directory, /.  Some things, you see, *need* to be owned by root.

Dan

Posted

@D@n

Thank you for your detailed explanation. But i think there should be a easier way to do this. Being a newbie in linux OS i do not want to mess things up.

I would like to take your first option, to start over somewhere else but i think will be the same issues if is installed as a normal user or as root.

To install petalinux as root and then to change the ownership of the installation directory to a normal user, is this possible ?

 

Mihai

Posted

Hello @mihai5,

Generally, if you are the original creator of the thread, there should be a grayed out checkmark next to the post you want to mark as "best answer/response". It would be on the left hand side, fairly close to your name on the post in question.

Let me know if you have any questions.

Thanks,
JColvin

Posted

@D@n @mihai5

I have moved this question to a more appropriate section of the forum.

As for marking things as solved, I believe the correct thing to do is to vote an answer up (click the up arrow on the left of an answer). This can cause some weirdness with back and forth threads, as the default comment sorting is based on upvotes, rather than time of posting. Up to you.

Thanks,

Arthur

Posted

@mihai5,

Unfortunately, there is no solved button in the header of the thread that I can see to enable or make exist. :( The closest thing that I could think of would be to change the title of the post to include "[solved]" or something like that; tedious and frustrating to be sure, but the current reality.

Edit: looks like on the main Embedded Linux page, it looks like it has that green check mark to show it is solved, so that might work out.

Thanks,
JColvin

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...