-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WSL2 file permission issues cause Buildroot and Yocto build failures. #5108
Comments
@therealkenc I've been able to reproduce the issue. Here are the steps (it's waaay long): wget https://bootlin.com/doc/training/buildroot/buildroot-labs.tar.xz The build fails at one point with the following error: _xzcat /home/moutinho/buildroot-labs/buildroot/dl/toolchain-external-arm-arm/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz | tar --strip-components=1 -C /home/moutinho/buildroot-labs/buildroot/output/build/toolchain-external-arm-arm-2019.12 --exclude='usr/lib/locale/' -xf - ror 1 I'm attaching the full build.log, just in case |
Yes, this was the first incarnation of the issue I ran into. I tried another branch of Buildroot and then encountered a mv that failed permissions even though the destination directory was created in the previous line of the script.There are some serious issues with scripts and permissions.
|
@therealkenc With some help from the guys from buildroot (https://buildroot.org/) development team, I was able to include an strace just before the mv command that fails.. I'm uploading the strace with the system calls here. But I'm affraid the syscall which seems to be failing isn't more enlightening: rename("/home/moutinho/buildroot-labs/buildroot/output/build/toolchain-external-arm-arm-2019.12/arm-none-linux-gnueabihf", "/home/moutinho/buildroot-labs/buildroot/output/host/opt/ext-toolchain/arm-none-linux-gnueabihf") = -1 EACCES (Permission denied) Oddly enough, if I run this same mv command AFTER the build fails, it works. |
Yes I'm sure there is a file permission clash between wsl2 and the Linux FS. It makes me wonder how many other users of wsl2 are using large build programs for other applications as I'm sure they would encounter this issue as well. Outside of the shell environment the commands all work, but of course that is not useful for us.RegardsED
|
Does it happen to work after you test disabling windows 10 User Account Control (UAC) ? I never noticed this in WSL1. |
Could never get it to build under wsl1 due to IPC/fakeroot issues. There were some hacks to get around that but they ceased to work ( according to reports) with wsl2. Unfortunately that error came at the very end of the Buildroot make and as stated, I cannot get the make to get past the permission errors. I disable UAC on my desktops. I also tried changing the wsl2 metadata settings and that did not fix it either.
RegardsEd
|
IPC/fakeroot issue has been fixed in WSL1. I haven't attempted a build in WSL2 yet |
On WSL1 that's /dupe #1529 et al. You want WSL2. |
Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
$ ll output/images/
total 13620
drwxr-xr-x 2 onoma onoma 4096 May 28 09:50 ./
drwxr-xr-x 6 onoma onoma 4096 May 28 09:50 ../
-rw-r--r-- 1 onoma onoma 60107 May 28 09:50 am335x-boneblack-wireless.dtb
-rw-r--r-- 1 onoma onoma 8007680 May 28 09:50 rootfs.tar
-rwxr-xr-x 1 onoma onoma 107444 May 28 09:38 u-boot-spl.bin*
-rw-r--r-- 1 onoma onoma 554701 May 28 09:38 u-boot.bin
-rwx------ 1 onoma onoma 765568 May 28 09:38 u-boot.img*
-rw-r--r-- 1 onoma onoma 4435856 May 28 09:50 zImage Following similar steps I can't reproduce on Windows 10 version 2004 using a brand new WSL2 Ubuntu 20.04 distro. There shouldn't be file permissions problems in WSL2 since it uses a lightweight VM with real ext4 filesystem. Maybe the problem happened in a converted (WSL1 -> WSL2) distro. |
That is because dupe #1529 does not manifest on WSL2 (except on 9p). |
There should not be I agree. But I'm not the only one to report shell script permission issues with wsl2. It was just the fact that I was using Buildroot and ran into these issues. I do not use UAC on m win10 version at all. I was using Ubuntu 18.04
LTS WSL2. Since this was a wsl2 issue it should NOT be marked as a dupe as the overall wsl2 architecture has changed dramatically over wsl1
|
How can this issue be labelled a dupe when the overall architecture has changed so drastically? It does not address the reported issue and the problem remains!!! |
If you're on wsl2 then this isn't #1529. |
How to reproduce permissions error under WSL 2 running Ubuntu 18.04 on Windows 10 2004: |
Thanks for the quick turnaround! {Note: before the Win10 2004 update my Ivy Bridge Core i-7 PC had been running WSL1. How to reproduce permissions error under WSL 2 running Ubuntu 20.04 on Windows 10 2004 build 19041.264 and WSL as per the attached jpg image (note it insists on using an old kernel): $ lsb_release -a |
What I meant was these are not reproduction steps that have a high degree of probability of leading to a WSL actionable. There are too many moving parts for you (sic) to identify a diverge even if there is one. Which isn't to suggest the effort isn't appreciated. I am a sucker for actual CLI repro steps. Unfortunately your layer thing doesn't seem to take with the steps above. But I managed to patch the
He means upgrading the distro (Ubuntu). You can wipe a distro from the start menu. Right click on "Ubuntu 20.04 LTS", then uninstall menu item. Then
No, and that is sort of the point. For all we know you could have been chasing a kernel bug, and for all we know still might. That is almost never the case. But an embedded Linux build would not be an especially effective way to find out, if it were. Or maybe you're chasing a 20.04 glibc bug. Or anything else that differs from 18.04 and 20.04. Hypervisor bug? Always possible, in extremis. But not likely if the premise here is you need 20.04 to trigger. That's userspace.
Takes a lotta RAM, that's fer sure. FWIW The chances this is actually an |
@gkenaley If your :~$ wsl.exe -l -v
NAME STATE VERSION
* Ubuntu-20.04 Running 2
Ubuntu-20.04.wsl1 Stopped 1
Alpine Stopped 2 |
Guh I didn't even see that (looked right through it). Thanks Onomatopellan. |
@onomatopellan Thank you - that got me actually running WSL 2. I did read/google substantial documentation when upgrading from WSL 1, but it's pretty sparse. Additionally, Powershell prompted me to install the kernel update "Windows Subsystem for Linux Update" 4.19.104 when I ran "wsl.exe --set-default-version 2". |
As an aside, I turn UAC off on my win10 machines. I did try changing the WSL2 permission options as well. Made no difference. On two differing win10 machines Buildroot craps out for the permission issues. I am going to try a Yocto build. I suspect I will see something similar.RegardsEd
|
You can, but the probability of you being able to turn "yocto build doesn't work" into a tight repro that would get dev attention is... very small. That is because you are on a real Linux kernel on a real ext4 filesystem (on a fake hard drive). [Without implication that doing so is impossible. Because anything possible.] What would be constructive is a screencap with the |
@edsyl At OP you are talking about metadata options and that's a thing only for |
I hope that this will be possible also with external drives. Not everyone has enough space to do builds in |
#1529 for that. Closing because the OP issue isn't going to make it to an actionable repro. There is a similar (but different) #2665 issue (message on down) which is instructive if one wanted to pursue this further and find an upstream work-around to building on |
WSL2 tries to do some translating between Linux and Windows filesystem conventions that apparently isn't perfect yet. But there's a trick by onomatopellan that uses a second minimal linux distro installed via WSL2: How to automount an external vhdx file in WSL2 After that you will have a mount point /mnt/wsl/Alpine. Make sure that all your working directories are located there. After the build is done a post-build script can copy the output to /mnt/c/whatever which will be accessible from the Windows side. |
@Pixelpunker To have a second distro is the best workaround so far. Works also with official distros available here: https://docs.microsoft.com/en-us/windows/wsl/install-manual
|
This file permission issue manifests itself in many ways. For embedded Linux development, the ability to run and configure Yocto and Buildroot is mandatory. Unfortunately neither build tool completes due to inexplicable file permission errors. Doing exactly the same on Mint19.3 completes with no issues.
I have tried the metadata options to no avail. I'm afraid that wsl2 is anon-starter for Embedded Linux devs on Win10.
Too bad because wsl2 is great in other ways.
Easy to reproduce. From bootlin, download the buildroot lab manual and follow the instructions. Have verified this with multiple buildroot branches as well.
https://bootlin.com/doc/training/buildroot
The text was updated successfully, but these errors were encountered: