FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
619 views 4 comments
by anonymous
Hi,

I just recently managed to build a custom firmware for my RUT955. I am trying to remove stuff I don't need from my official firmware as I need a bit more space for the binary I plan on running on the device.

So far I managed to get the build running and it's producing two files in the `bin/ar71xx/tltFws` directory:
RUT9XX_R_GPL_00.06.07.5_UBOOT_3.2.6_MASTER_STENDUI.bin and RUT9XX_R_GPL_00.06.07.5_WEBUI.bin

So if I use the RUT9XX_R_GPL_00.06.07.5_WEBUI.bin in the normal WebUi, the recovery WebUi or on the box using `mtd` it seems to generally work, but the box doesn't boot because it encounters a kernel panic when trying to mount the root file system:

***************************************
*     U-Boot 3.2.6     2020-04-14     *
***************************************

  BOARD: Teltonika RUT9XX
    RAM: 128 MB DDR2 32-bit CL3-4-4-10
  FLASH: 16 MB Unknown XT25F128B
 CLOCKS: CPU/RAM/AHB/SPI/REF
         550/380/253/ 25/ 40 MHz

Hit any key to stop booting:  0

Booting image from 0x9F040000...

   Vendor/image name:    Teltonika RUT9xx
   Hardware ID:          0x35000001
   Whole image size:     15.5 MB (16252928 bytes)
   Kernel size:          1 MB (1098572 bytes)
   Rootfs size:          8.7 MB (9154098 bytes)
   Kernel load address:  0x80060000
   Kernel entry point:   0x80060000

   Header CRC...  skipped
   Data CRC...    skipped

Stopping network... OK!
Uncompressing Kernel... OK!
Starting kernel...

[    0.000000] Linux version 3.18.44 (cdutz@ChrisXPS) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 unknown) ) #1 Sun May 2 16:22:16 CEST 2021
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] SoC: Atheros AR9344 rev 3
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    1.750000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,4)
[    1.750000] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,4)

So it seems to be missing something ... now I can see the RUT9XX_R_GPL_00.06.07.5_UBOOT_3.2.6_MASTER_STENDUI.bin is bigger and according to `binwalk` it contains more segments. Unfortunately the file is too big for the web-based update and I'm a bit hesitant to put the file on a usb stick and run it on the device itself as I'm afraid that I might irrecoverably brick the device if something goes wrong flashing the U-Boot part of the system.

Another thing is, if I copy the bin to a USB stick, mount that on the device and use `sysupgrade` on the device it claims to have finished flashing (which sort of only takes a fraction of a second) and then it reboots. However the system comes back with an unchanged firmware.

So not quite sure what to do to get my custom firmware running. Help greatly appreciated :)

1 Answer

0 votes
by anonymous
Hello,

Could you provide a full list of changes that you made to RUT9XX SDK? I will try to compile firmware with identical changes to investigate.

Best regards.
Best answer
by anonymous
That might be a problem as I didn't do most of the changes .. in general it was just stuff needed to get the build working on Ubuntu 21.04 and to strip down the image.

However yesterday we tried something because the problem was that the Boxes we have in the US were working fine with our custom built FW (These Boxes are from some time near 2019, and mine is just a few days old). But when I tried installing the FW that worked in the US on my box, I got the same error I mentioned above.

I would have expected that hardware-changes possibly could have an effect, but if I install the FW from Teltonika this works fine on my EU box ... however haven't tried installing the current FW on the US Box.

So I'm a little puzzled here at the moment.

But I'm currently trying to reproduce all the changes that were done ... Will provide feedback as soon as I'm done.
by anonymous
So yesterday I started from scratch ... took the Teltonika RUT955 SDK and made it work on Ubuntu 21.04 ... this way I could eliminate any config options might have been causing the problem. Unfortunately the result was the same.

So today I'm starting from scratch and building it in a clean Ubuntu 16.04 Docker container ...

Perhaps someone could explain what the difference is between the two output files ... I think the WEBUI one only contains the linux itself and the other also updates the U-Boot part, correct? How could I flash that version because I keep getting errors that the file is too big.
by anonymous

Hi,

You are correct. I would not recommend flashing the u-boot file, because it could brick your device irreversibly. 

For all WebUI services and changes, a single firmware file (WebUI.bin) is enough.

U-boot files can be loaded using the bootloader menu. Instructions can be found right here: https://wiki.teltonika-networks.com/view/RUT9xx_Bootloader_Upgrade

Regards.

by anonymous
Hi all,

Ok ... so I unpacked the unchanged SDK to a new directory and setup a Docker build to build it with Ubuntu 16.04 ... the output works. So I'll now try to transform this to the form we need.

Sorry for the noise.