What's new

[Dev] Documentation for building the firmware under WSL2

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Could someone point me in the right direction for compiling the RT-ax88u? I know, if I have to ask then I probably shouldn’t be doing it but I’m a tinkerer and would like to learn. I’ve been using amcfwm to do it the easy way.

amcfwm is working very well here, using it ...
 
Can't do that, no graphical support yet. But they already announced that graphical support was under development.
With a bit of perseverance, I have LXDE running in an Ubuntu 18.04 WSL2 instance :)

upload_2020-5-30_10-14-54.png
 
Here is what fixed mine
Code:
wsl --list --verbose
wsl --set-version <distribution name> <versionNumber>
wsl --set-default-version 2

this allowed me to view already installed distributions and set them to level 2
and it allowed me to set the default version to level 2 as well so any new installed versions will get installed as 2
 
I'm probably doing something wrong with my wsl2 ubuntu 20, as i'm getting the following error trying to compile master:

Code:
/opt/toolchains/crosstools-arm-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/bin/arm-buildroot-linux-gnueabi-gcc -shared  .libs/bitmath.o .libs/bitreader.o .libs/bitwriter.o .libs/cpu.o .libs/crc.o .
libs/fixed.o .libs/float.o .libs/format.o .libs/lpc.o .libs/md5.o .libs/memory.o .libs/metadata_iterators.o .libs/metadata_object.o .libs/stream_decoder.o .libs/stream_encoder.o .libs/stream_encoder_framing.o .libs/window.o .libs/ogg_decoder_aspect.o .libs/ogg_encoder_aspect.o .libs/ogg_helper.o .libs/ogg_mapping.o  -Wl,--rpath -Wl,/home/demon/amng-build/release/src-rt-5.02hnd/bcmdrivers/broadcom/net/wl/bcm94908/main/src/router/libogg/src/.libs -L/home/demon/amng-build/release/src-rt-5.02hnd/bcmdrivers/broadcom/net/wl/bcm94908/main/src/router/libogg/src/.libs -lm -L/lib /home/demon/amng-build/release/src-rt-5.02hnd/bcmdrivers/broadcom/net/wl/bcm94908/main/src/router/libogg/src/.libs/libogg.so  -march=armv7-a -marm -Wl,--gc-sections -Wl,-soname -Wl,libFLAC.so.8 -o .libs/libFLAC.so.8.2.0
arm-buildroot-linux-gnueabi-gcc: WARNING: unsafe header/library path used in cross-compilation: '/lib'
/home/demon/am-toolchains/brcm-arm-hnd/crosstools-arm-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/bin/../lib/gcc/arm-buildroot-linux-gnueabi/5.3.0/../../../../arm-buildroot-linux-gnueabi/bin/ld: warning: library search path "/lib" is unsafe for cross-compilation
/lib/libgcc_s.so.1: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make[7]: *** [Makefile:489: libFLAC.la] Error 1
make[7]: Leaving directory '/home/demon/amng-build/release/src/router/flac/src/libFLAC'
make[6]: *** [Makefile:605: all-recursive] Error 1
make[6]: Leaving directory '/home/demon/amng-build/release/src/router/flac/src/libFLAC'
make[5]: *** [Makefile:4324: flac] Error 2
make[5]: Leaving directory '/home/demon/amng-build/release/src/router'
make[4]: *** [Makefile:30: router_all] Error 2
make[4]: Leaving directory '/home/demon/amng-build/release/src-rt-5.02hnd/userspace'
make[3]: *** [make.hndrt:211: userspace] Error 2
make[3]: Leaving directory '/home/demon/amng-build/release/src-rt-5.02hnd'
make[2]: *** [make.hndrt:19: parallel_targets] Error 2
make[2]: Leaving directory '/home/demon/amng-build/release/src-rt-5.02hnd'
make[1]: *** [Makefile:3986: bin] Error 2
make[1]: Leaving directory '/home/demon/amng-build/release/src-rt-5.02hnd'
make: *** [Makefile:4122: rt-ac86u] Error 2
 
i'm getting the following error trying to compile master:

Master is not in a compilable state. You must use mainline or ax.
 
Try this part of the Wiki:
https://github.com/RMerl/asuswrt-merlin.ng/wiki/Compile-Firmware-from-source-using-Ubuntu

Once you clone the repository, look for the directory src-rt-5.02axhnd. That should get you in the correct spot.

Good luck.

I must say though - amcfwm us quite a bit easier...

