What's new

Cannot build from src-rt-5.02axhnd RT-AX88U (master branch)

  • 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!

adv3

Occasional Visitor
after merging 386.8 cannot build from the source:

make RT-AX88U
....
....
make -C /home/env/asuswrt-merlin.ng/release/src-rt-5.02axhnd/kernel/linux-4.1 oldnoconfig && \
true && \
touch prek;
make[4]: Entering directory '/home/env/asuswrt-merlin.ng/release/src-rt-5.02axhnd/kernel/linux-4.1'
make[5]: '../../.config' is up to date.
scripts/kconfig/conf --olddefconfig Kconfig
../../bcmdrivers/Kconfig.autogen:2: syntax error
Kconfig.bcm:1596: missing end statement for this entry
Kconfig.bcm:3: missing end statement for this entry
Kconfig:15: missing end statement for this entry
../../bcmdrivers/Kconfig.autogen:1: invalid statement
Kconfig.bcm:1598: unexpected end statement
Kconfig.bcm:1600: unexpected end statement
Kconfig:20: unexpected end statement
make[5]: *** [scripts/kconfig/Makefile:84: olddefconfig] Error 1
make[4]: *** [Makefile:573: oldnoconfig] Error 2
make[4]: Leaving directory '/home/env/asuswrt-merlin.ng/release/src-rt-5.02axhnd/kernel/linux-4.1'
make[3]: *** [make.hndrt:455: prek] Error 2
make[3]: Leaving directory '/home/env/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
make[2]: *** [Makefile:5876: setprofile] Error 2
make[2]: Leaving directory '/home/env/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
make[1]: *** [Makefile:5616: bin] Error 2
make[1]: Leaving directory '/home/env/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
make: *** [Makefile:5825: RT-AX88U] Error 2


any clues, suggestions?
 
