Thursday, October 18, 2012

Update : OpenWrt on a Belkin Share Max N300 (F7D3301 or F7D7301)

Please refer to my old blog post for the details on the modifications. This is just an update from the earlier patches, and some of the content in earlier blog apply here as well.

Below are the exact steps to produce a trx file, which can be flashed via CFE.
1. Checkout openwrt (a specific version)
svn checkout --revision=33760 svn://svn.openwrt.org/openwrt/trunk
Other versions may work, but I have not tested any other version for these patches.

2.  Apply My custom patches and George's patches
    Download from here: 
000-openwrt4716-TARGET_brcm4716-clone-brcm47xx.patch
001-openwrt4716-TARGET_brcm4716.patch
002-openwrt4716-TARGET_brcm4716-deps.patch
004-f7d7301.r33760.patch


    patch -p1 < 000-openwrt4716-TARGET_brcm4716-clone-brcm47xx.patch
    patch -p1 < 001-openwrt4716-TARGET_brcm4716.patch
    patch -p1 < 002-openwrt4716-TARGET_brcm4716-deps.patch
    patch -p1 < 004-f7d7301.r33760.patch

3. make menuconfig     select Target System -> Broadcom BCM94716
     select Target Profile -> Belkin PlayMax F7D4301
     make

You will have the trx in the usual place after a successful compile.
Look for the file: bin/brcm4716/openwrt-brcm4716-f7d3301-squashfs.trx

For reference one trx I compiled is here : openwrt-brcm4716-f7d7301-squashfs-r33760.trx

Please note the below points if you flash the above trx.
1. default IP address at LAN side is 192.168.2.1
2. telnet can be accessed at default IP,
3. I have added a custom pre-init script to enable me do USB Booting. But it should not affect anything, if you dont do USB boot, except for a few more seconds boot time. I will add the details on how to do USB booting and publish the USB kernel modifications in another section.
For reference the custom preinit is here: /etc/preinit
4. For additional reference, the contents of the root file system : root-brcm4716.tar.gz

Suggestions are welcome, and I will try to learn from your suggestions. But please note that I dont have much time to spend on keeping the trx upto date with openwrt releases, or to add/delete packages or modules.


