RUT906 firmware compilation issues

Hi all. I am trying to compile the standard image for a RUT906 before making some customizations (changing the base IP, removing unused services, integrating Python). I’ve downloaded the latest SDK, RUT9M_R_GPL_00.07.08.2.tar.gz, and I’ve tried to compile it both on a fully compliant Ubuntu 22.04 and in Docker (which is the recommended way), but I keep receiving the same error.

If I try to compile for the default target (RUT9M), the image is created successfully. However, when I switch to RUT906 using make menuconfig, the final stage of the compilation process ends with errors.

I can see with make -j1 V=s :

Creating 4.0 filesystem on /home/user/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/root.squashfs, block size 65536.
[=============================================================|] 3850/3850 100%

Exportable Squashfs 4.0 filesystem, xz compressed, data block size 65536
        compressed data, compressed metadata, compressed fragments,
        compressed xattrs, compressed ids
        duplicates are removed
Filesystem size 11225.61 Kbytes (10.96 Mbytes)
        37.58% of uncompressed filesystem size (29870.12 Kbytes)
Inode table size 26702 bytes (26.08 Kbytes)
        19.34% of uncompressed inode table size (138059 bytes)
Directory table size 40670 bytes (39.72 Kbytes)
        38.73% of uncompressed directory table size (105000 bytes)
Number of duplicate files found 603
Number of inodes 4174
Number of files 3621
Number of fragments 212
Number of symbolic links  369
Number of device nodes 1
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 183
Number of ids (unique uids + gids) 1
Number of uids 1
        root (0)
Number of gids 1
        root (0)
echo "EXECUTING  for openwrt-ramips-mt76x8-TEMPLATE_teltonika_rut906-squashfs-sysupgrade.bin and adding /home/user/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/TEMPLATE_teltonika_rut906-kernel.bin /home/user/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/root.squashfs "
EXECUTING  for openwrt-ramips-mt76x8-TEMPLATE_teltonika_rut906-squashfs-sysupgrade.bin and adding /home/user/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/TEMPLATE_teltonika_rut906-kernel.bin /home/user/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/root.squashfs 
[ -f /home/user/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/TEMPLATE_teltonika_rut906-kernel.bin -a -f /home/user/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/root.squashfs ]
make[5]: *** [Makefile:23: /home/user/sdk/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/tmp/openwrt-ramips-mt76x8-TEMPLATE_teltonika_rut906-squashfs-sysupgrade.bin] Error 1
make[5]: Leaving directory '/home/user/sdk/target/linux/ramips/image'
make[4]: *** [Makefile:31: install] Error 2
make[4]: Leaving directory '/home/user/sdk/target/linux/ramips'
make[3]: *** [Makefile:11: install] Error 2
make[3]: Leaving directory '/home/user/sdk/target/linux'
time: target/linux/install#8.35#1.95#6.74
    ERROR: target/linux failed to build.
make[2]: *** [target/Makefile:36: target/linux/install] Error 1
make[2]: Leaving directory '/home/user/sdk'
make[1]: *** [target/Makefile:19: /home/user/sdk/staging_dir/target-mipsel_24kc_musl/stamp/.target_install] Error 2
make[1]: Leaving directory '/home/user/sdk'
make: *** [/home/user/sdk/include/toplevel.mk:245: world] Error 2
user@Teltonika-docker:~/sdk$ 

With Docker, I’ve tried the following commands:

./scripts/dockerbuild ./scripts/feeds update -a
./scripts/dockerbuild make menuconfig
./scripts/dockerbuild make

and I’ve enough disk space ( I’ve found the full process requires around 18-20GB )

Then I’ve tried to compile the minimal and the factory image ( doing a make clean before ), but it was the same.

I’ve tried to add the following commands to the sequence:

./scripts/dockerbuild ./scripts/feeds install -a
make download

but it doesn’t change.

have you any hint ?

Hello,

If I try to compile for the default target (RUT9M), the image is created successfully.

All of the RUT9xx devices use the same image, which is RUT9M, so you don’t need to specify for which device to create the fw. So you hwen you compile the RUT9M FW, you can upload it to RUT906 and it should be working fine. Same goes for RUT2xx/RUTXxx devices.

I hope I understood the question and answered it for you,
Yes

thanks a lot! I do not know why menuconfig shows different models then :sweat_smile:

I’ll try to test my image then!

I’m also new here, but I’ve been exploring similar issues while working on custom firmware builds. It sounds like you’ve already tried a lot of troubleshooting steps, but I was wondering if you’ve looked into potential discrepancies in the configuration files when switching targets from RUT9M to RUT906. Sometimes, certain settings might not carry over correctly, causing errors during the final stages of compilation.

Have you tried comparing the .config file generated for RUT9M with the one generated after you switch to RUT906? It might help to manually adjust or add any missing configurations before starting the compilation process again.

Just my two cents—hope it’s helpful!

@sakeban you are absolutely right!

comparing the .config files I have found interesting differences; for example in RUT9M config I have these fields:

CONFIG_TARGET_BOOT_NAME="tlt-rut9m"
CONFIG_DEVICE_MTD_LOG_PARTNAME="mtdblock7"

while the do not compare in the other and there are more enabled kmod, like these:

CONFIG_DEFAULT_kmod-cypress-serial=y

CONFIG_DEFAULT_kmod-gpio-nxp-74hc164=y
CONFIG_DEFAULT_kmod-hwmon-mcp3021=y
CONFIG_DEFAULT_kmod-hwmon-tla2021=y
CONFIG_DEFAULT_kmod-i2c-mt7628=y


CONFIG_DEFAULT_kmod-mt7603_515=y
CONFIG_DEFAULT_kmod-mt76_515=y
CONFIG_DEFAULT_kmod-spi-gpio=y
CONFIG_DEFAULT_kmod-usb2=y

other interesting differences:

CONFIG_SMALL_FLASH=y

CONFIG_USB_SUPPORT_EXTERNAL=y
CONFIG_HAS_IO=y
CONFIG_HAS_MODBUS=y

CONFIG_SW_OFFLOAD=y

I am focusing right on CONFIG_TARGET_BOOT_NAME because it is mandatory to compile u-boot section, according ackage/boot/uboot-ath79/src/u-boot/Makefile:

tlt-rut9m: rt2880_common
	@$(call config_init,Teltonika RUT9M,tlt-rut9m,16,38,1,MTK_MT7628_SOC)
	@$(call define_add,CONFIG_FOR_TELTONIKA_RUT9M,1)
	@$(call define_add,CONFIG_SHIFT_REG,1)
	@$(call define_add,CONFIG_CMD_PHY_POWER,1)
	@$(call define_add,ON_BOARD_1024M_DRAM_COMPONENT,1)
	@$(call define_add,ON_BOARD_DDR2,1)
	@$(call define_add,ON_BOARD_DDR_WIDTH_16,1)
	@$(call define_add,ON_BOARD_16BIT_DRAM_BUS,1)
	@$(call define_add,RALINK_DDR_POWERSAVE,1)
	@$(call define_add,CONFIG_DDR_CAL,1)
	@$(call define_add,ASIC_BOARD,1)
	@$(call define_add,MT7628_ASIC_BOARD,1)
	@$(call define_add,CPU_FRAC_DIV,1)
	@$(call define_add,CONFIG_EARLY_GPIO_INIT,1)
	@$(call define_add,CONFIG_DO_PCIE_PERST_RESET,1)
	@$(call define_add,CONFIG_MNFINFO_SUPPORT,1)
	@$(call define_add,CONFIG_CMD_MNFINFO,1)
	@$(MKCONFIG) -a rt2880 mips ralink mt7628 rt2880 rt2880

and there is no another label for RUT906, so I wonder why it is missing in RUT906 config.

I’ll try to compile adding this information manually.

I’ve been diving into similar issues with custom firmware builds and noticed that configuration discrepancies can indeed cause issues. It looks like you’ve already found some interesting differences between the .config files for RUT9M and RUT906. Those fields and kmod settings you mentioned could definitely be contributing to the problem.

If you haven’t already, manually aligning these settings might help resolve the compilation errors . It’s worth double-checking that all necessary configurations are consistent between targets.