Make sure you've selected "No" when you
Code:
sudo dpkg-reconfigure dash
-- I also saw this link which suggested symlinking bash to sh (Google Translate: https://www-cnblogs-com.translate.g...sl=zh-CN&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=sc )

Reconfiguring dpkg dash and selecting "No" was my fix though

EDIT / UPDATE:

Uh, well that fixed the first error, now I have another:

Code:
...
configure.ac:938: warning: macro 'AM_PATH_GPGME' not found in library
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /home/tester/amng-build/release/src/router/wget/build-aux/missing autoconf
cd . && /bin/sh /home/tester/amng-build/release/src/router/wget/build-aux/missing automake-1.16 --gnu
configure.ac:33: error: possibly undefined macro: AX_CODE_COVERAGE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
make[7]: *** [Makefile:1725: configure] Error 1
make[7]: *** Waiting for unfinished jobs....
make[7]: Leaving directory '/home/tester/amng-build/release/src/router/wget'
make[6]: *** [Makefile:7268: wget] Error 2
make[6]: Leaving directory '/home/tester/amng-build/release/src/router'
make[5]: *** [Makefile:30: router_all] Error 2
make[5]: Leaving directory '/home/tester/amng-build/release/src-rt-5.02axhnd/userspace'
make[4]: *** [make.hndrt:329: userspace] Error 2
make[4]: Leaving directory '/home/tester/amng-build/release/src-rt-5.02axhnd'
make[3]: *** [make.hndrt:115: parallel_targets] Error 2
make[3]: Leaving directory '/home/tester/amng-build/release/src-rt-5.02axhnd'
make[2]: *** [Makefile:695: all] Error 2
make[2]: Leaving directory '/home/tester/amng-build/release/src-rt-5.02axhnd'
make[1]: *** [Makefile:5617: bin] Error 2
make[1]: Leaving directory '/home/tester/amng-build/release/src-rt-5.02axhnd'
make: *** [Makefile:5825: rt-ax88u] Error 2

Double Edit:

Resolved that by installing autoconf-archive
 
Last edited:
thanks!
wiki is pretty outdated. after a lot of additional installations I got next error:

Code:
Untarring xz-5.0.3 source...

XZ Utils 5.0.3

System type:
checking build system type... build-aux/config.guess: unable to guess system type

This script, last modified 2009-11-20, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If the version you run (build-aux/config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.

config.guess timestamp = 2009-11-20

uname -m = aarch64
uname -r = 5.15.0-46-generic
uname -s = Linux
uname -v = #49-Ubuntu SMP Thu Aug 4 18:08:11 UTC 2022

/usr/bin/uname -p = aarch64
/bin/uname -X     =

hostinfo               =
/bin/universe          =
/usr/bin/arch -k       =
/bin/arch              = aarch64
/usr/bin/oslevel       =
/usr/convex/getsysinfo =

UNAME_MACHINE = aarch64
UNAME_RELEASE = 5.15.0-46-generic
UNAME_SYSTEM  = Linux
UNAME_VERSION = #49-Ubuntu SMP Thu Aug 4 18:08:11 UTC 2022
configure: error: cannot guess build type; you must specify one
make[3]: *** [Makefile:148: config_xz-5.0.3] Error 1
make[3]: Leaving directory '/home/parallels/amng.ax88/release/src-rt-5.02axhnd/hostTools'
make[2]: *** [make.hndrt:725: hosttools] Error 2
make[2]: Leaving directory '/home/parallels/amng.ax88/release/src-rt-5.02axhnd'
make[1]: *** [Makefile:5617: bin] Error 2
make[1]: Leaving directory '/home/parallels/amng.ax88/release/src-rt-5.02axhnd'
make: *** [Makefile:5825: rt-ax88u] Error 2

upd. added --build=aarch64-unknown-linux-gnu to Makefile (in hostTools), compilation went further, got another error:

Code:
/usr/bin/ld: mksquashfs.o: in function `scan1_single_readdir':
mksquashfs.c:(.text+0x214): undefined reference to `add_dir_entry'
/usr/bin/ld: mksquashfs.o: in function `scan1_encomp_readdir':
mksquashfs.c:(.text+0x79d4): undefined reference to `add_dir_entry'
/usr/bin/ld: mksquashfs.o: in function `dir_scan2':
mksquashfs.c:(.text+0x840c): undefined reference to `add_dir_entry'
/usr/bin/ld: mksquashfs.c:(.text+0x8554): undefined reference to `add_dir_entry'
/usr/bin/ld: mksquashfs.o: in function `dir_scan1':
mksquashfs.c:(.text+0xa4a4): undefined reference to `add_dir_entry'
/usr/bin/ld: mksquashfs.o:mksquashfs.c:(.text+0xa5c8): more undefined references to `add_dir_entry' follow
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:209: mksquashfs] Error 1
make[4]: Leaving directory '/home/parallels/amng.ax88/release/src-rt-5.02axhnd/hostTools/squashfs_4.2'
make[3]: *** [Makefile:166: mksquashfs] Error 2
make[3]: Leaving directory '/home/parallels/amng.ax88/release/src-rt-5.02axhnd/hostTools'
make[2]: *** [make.hndrt:725: hosttools] Error 2
make[2]: Leaving directory '/home/parallels/amng.ax88/release/src-rt-5.02axhnd'
make[1]: *** [Makefile:5617: bin] Error 2
make[1]: Leaving directory '/home/parallels/amng.ax88/release/src-rt-5.02axhnd'
make: *** [Makefile:5825: rt-ax88u] Error 2

any suggestions?
 
Last edited:
manual configuration is not working for me, unfortunately. trying to use amcfwm (thanks to @Adamm !), but getting the error above

Ubuntu 22.04 arm64 - VM is on Mac M1.
@RMerlin can it be the reason of these failures?
 
Last edited:
manual configuration is not working for me, unfortunately. trying to use amcfwm (thanks to @Adamm !), but getting the error above

Ubuntu 22.04 arm64 - VM is on Mac M1.
@RMerlin can it be the reason of these failures?
I don't know, I haven't tested Ubuntu 22.04, I use 20.04 here.
 
I'm not sure on the Mac instructions, but the instructions for building from source for Linux are accurate-- I too am using Ubuntu 20.04.3 LTS and as above, needed to validate my Dash was set to 'No' and that I apt installed autoconf-archive; 20.04 seems reliable.
 
the thing is that I'm using the ARM64 version of Ubuntu. tested both 20.04 and 22.04. it seems I need AMD64, and run my VM on Windows laptop
 
You sure you set up your toolchain correctly? Might be worth restarting from the beginning if you're not sure, only takes a few!
 
yes, I'm. without toolchain it wouldn't go further. several times I've started from the beginning. will try AMD64 version
 
I know that the toolchain requires 32-bit versions of some of the libraries to be installed even if the OS itself is 64-bit, so that might also extend to these having to be x86 and not working with ARM versions.
 
I've added them by
Code:
sudo dpkg --add-architecture i386
at the beginning, but it only seems to work halfway
 
Hello. This is my first post here at snbforums i wanted to open an issue for this since it wasnt a solution i trying to get some help in this thread.

Did you find any fix for this issue? I actually have the same problem for RT-AX88U tag 888_82, and I have tried to find the problem that is causing the addition of -e on line 1 of Kconfig.autogen

However:

While compiling the kernel, I'm encountering a syntax error with the Kconfig.autogen file. The build process is appending a -e at the start of the Kconfig.autogen file, which is causing the make process to fail due to syntax errors.

Here's the output of the build error:

Code:
make[4]: Entering directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd/kernel/linux-4.1'
make[5]: '../../.config' is up to date.
scripts/kconfig/conf  --olddefconfig Kconfig
../../bcmdrivers/Kconfig.autogen:2: syntax error
Kconfig.bcm:1596: missing end statement for this entry
Kconfig.bcm:3: missing end statement for this entry
Kconfig:15: missing end statement for this entry
../../bcmdrivers/Kconfig.autogen:1: invalid statement
Kconfig.bcm:1598: unexpected end statement
Kconfig.bcm:1600: unexpected end statement
Kconfig:20: unexpected end statement
scripts/kconfig/Makefile:84: recipe for target 'olddefconfig' failed
make[5]: *** [olddefconfig] Error 1
Makefile:573: recipe for target 'oldnoconfig' failed
make[4]: *** [oldnoconfig] Error 2
make[4]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd/kernel/linux-4.1'
make.hndrt:446: recipe for target 'prek' failed
make[3]: *** [prek] Error 2
make[3]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
Makefile:6252: recipe for target 'setprofile' failed
make[2]: *** [setprofile] Error 2
make[2]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
Makefile:5975: recipe for target 'bin' failed
make[1]: *** [bin] Error 2
make[1]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
Makefile:6211: recipe for target 'rt-ax88u' failed
make: *** [rt-ax88u] Error 2

Even though I manually remove -e from the start of Kconfig.autogen, it reappears when I attempt to build again, leading me to believe it's being generated by some part of the build process.

I would appreciate any guidance or suggestions on how to resolve this issue.

The problem seems to start here:

Code:
wrt-merlin.ng/release/src-rt-5.02axhnd/bcmdrivers/broadcom/net/wl/bcm94908/main/src/router/.config model-desc.mak make.hndrt'
MY_DEFAULT_ANY_FIRST_RUN='0' MY_MKENV_FIRST_RECURSION='0'
Makefile:708: warning: overriding recipe for target 'all'
make.hndrt:55: warning: ignoring old recipe for target 'all'

It appears that the part of the script that generates Kconfig.autogen is using echo -e to create the file:

Code:
cd /root/asuswrt-merlin.ng/release/src-rt-5.02axhnd/bcmdrivers; echo -e "\n# Automatically generated file -- do not modify manually\n\n" > Kconfig.autogen.tmp

In this case, echo -e enables the interpretation of backslash escape sequences. The problem seems to be that the -e flag is actually being printed in the Kconfig.autogen file.

I will try modifying the script to avoid the -e flag being written to the file. It might be the case that my currrent shell are running a shell that does not support the -e option with echo, causing it to be treated as a string to be printed instead. I will try using /bin/echo to ensure I am using the built-in echo command, and perhaps printf .

Code:
cd /root/asuswrt-merlin.ng/release/src-rt-5.02axhnd/bcmdrivers; /bin/echo -e "\n# Automatically generated file -- do not modify manually\n\n" > Kconfig.autogen.tmp

Code:
cd /root/asuswrt-merlin.ng/release/src-rt-5.02axhnd/bcmdrivers; printf "\n# Automatically generated file -- do not modify manually\n\n" > Kconfig.autogen.tmp

It's difficult to determine exactly which part of the script needs to be changed without seeing the entire code without knowing exactly how this is being done.

To provide more context, I want to reiterate that I am running Gentoo Linux and im working with a toolchain inside Docker from the repository https://github.com/Acris/docker-asuswrt-merlin-build to build the firmware. The environment was set up using the script /root/env/bcm-hnd-802.11ax.sh. Based on this setup, I have thoroughly reviewed my environment and currently, I don't suspect any issues in this regard

Regards, wuseman
 
Last edited:
Alright, it seems to fix the issue by adding /bin/echo instead that can be done with:

Code:
sed -i.bak '393s/-e//' /root/asuswrt-merlin.ng/release/src-rt-5.02axhnd/make.hndrt

However, now im stuck here:

Code:
fi;
echo "make rt_ver "
make rt_ver
make[3]: Entering directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
shell is /bin/sh.  Bash version is
***************************************************
ERROR: /bin/sh does not invoke bash shell
***************************************************
/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd/make.common:3208: recipe for target 'prebuild_checks' failed
make[2]: *** [prebuild_checks] Error 1
make[2]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
Makefile:5975: recipe for target 'bin' failed
make[1]: *** [bin] Error 2
make[1]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
Makefile:6211: recipe for target 'rt-ax88u' failed
make: *** [rt-ax88u] Error 2
And im tried to follow up this by the tips in this thread with changing to dash:

Code:
root@2ab1e35e1995:~/asuswrt-merlin.ng/release/src-rt-5.02axhnd# dpkg-reconfigure dash
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Configuring dash
----------------

The system shell is the default command interpreter for shell scripts.

Using dash as the system shell will improve the system's overall performance. It does not alter the shell presented to interactive users.

Use dash as the default system shell (/bin/sh)? [yes/no] yes

Without luck, also tried:

Code:
rm /bin/sh
ln -s /bin/bash /bin/sh

And that worked and now I see "shell is /bin/sh. Bash version is 4.4.12(1)-release"

Code:
echo "make rt_ver "
make rt_ver
make[3]: Entering directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
shell is /bin/sh.  Bash version is 4.4.12(1)-release
***************************************************
ERROR: Attempting to build as root.
***************************************************
/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd/make.common:3208: recipe for target 'prebuild_checks' failed
make[2]: *** [prebuild_checks] Error 1
make[2]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
Makefile:5975: recipe for target 'bin' failed
make[1]: *** [bin] Error 2
make[1]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
Makefile:6211: recipe for target 'rt-ax88u' failed
make: *** [rt-ax88u] Error 2

And now i needed to update the repo and since that is to old on this docker it seems, i edited the /etc/apt/source.list to

Code:
deb http://archive.debian.org/debian/ stretch main
deb-src http://archive.debian.org/debian/ stretch main

and run:

Code:
apt update
apt install sudo
useradd -m wuseman
su wuseman
sudo mv /root/asus*/home/wuseman
chown -R wuseman:wuseman /home/wuseman
cp ./bcmdrivers/broadcom/net/wl/impl51/main/components/opensource/jsonc/installbin/include/json-c/json_config.h /root/asuswrt-merlin.ng/release/src-rt-5.02axhnd/bcmdrivers/broadcom/net/wl/bcm94908/main/src/router/json-c/json_config.h
cd /home/wuseman/asus-merlin.ng/release/src-rt-5.02axhnd
make $(($(nproc) +1 )) rt-ax88u
And now it compiles fine until here:

Code:
  CC      fs/ubifs/lpt.o
  CC      fs/ubifs/lprops.o
  CC      fs/ubifs/recovery.o
  CC      fs/ubifs/ioctl.o
  CC      fs/ubifs/lpt_commit.o
  CC      fs/ubifs/tnc_misc.o
  CC      fs/ubifs/xattr.o
  CC      fs/ubifs/debug.o
  LD      fs/ubifs/ubifs.o
  LD      fs/ubifs/built-in.o
  LD      fs/built-in.o
make[5]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd/kernel/linux-4.1'
make.hndrt:480: recipe for target 'inner_kernelbuild' failed
make[4]: *** [inner_kernelbuild] Error 2
make[4]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
make.hndrt:473: recipe for target 'kernelbuild' failed
make[3]: *** [kernelbuild] Error 2
make[3]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
Makefile:708: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
Makefile:5975: recipe for target 'bin' failed
make[1]: *** [bin] Error 2
make[1]: Leaving directory '/root/asuswrt-merlin.ng/release/src-rt-5.02axhnd'
Makefile:6211: recipe for target 'rt-ax88u' failed
make: *** [rt-ax88u] Error 2

and then i tried

Code:
make clean # wich works fine
patch kernel/linux-4.1/config_base.6a < my_patch.patch # repatching
make $(($(nproc) +1 )) rt-ax88u

And finally, it's compiled and ready. I apologize for the messy post; I wrote everything as the errors occurred one after another. So, anyone who gets stuck in the same situation can follow the steps I've written. However, I'll be creating a tutorial for this process, as it can be quite challenging for someone completely new and unfamiliar with the process, even though it should be relatively straightforward. The existing guides are definitely not up-to-date.

Cheers!
 
Last edited:
Im sorry for the tripple post, but i guess this can help someone.

I found that using the toolchain provided by https://github.com/gnuton/Asuswrt-Merlin-Toolchains-Docker made everything much easier:

The entire process of enabling LUKS (Linux Unified Key Setup) with Twofish encryption in the firmware for RT-AX88U is as follows if someone is interested, thats it:


1. Clone the asuswrt-merlin.ng repository:

Code:
git clone https://github.com/RMerl/asuswrt-merlin.ng
cd asuswrt-merlin.ng

2. Pull the latest version of the toolchain Docker image:

Code:
docker pull gnuton/asuswrt-merlin-toolchains-docker:latest

3. Run the Docker container with the toolchain:

Code:
docker run -it --rm -v "$PWD:/build" -u "docker:docker" gnuton/asuswrt-merlin-toolchains-docker:latest /bin/bash

4. Set up the environment and navigate to the source directory:

Code:
source /home/docker/envs/bcm-hnd-802.11ax.sh
cd /build/asuswrt-merlin.ng/release/src-rt-5.02axhnd

5. Apply the patch to the config file:

Code:
echo '--- kernel/linux-4.1/config_base.6a     2023-08-03 06:48:39.360004946 +0000
+++ /root/config.base.added.conf        2023-08-03 06:45:40.233338143 +0000
@@ -1191,7 +1191,7 @@
# CONFIG_SCSI_DH is not set
# CONFIG_SCSI_OSD_INITIATOR is not set
# CONFIG_ATA is not set
-# CONFIG_MD is not set
+CONFIG_MD=y
# CONFIG_TARGET_CORE is not set
# CONFIG_FUSION is not set

@@ -2420,7 +2420,7 @@
CONFIG_CRYPTO_ECB=y
# CONFIG_CRYPTO_LRW is not set
# CONFIG_CRYPTO_PCBC is not set
-# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_XTS=m

#
# Hash modes
@@ -2467,7 +2467,7 @@
# CONFIG_CRYPTO_SEED is not set
# CONFIG_CRYPTO_SERPENT is not set
# CONFIG_CRYPTO_TEA is not set
-# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_TWOFISH=m

#
# Compression
@@ -2980,3 +2980,9 @@
CONFIG_CIFS_SMB2=y
CONFIG_ASSOCIATIVE_ARRAY=y


CONFIG_BLK_DEV_DM=m
CONFIG_DM_CRYPT=m' | patch -i - $HOME/asuswrt-merlin.ng/release/src-rt-5.02axhnd/kernel/linux-4.1/config_base.6a

After pasting the patch data, press `Enter`, and then `Ctrl + D` on Linux/Unix systems to indicate the end of the input. The patch will be applied directly to the specified target file.

5. Compile kernel

Code:
make -j$(($(nproc) + 1 ))

6. Flash firmware

Done
 
Last edited:

Similar 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