What's new

Merlin Firmware: .trx vs .w?

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

Darf Nader

Occasional Visitor
After trying Tomato on my RT-AC86U so I could try out the native VyperVPN client which seemed like it would be both powerful and fast, being that I could use Chameleon natively, I was soundly disappointed at how miserably that VPN client performed. It was so excruciatingly awful at how hideously slow it crept, that after all of the trial and error and getting just the right hardware with just the right hardware version and then getting just the right tomato build, to find the app is pure trash... well... rather than get mad and sulk, I am cutting my losses. Live and learn, I guess.

No offense to the folks working on the Tomato project, my router has not behaved properly as a VPN router since I put Tomato on it and while I am sure there is some miracle router configuration that will make it work, after tinkering with it for weeks and posting questions into the ether with no response, I have chosen to give up and just go back to Merlin firmware and use the built in OpenVPN client which works well enough. However, the name of the latest Merlin build is... odd.

While I admit I haven't decoded all of the abbreviations in the the name of the latest build, RT-AC86U_382.1_2_cferom_ubi.w, what really is messing me up is that its file extension is .w not .trx so all of the firmware tools that I have ever used up now no longer work. I'm guessing this format is intended for some other special purpose, like a new firmware standard that everyone knows about except me because I was nodding off when the news went out, but I swear I am finding nothing but maybe a little diddly and an awful lot of squat, but more importantly, not anything that 'splains it to me. Little help?

This adventure trying to get cute with making a purpose-built VyperVPN router has been a colossal waste of time and energy and I just want to go back to using the Merlin FW that I know works and does enough for me. Haven't got time for the pain...
 
The HND platform uses UBIFS, hence the different image format.

Make sure you double check your router model however. You talk about Tomato, which only works on the RT-AC68U, while the UBI firmware is for the RT-AC86U. Two totally different devices.
 
... what really is messing me up is that its file extension is .w not .trx so all of the firmware tools that I have ever used up now no longer work. ...
I was able to extract the RT-AC86U firmware using the latest binwalk.
Code:
# install latest binwalk
sudo apt remove binwalk
cd
git clone https://github.com/devttys0/binwalk.git
cd binwalk
sudo ./deps.sh
sudo python setup.py install

# OR, update to latest binwalk if you're already using it
cd
cd binwalk
git pull
sudo python setup.py uninstall
sudo ./deps.sh
sudo python setup.py install
 
Last edited:
The HND platform uses UBIFS, hence the different image format.

Make sure you double check your router model however. You talk about Tomato, which only works on the RT-AC68U, while the UBI firmware is for the RT-AC86U. Two totally different devices.

Thanks. Also, it’s an RT-AC68U... a little dyslexia there. Clearly barking up the wrong tree with the wrong version there. Maybe a week of sleep will help...


Sent from my iPhone using Tapatalk Pro
 
Last edited:
I was able to extract the RT-AC86U firmware using the latest binwalk.
Code:
# install latest binwalk
sudo apt remove binwalk
cd
git clone https://github.com/devttys0/binwalk.git
cd binwalk
sudo ./deps.sh
sudo python setup.py install

# OR, update to latest binwalk if you're already using it
cd
cd binwalk
git pull
sudo python setup.py uninstall
sudo ./deps.sh
sudo python setup.py install

Thanks for the detailed, step by step instructions. I’ll give it a whirl when I am back home in a week.


Sent from my iPhone using Tapatalk Pro
 
I was able to extract the RT-AC86U firmware using the latest binwalk.
Code:
# install latest binwalk
sudo apt remove binwalk
cd
git clone https://github.com/devttys0/binwalk.git
cd binwalk
sudo ./deps.sh
sudo python setup.py install

# OR, update to latest binwalk if you're already using it
cd
cd binwalk
git pull
sudo python setup.py uninstall
sudo ./deps.sh
sudo python setup.py install

"binwalk -e xyz.w" fills up my 50GB VM partition to 100%. :eek:
I wonder how did you get binwalk to extract the files from .w
 