some improvements: I had errors related to missing dependencies inside components for gpsd.
I have tried to dive into the code and run more times the command

./scripts/feeds install -a

but I have found that it does not really install ALL packages!

I have solved some missing libraries issues related to gpsd and md manually running

./scripts/feeds install gpsd-clients
./scripts/feeds install gpsd-utils
./scripts/feeds install libmdcollect

but at the moment I am stuck with an error on a bind dependency related to openssl crypto algo:

...
checking for BIO_read_ex... yes
checking for BIO_write_ex... yes
checking for SSL_CTX_up_ref... yes
checking for SSL_CTX_set_min_proto_version... no
checking for ECDSA_sign... no
configure: error: in `/home/user/sdk/build_dir/target-mipsel_24kc_musl/bind-9.17.13':
configure: error: ECDSA support in OpenSSL is mandatory.
See `config.log' for more details
make[3]: *** [Makefile:265: /home/user/sdk/build_dir/target-mipsel_24kc_musl/bind-9.17.13/.configured_25cd08bdf92002794ff9ed9e44d34788] Error 1
make[3]: Leaving directory '/home/user/sdk/feeds/packages/net/bind'
time: package/feeds/packages/bind/compile#9.58#2.12#13.08
    ERROR: package/feeds/packages/bind failed to build.
make[2]: *** [package/Makefile:114: package/feeds/packages/bind/compile] Error 1
make[2]: Leaving directory '/home/user/sdk'
make[1]: *** [package/Makefile:108: /home/user/sdk/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/user/sdk'
make: *** [/home/user/sdk/include/toplevel.mk:245: world] Error 2

so it seems it really needs these algos

SSL_CTX_set_min_proto_version
ECDSA_sign

or at least the last one ( that’s deprecated too! ), but I do not understand how fix this issue.

I have tried to add all the bind* packages you can find with the command

./scripts/feeds search bind-

that return this list:

bind-check bind administration tools (named-checkconf and named-checkzone only)
bind-client bind dynamic DNS client
bind-dig bind DNS excavation tool
bind-dnssec bind administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
bind-host bind simple DNS client
bind-libs bind shared libraries
bind-nslookup bind nslookup utility
bind-rndc bind administration tools (rndc and rndc-confgen only)
bind-server bind DNS server
bind-server-filter-aaaa bind DNS server filter AAAA plugin
bind-tools bind administration tools (all)
ddns-scripts-nsupdate Extension for using bind nsupdate.

and I have tried the same with ssl searches, but I still miss the right solution.

partial solution: in menuconfig I have enabled
OPENSSL_WITH_DEPRECATED

now I have an error after:

/home/user/sdk/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: .libs/unbound-control.o: in function `ssl_path_err':
unbound-control.c:(.text+0x9ea): undefined reference to `ERR_GET_FUNC'
/home/user/sdk/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/lib/gcc/mipsel-openwrt-linux-musl/8.4.0/../../../../mipsel-openwrt-linux-musl/bin/ld: unbound-control.c:(.text+0xa36): undefined reference to `ERR_GET_FUNC'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:356: unbound-control] Error 1
make[4]: Leaving directory '/home/user/sdk/build_dir/target-mipsel_24kc_musl/unbound-1.13.1'
make[3]: *** [Makefile:265: /home/user/sdk/build_dir/target-mipsel_24kc_musl/unbound-1.13.1/.built] Error 2
make[3]: Leaving directory '/home/user/sdk/feeds/packages/net/unbound'
time: package/feeds/packages/unbound/compile#35.83#6.24#42.85
    ERROR: package/feeds/packages/unbound failed to build.
make[2]: *** [package/Makefile:114: package/feeds/packages/unbound/compile] Error 1
make[2]: Leaving directory '/home/user/sdk'
make[1]: *** [package/Makefile:108: /home/user/sdk/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/user/sdk'
make: *** [/home/user/sdk/include/toplevel.mk:245: world] Error 2

maybe it could be resolved by another feed update…

This topic was automatically closed after 15 days. New replies are no longer allowed.