[Solved] Problem compiling firmware on WSL1 [Solved]

i didn't test it but in theory wsl2 should be nothing than a very basic vm so... in theory if not problem comes up with a buildroot in a vm then should be the same with wsl2... will test it later

I am using WSL1.
I will do everything from scratch.

  1. Uninstall Ubuntu
  2. Install WSL2
  3. Reinstall Ubuntu
  4. Compile Openwrt again.

Before WLS, I used VirtualBox.
I started using WLS on my computer because the speed is much higher than VirtualBox to compile Openwrt.

Juliano

wsl2 should have been backported to old windows build so i advice to switch to it if you don't have any reason to stick with wsl1

1 Like

Wsl2 does not work if you want also virtualbox.

(wsl2 requires level0 hardware level virtualization (by "hyper-v"), and currently virtualbox does not like that.

there are beta build that supports that but there are some bug (bugs with hash generation) and it's really slow... so yes if someone needs to use vm and doesn't use hyper-v, wsl2 is a no go...


Anyway can confirm that openwrt compiles good with latest commits on wsl2

2 Likes

Hi.

The WLS2 doesn´t work on my computer (Xeon 5450), i think that my processor doesn´t fully suppport Hyper-V.

Anyway, i´m reinstalled Ubuntu on WSL1, Openwrt is compiling again. Lets see what gonna happen.

I´m installing LinuxMint on VirtualBox too, in case it doesn´t work again in WLS1.

Juliano

UPDATE:

Same problem as before.
Conclusion: Openwrt buildsystem doesn´t work anymore with Windows10 WSL1.

What is the error?

Hello @Ansuel

I uploaded the logs today, see my earlier posts.
Looks like a problem with "fakeroot" (i don´t know what is that).
None of the packages compile anymore and images are not generated correctly.

About WLS2: My processor does not support Hyper-V SLAT and that is a requiriment to WLS2 works.

Juliano

The fakeroot has only been applied to master.

So,you could try building 19.07 to see if the wsl1 problem is only related to master.

Hi @hnyman

The reason I compile my own firmware is to be able to test the latest updates made in the master branch.
Doing this with version 19.07 is not justified.

One question: Does VirtualBox run faster on your computer? Here it takes about 12 hours to compile Openwrt from scratch.
With WSL1 it took a maximum of 2 hours.

Thanks.
Juliano

I compile the tools+toolchain in about 20 minutes, but that needs to be done rarely.
The normal target firmware compilation takes something like 12 minutes (with "-j 5" make, as I use 4 CPU cores).
But my buildhost is rather top-end:

Ubuntu 20.04 in Virtualbox 6.1.2 in Windows 10 20.04, with Intel i7-9700 8core CPU, of which 4 cores are allocated to Virtualbox.
I have only SSD disks, no traditional hard disks.
(16 GB RAM, of which Virtualbox sees 6 GB, I think.)

It might be justified for investigating if your problems are tied to

  • master itself, maybe due to the newest changes, or
  • any OpenWrt version in your build env.

Right now you only know that master is incompatible.

Strange, i don´t know why Virtualbox runs so slow on my computer.
Could the problem be LinuxMint?
I am using LinuxMint because it´s easier to transfer the compiled files to Windows.
I need to research first how to do this in Ubuntu if I want to test.

I will try to compile 19.07 to test.
Should i try the stable version or the 19.07 master?

Juliano

There is no 19.07 master.

Master is the main development branch
19.07 is the stable branch

Hi.

I talked to Daniel Golle, who made the changes in the fakeroot, look this answer.

interesting, WSL1 doesnt't support SYSV IPC.

fakeroot, while creating message channels: Function not implemented
This may be due to a lack of SYSV IPC support.

So we can use TCP instead.
Please try the patch attached and rebuild fakeroot using
make tools/fakeroot/{clean,compile}

Is there a way to tell we are running under WSL1 which could be
handled automatically in tools/fakeroot/Makefile ?

He send me a patch, that include this line in fakeroot Makefile.

HOST_CONFIGURE_ARGS += --with-ipc=tcp

The behavior has changed.
Now the packages are generated, but there are still problems to generate .bin files.
Only "-initramfs-kernel.bin" . is ok. "-tftp-recovery.bin" and "-sysupgrade.bin" has only 1 kb.

I sent to him the logs. (It is on my google drive too).
I think we will find a solution.

Juliano

UPDATE:

The problem now is mksquashfs4.
Strange, this wasn´t changed in the latest commits.
Can someone help?

Juliano

/home/juliano-linux/openwrt_ramips/openwrt/staging_dir/host/bin/mksquashfs4 /home/juliano-linux/openwrt_ramips/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips /home/juliano-linux/openwrt_ramips/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/root.squashfs -nopad -noappend -root-owned -comp xz -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2  -b 256k -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1' -processors 1
FATAL ERROR:nanosleep failed in progress thread

Suddenly my Debian WSL stopped building OpenWRT, later I figured out it was WSL1 so I updated to WSL2 and installed Ubuntu 20.04, build it's working again such strange MS bug cause Windows 2004 should be using WSL2 by default.

Hi,

Problem solved.

The cause was Ubuntu 20.04 LTS.
I changed to 18.04 LTS and the files were generated correctly.
With Debian also worked.

Thanks to Daniel Golle (dangowrt) for the patch.

Juliano

P.S.: WSL2 works OK with OpenWRT. This patch is only necessary for WSL1 systems.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.