What's new
  • 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!

Questions about ASUS Style firmware

baordog

New Around Here
Hello! I am taking a look at ASUS' WRT fork and I'm trying to do some testing on it. This may end up with me contributing to code for merlin, once I better understand how the vanilla firmware works. Some of these questions are more about ASUS WRT than Merlin, but it seems like the Merlin community knows the internals of ASUSWRT better than anyone else.

1) Based on ASUS' published firmware images / sourcecode I am having a hard time finding the Kernel. Is this stored in the distributed firmware images or is typically shipped on the router as ROM? In the examples I have been analyzing, many directories are symlinked to tmp, and tmp is empty, so I suspect there some loading at boot time happening.

2) Where are init scripts for the router kept? The usual linux places are missing in the ASUS distributed images.

3) Has anyone managed to get either Merlin or ASUSWRT running in a QEMU type environment? I would be curious to see if that is possible, given the many peripherals most routers have.
 
1) Based on ASUS' published firmware images / sourcecode I am having a hard time finding the Kernel. Is this stored in the distributed firmware images or is typically shipped on the router as ROM?

It's compiled at the same as the firmware, and included in the TRX image you flash on the router. Kernel source code is within src-SDK/linux/linux-2.6/ (src-SDK being src-rt-6.x, src-rt-7.14, etc...).

Where are init scripts for the router kept?

There's no init script. The firmware does not use a SysV style setup. Everything is handled by the rc daemon, which serves as init.
 
It's compiled at the same as the firmware, and included in the TRX image you flash on the router. Kernel source code is within src-SDK/linux/linux-2.6/ (src-SDK being src-rt-6.x, src-rt-7.14, etc...).



There's no init script. The firmware does not use a SysV style setup. Everything is handled by the rc daemon, which serves as init.

Is there a good unpacker for the TRX style firmware?

When I ask about init scripts, I mean the scripts that kick on the various router services, that would normally be in /etc/init/init.d - which appear to be missing in the asus image. With BSD, I would expect things to be in /etc/rc.d/ but in the firmware I have seen, etc is symlinked to tmp and tmp is empty.

The reason I care to have this, is that I am trying to build up a chrooted dev environment with qemu, and having some version of the init scripts for services on the machine is a must. Any idea where I can get that info?
 
Is there a good unpacker for the TRX style firmware?

Firmware Mod Kit (FMK). However I don't know where the project moved, since it used to be on Google Code (and that service has since been shut down).

When I ask about init scripts, I mean the scripts that kick on the various router services, that would normally be in /etc/init/init.d - which appear to be missing in the asus image. With BSD, I would expect things to be in /etc/rc.d/ but in the firmware I have seen, etc is symlinked to tmp and tmp is empty.

I know. What you describe is the SysV Init system - Asuswrt does not use such a system. There are no scripts, it's all handled through signaling the rc process. Any change has to be done within the rc C code.
 
Firmware Mod Kit (FMK). However I don't know where the project moved, since it used to be on Google Code (and that service has since been shut down).



I know. What you describe is the SysV Init system - Asuswrt does not use such a system. There are no scripts, it's all handled through signaling the rc process. Any change has to be done within the rc C code.

Ah, ok I get it now. I suppose that means I should be able to just run the rc daemon in my qemu chroot. I don't think I have a copy of the daemon in my squash-fs dump. Is it typically contained in the TRX firmware?
 
Ah, ok I get it now. I suppose that means I should be able to just run the rc daemon in my qemu chroot. I don't think I have a copy of the daemon in my squash-fs dump. Is it typically contained in the TRX firmware?

You can't run rc in qemu, it's heavily tied to the hardware.
 
You can't run rc in qemu, it's heavily tied to the hardware.
Ah rats. Well, I'm still curious where I can get it. At the very least I can pull it's behavior out with a disassembler. Perhaps I can get the individual programs running in Qemu user mode. Or is the RC source code given in ASUS' drop?
 

Similar threads

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!
Back
Top