dos2unix fails to change permissions when creating project from template
Hello, I have searched all over for an answer to my problem, and while I've found similar questions none of the answers have worked. I have followed the instructions in "The Nios II Embedded "Hello World" Lab: For the DE10-LiteDevelopment Kit" successfully up to the point where you create a new project in Nios II - Eclipse.
When I fill in the wizard and press Finish I get an error popup that says Failed to execute: wsl dos2unix create-this-bsp; ./create-this-bsp --cpu-name cpu --no-make
I also see the following message printed in the eclipse console window:
dos2unix: Failed to change the permissions of temporary output file ./d2utmpfnPN2u: Operation not permitted
I've tried launching eclipse from the Nios II command shell in several ways.
- Running Nios II Command Shell.bat and executing
- ./eclipse-nios2.exe
- Running Nios II Command Shell.bat and executing
- sudo ./eclipse-nios2.exe
- Running Nios II Command Shell.bat as Administrator and executing
- ./eclipse-nios2.exe
- Running Nios II Command Shell.bat as Administrator and executing
- sudo ./eclipse-nios2.exe
I tried playing around with using elevated command shell and elevated eclipse-nios2 because of the permissions message as well as an answer that said to launch eclipse from the Nios II Command Shell.
I've also made sure to apt install wsl, dos2unix, and make.
I also ran into this problem. I did some debugging and the problem is that the dos2unix command tries to change the UNIX filesystem permissions of the temporary file it creates; this fails for me in WSL.
You need to tell WSL that it should allow these kinds of operations on the filesystem. You can do this as follows:
- Start your Ubuntu 18.04 LTS prompt
- Create/edit a file '/etc/wsl.conf'
- Add the following to '/etc/wsl.conf':
[automount] options = "metadata" - Save the file.
- Reboot your computer.
I have no idea why this works for some people but not others, but this worked for me and fixed the dos2unix permissions error; at which points I was able to create the BSP and everything else in Nios II EDS worked fine.