Using amcfwm I discovered that directory needed for an ax88u build (don't know how I missed that when I looked at the repo...), and learned that I shouldn't stress about not being able to find where the rt-ax88u build target is defined, and "make rt-ax88u" should then be all that's needed assuming everything else is setup properly (as per the wiki article).

Don't really see a need build outside amcfwm now since I got my ax88u build using it.

Ian
 
Try this part of the Wiki:
https://github.com/RMerl/asuswrt-merlin.ng/wiki/Compile-Firmware-from-source-using-Ubuntu

Once you clone the repository, look for the directory src-rt-5.02axhnd. That should get you in the correct spot.

Good luck.

I must say though - amcfwm us quite a bit easier...

I followed all the directions on the WSL2 as described (along with Ubuntu 18.04 install) but the arc-5.02axhnd directory is not downloaded under the release subfolder. I also tried to clone repository again and and it still did not download. All the other directories, for example, src-rt-5.02hnd for RT-AC86U and others are there but not the one for AX88U. Was able to compile RT-AC86U just fine as well but couldn’t do so for RT-AX88U as it specifically asks for the axhnd directory.

With amcfwm everything for RT-AX88U downloads and compiles just fine.


Sent from my iPhone using Tapatalk
 
I followed all the directions on the WSL2 as described (along with Ubuntu 18.04 install) but the arc-5.02axhnd directory is not downloaded under the release subfolder.

That code is in the ax branch, not the master or mainline branch.
 
That code is in the ax branch, not the master or mainline branch.

Yes I realized that was the case after exploring that number of releases in my Ubuntu folder. Since you have shown examples of how to setup the toolchains and create a build environment for AC86U would you be able to add an example in Wiki on how to do the same for an ax router? No problem if you can’t. I realize that you are very busy so I completely understand. This would definitely make this section more complete.

As I mentioned above, I followed all your instructions in WSL2 post as well ad the one on how to compile firmware in Ubuntu (in Wiki). I was under the impression that the instructions would include all ax releases too but didn’t realize that I had to do that separately.

I also looked at @Adamm’s script and realized what the “release” directory was for AX88U (scr-5.02 axhnd) but didn’t know how to incorporate it in my Ubuntu directories that I had downloaded previously. I tried to clone it from Girhub but for some reason I couldn’t get it to download in my Ubuntu as it kept giving me an error that the file existed. When I downloaded the file separately in my PC, I was able to see the ax zip file (a large one).

Anyway, I am still learning on how to do all of this so I will keep trying on figuring it out. At least it made it for a good weekend project so I am happy about that.


Sent from my iPhone using Tapatalk
 
would you be able to add an example in Wiki on how to do the same for an ax router

The Wiki article already documents how to setup the toolchain for all platforms. You just need to checkout the appropriate branch before entering the SDK's directory and issuing the build command.
 
For those wondering what this is: Windows Subsystem for Linux (or, WSL) is a Linux environment that runs within Windows 10.

WSL2, introduced with the freshly released Windows 10 version 2004 is a major improvement, as instead of emulating system calls, it sits on top of a real Linux kernel, that runs inside a lightweight Hyper-V VM. This allows it to gain very high compatibility, in addition to greatly improving performance over the original WSL.

Despite being actually a VM, it's a light-weight, specialized VM, which will start and stop transparently as needed, and very quickly.

In the future, WSL will even be gaining GPU acceleration and video support, which means we will even be able to eventually run Linux GUI applications from within Windows.
woah...Darmoc and Gilaad on the ocean? The impending death of putty? everyone being nano-familiar, if not fluent?
 
Set it up on WSL for the first time and all went smooth. Apart from just building, I'm looking to experiment a bit and would like to ask, is there a recommended way to go about testing/debugging without having to re-flash for every single change, like for example, making changes to an existing page. Is there any way to emulate a router locally so to speak or something similar?

Thanks
 
Set it up on WSL for the first time and all went smooth. Apart from just building, I'm looking to experiment a bit and would like to ask, is there a recommended way to go about testing/debugging without having to re-flash for every single change, like for example, making changes to an existing page. Is there any way to emulate a router locally so to speak or something similar?

Thanks

There's no emulation. If you want to make webui changes, then you can work on a writable copy of the file, and bind mount it on top of the flash version. Quick example:

Code:
cp /www/QoS_EZ_QoS.asp /tmp/
mount -o bind /tmp/QoS_EZ_QoS.asp /www/QoS_EZ_QoS.asp
nano -w /tmp/QoS_EZ_QoS.asp

That way, your webui will use the writable copy located in the /tmp folder. You can put it in /jffs/ instead if you want to avoid losing it after a reboot.

You can also copy the original file from the firmware source tree (using scp), however every translated strings will come up as "English" instead of the actual string, because pages are pre-processed at compile time to insert tags indexes in place of the actual tag names.

As for executables, it depends. If it's a simple static exe (like httpd), you can also bind mount it (stopping it first). But for anything tied to rc or the libraries, you will need to flash an image.
 
Similar threads
Thread starter Title Forum Replies Date
finlay000 Selecting Adaptive QoS generates Init chrdev /dev/idp with major 190 Asuswrt-Merlin 2

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top