23 comments:

  1. I got too many questions on USB booting. So posting the idea here:

    1. load drivers needed.
    2. mount usb
    3. kexec load a new kernel from USB
    4. unmount usb
    5. kexec execute the new kernel.

    Details on new USB kernel customization.
    1. custom cpio added, to enable USB mount, and mount a root file system from USB.
    2. Disabled the squash mounting and jffs2 checks and mounting in the USB root image.
    3. Optionally enable ram overlay, to reduce USB flash wearing.

    ReplyDelete
    Replies
    1. You could do the same steps for NFS or NBD booting as well.

      Here, the approach I have is
      1. download an init script from an http server on your lan side. (in the above trx it is 192.168.2.8).
      2. Optionally you could do this from WAN side as well, but that could be riskier, if you are not careful.
      3. Using the downloaded init script, load nfs/nbd drivers.
      4. Mount nbd or nfs share, and kexec load custom kernel.
      5. Custom kernel will have the cpio with init scripts and modules needed for NBD/NFS rooot mount.

      Delete
  2. Hi,

    I tried your previous patch set and it works fine with some minor tweaks to make it build on Debian.
    I wonder though, why is this maintained as a separate patch set and not integrated in mainline?

    Cheers
    Tom

    ReplyDelete
    Replies
    1. Frankly I never tried submitting these patches. But there are a few reasons why it could be rejected.

      1. Unclear licensing terms with Broadcom Ethernet Driver code. Till that is clarified Openwrt may not include it officially.

      2. My patches might need some more cleanup, not to break other routers etc. I might have kept only the F7D7301 in mind, and might have modified code aggressively.

      By the way, any of you are welcome to clean-up and submit my patches to mainline. It is free for all to use, and I claim absolutely no ownership for the patches.

      Manoj

      Delete
    2. Can you clarify on the licensing terms?
      I also posted to the OpenWRT dev list:
      https://lists.openwrt.org/pipermail/openwrt-devel/2012-November/017284.html

      Delete
    3. You got me curious on the Broadcom License status, and a bit of google search found that Broadcom changed the license of the Ethernet driver to the ISC License in their SDK (maybe because of the follow-ups and queries from Openwrt folks). I still need to verify this information by downloading the source code. If you find our more let me know.

      Delete
    4. Bgmac driver seems to be now in the trunk (from Jan 3, 2013).
      ----------
      rev@34995 brcm47xx: add bgmac driver.
      ----------

      Delete
  3. What is the general procedure for applying this patch to the current trunk? I tried it. The four patches apply with no problems but the "make" fails.

    ReplyDelete
    Replies
    1. Since the bgmac is in official openwrt now, I dont have to use George's patches anymore. I am trying to submit my patches to openwrt so that F7D3301 and F7D7301 will be official. But it seems like too much work to clean up my patches :)

      For the folks who what the updated patches I will post them here.

      Delete
    2. Here you go.

      https://docs.google.com/file/d/0B5aCWpK6ZrH7Mk5LM0IyWE5vRHc/edit?usp=sharing

      Delete
    3. The patch seems small. There are a couple things (like different IP addresses) that are easy to clean up, so I'm assuming there is a deeper problem. What would need to be done different for this to be accepted?

      Delete
    4. I had a closer look and I see that this indeed takes a number of shortcuts to make the TRX magic work. Apart from that the patch seems straightforward.

      The patch no longer applies to current SVN (r35899).
      050-mtd-add-bcm47xx-part-parser.patch has been significantly modified.

      Maybe recent changes make it easier to integrate the TRX magic additions?

      Delete
    5. If I understand correctly, the TRX_MAGIC is the only difference wrt to the other TRX images. I'm wondering, did you try if it boots with the standard "HDR0" TRX_MAGIC?

      Delete
  4. Manoj, great work thus far. Can you compile one for f7d7301 to support usb 3G? A working release is worth $10 via paypal for me...

    ReplyDelete
    Replies
    1. Tim,

      If I find some free time this month, I will compile a later version for you. I dont take donations but you are welcome to use that $10 for some good cause.

      Delete
    2. Tim,

      WARNING: UNTESTED TRX LINKS. MAY BRICK YOUR ROUTER.

      I have just compiled a trx which supports usbmodem. Please note that I dont have my belkin router with me now, and so was unable to test these TRX's. So please DO NOT flash it if you are not comfortable with unbricking it via cfe.

      Here is the trx:
      https://docs.google.com/file/d/0B5aCWpK6ZrH7bEEzbmRtRlhQWnM/edit?usp=sharing


      You can infact compile it on your own with the below patch.
      (use target brcm47xx Broadcom-bgmac-wl).
      https://docs.google.com/file/d/0B5aCWpK6ZrH7Mk5LM0IyWE5vRHc/edit?usp=sharing

      If everything worked, the router can be telnet accessable at 192.168.2.1 (no web gui).


      Manoj

      Delete
  5. Manoj can you please make one with luci please. Im pretty new and couldnt compile my own just yet.

    ReplyDelete
  6. Dear Manoj,
    I have been installed Tomato DualWAN on my F7D7301.

    But i still don't know how to install it... stupid!

    I need to connet USB-TTL wire before install it? choose which firmware and patch?

    sorry , i am a freshman without any knowledge about openwrt and linux.

    Please give me some advice and some key steps...

    Thanks!

    ReplyDelete
    Replies
    1. amacee my builds are not meant for "works out of the box". I believe tomato/ddwrt builds does a far better job of "works out of the box". My blog was meant for some more brave hearted folks who just want to experiment with additional builds etc. There was a reason I didnt want to put "instructions for dummies".

      To answer your question. No you dont need a usb-ttl to install the trx I provided. It is just like installing a tomoto/ddwrt trx. But without a serial port log/terminal you should not be experimenting with untested builds, because in case of soft-brick, you will be playing totally blind. (usb ttl provides a lot of logs etc which help you with fixing soft bricks).

      Delete
  7. f7d3302 v1 (stock)
    how do we do it?

    ReplyDelete
    Replies
    1. I think another user made it to work. I could see it in the comments from http://manojpi.blogspot.com/2013/02/update2-openwrt-on-belkin-share-max.html

      Delete
  8. Any idea on how to get N600 version (F7D8301 v1) working, or if it's possible?

    ReplyDelete
    Replies
    1. For anyone wandering by, there is a thread about the Belkin N600 et al on the OpenWRT forum (tl;dr: still not sure about N600): https://forum.openwrt.org/viewtopic.php?id=38393

      Delete