"binwalk -e xyz.w" fills up my 50GB VM partition to 100%. :eek:
I wonder how did you get binwalk to extract the files from .w
I'm on this version here:
Code:
Binwalk v2.1.2-a709e0e
Craig Heffner, https://github.com/devttys0/binwalk

# how to get this specific source version:
cd
git clone https://github.com/devttys0/binwalk
cd binwalk
git checkout a709e0e3409eee066fe225e906fa413e95ca75e0
sudo ./deps.sh
sudo python setup.py install

Mine extracts 248MB size
Code:
# binwalk -e RT-AC86U_3.0.0.4_384_21045-gb451ba1_cferom_ubi.w
# du --summarize _RT-AC86U_3.0.0.4_384_21045-gb451ba1_cferom_ubi.w.extracted
247508	_RT-AC86U_3.0.0.4_384_21045-gb451ba1_cferom_ubi.w.extracted
 
Last edited:
I'm on this version here:
Code:
Binwalk v2.1.2-a709e0e
Craig Heffner, https://github.com/devttys0/binwalk

# how to get this specific source version:
cd
git clone https://github.com/devttys0/binwalk
cd binwalk
git checkout a709e0e3409eee066fe225e906fa413e95ca75e0
sudo ./deps.sh
sudo python setup.py install

Mine extracts 248MB size
Code:
# binwalk -e RT-AC86U_3.0.0.4_384_21045-gb451ba1_cferom_ubi.w
# du --summarize _RT-AC86U_3.0.0.4_384_21045-gb451ba1_cferom_ubi.w.extracted
247508    _RT-AC86U_3.0.0.4_384_21045-gb451ba1_cferom_ubi.w.extracted

Tried your sample. This time binwalk doesn't fill up my disk but extraction fails. It succeeds on jffs2 partition but fails to do anything about the UBI partition. Checking further..ubireader reports UBI file corrupted. So I think binwalk fails to get the UBI partition out correctly to begin with.
 
Tried your sample. This time binwalk doesn't fill up my disk but extraction fails. It succeeds on jffs2 partition but fails to do anything about the UBI partition. Checking further..ubireader reports UBI file corrupted. So I think binwalk fails to get the UBI partition out correctly to begin with.
I think you might try a clean VM because you could have mismatched libaries or submodules within binwalk. In deps.sh, I see this:
Code:
function install_ubireader
{
    git clone https://github.com/jrspruitt/ubi_reader
    # Some UBIFS extraction breaks after this commit, due to "Added fatal error check if UBI block extends beyond file size"
    # (see this commit: https://github.com/jrspruitt/ubi_reader/commit/af678a5234dc891e8721ec985b1a6e74c77620b6)
    # Reset to a known working commit.
    (cd ubi_reader && git reset --hard 0955e6b95f07d849a182125919a1f2b6790d5b51 && $SUDO python setup.py install)
    $SUDO rm -rf ubi_reader
}
 
I think you might try a clean VM. In deps.sh, I see this:
Code:
function install_ubireader
{
    git clone https://github.com/jrspruitt/ubi_reader
    # Some UBIFS extraction breaks after this commit, due to "Added fatal error check if UBI block extends beyond file size"
    # (see this commit: https://github.com/jrspruitt/ubi_reader/commit/af678a5234dc891e8721ec985b1a6e74c77620b6)
    # Reset to a known working commit.
    (cd ubi_reader && git reset --hard 0955e6b95f07d849a182125919a1f2b6790d5b51 && $SUDO python setup.py install)
    $SUDO rm -rf ubi_reader
}

Thanks for digging out this function. I'm not aware of it. However, I do have ubireader installed from that git. This reader requires a UBI file i.e. UBI partition extracted from the mother binary. Seems binwalk got this UBI file wrong and feed it to ubireader.

But as you said it might be worth trying in a new VM with a fresh Linux install..
 

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!

Staff online

Top