Converting GL.iNet MT3000 (Beryl AX) from CN to Global

Hi, I recently purchased a MT3000 (Beryl AX) from Taobao, and realized the VPN and Adguard features were unavailable due to the router having CN version. According to the instructions shared in their forum for the MT2500 (before it got deleted by admin), I can change the CN flag to US in the bootloader located in /dev/mmcblk0boot1.

However after SSH into the router, I don't see such file in dev. Does anyone know any other way? Thanks in advance!

Tried https://forum.gl-inet.com/t/taobao-bought-mt3000-beryl-ax-has-no-vpn-option/27679/21 ?

Since I don't know where to obtain a proper Global U-boot for MT3000, I came up with an alternative, albeit hacky, solution:

First flash the global firmware, get the uboot one from here:

The firmware, probably, needs to be flashed using the recovery/debrick feature:

Once this is done, login to the newly flashed router and set a password.

If you see CN in the router UI, like here, then you need to follow the below steps:
image

Run the following commands in a terminal over SSH:

echo US > /tmp/country_code
mount --bind /tmp/country_code /proc/gl-hw-info/country_code
cat /proc/gl-hw-info/country_code

Refresh the UI and the router should now show as Global until next reboot.

To make it permanent, do the following:

cat /etc/rc.local
# Check that you haven't already added the below, then proceed
sed -i '1i\echo US > /tmp/country_code\nmount --bind /tmp/country_code /proc/gl-hw-info/country_code' /etc/rc.local
cat /etc/rc.local
# Verify that the lines were added, at next boot the system will still be the global version

Try to reboot and verify that you have the Global version! It should look something like this:

You probably have to repeat this after a firmware update.

If anyone can supply the U-boot for the Global version I'd love to try to use that one instead, but for now this will have to do, hope it helps someone.

EDIT: I'd be very glad to know what /proc/gl-hw-info/country_code is set to in the Global version. So if someone with that version could supply it, that'd be great :slight_smile:

1 Like

Other than MT2500 which comes with an eMMC the MT3000 comes with SPI-NAND.
According to the device tree of the vendor firmware the country code is stored on the Factory partition at offset 0x88.
In my case:

root@OpenWrt:/# hexdump -C /dev/mtd2
...
00000080  00 00 00 00 00 00 00 00  44 45 00 00 00 00 00 00  |........DE......|
...

Which makes sense (me being inside the EU, Germany probably being a significant target market for GL-iNet products here).

Hence I'd recommend to dump /dev/mtd2 into a file (e.g. using cat or dd), edit it with a hex editor replacing the CN country code with US or DE and then write it back to the flash using the mtd tool.

2 Likes

Thank you @daniel, that made for a good solution!

As a warning to anyone wanting to do this, you can potentially "brick" your device, so be careful.

This is what I did, after installing xxd and nano:

xxd /dev/mtd3 /tmp/mtd3_xxd_dump.txt
nano /tmp/mtd3_xxd_dump.txt

at 0x88 I replaced "CN" with "DE" and "43 4E" with "44 45".

then I converted it back and wrote it to mtd3:

xxd -r /tmp/mtd3_xxd_dump.txt /tmp/mtd3_xxd_dump_fixed.bin
mtd write /tmp/mtd3_xxd_dump_fixed.bin /dev/mtd3
mtd verify /tmp/mtd3_xxd_dump_fixed.bin /dev/mtd3

After a reboot the UI is working as Global, do note that this produces an empty output after this change:

cat /proc/gl-hw-info/country_code

When set to CN this outputs "CN". I have yet to try if reversing my change will restore this, if it doesn't I suppose I did something wrong above as well.

Exercise caution if you try this, mistyping things can end badly...

Maybe you can try this .
GL-MT2500

echo 0 > /sys/block/mmcblk0boot1/force_ro
echo "US" |dd of=/dev/mmcblk0boot1 bs=1 seek=136
sync
reboot

GL-MT3000

echo "US" |dd of=/dev/mtdblock3 bs=1 seek=136
sync
reboot
2 Likes

this worked very well, definitely easier :slight_smile: thanks!

I did it with DE:

echo -n "DE" |dd of=/dev/mtdblock3 bs=1 seek=136
sync
reboot

and now I get the proper country code.

1 Like