Monday, March 4, 2013

Installing packages into USB on TL-WDR4300 OpenWRT

   

    Subsequently of my buying TP-LINK TL-WDR4300 router, due to the good old Linksys WRT54GL hasn't enough FLASH/RAM/CPU, the first thing I did was to try installing OpenWRT on it.

   Turned out that it was easier than I thought, you could just flash Attitude Adjustment 12.09rc1 from the web GUI of the factory firmware. Detailed instruction here for where to download the image.

   Secondly I installed packages required for using USB storage, this process was simple enough if you understand how to format your usb to specific preferred filesystems (ext2,3,4) I use gparted [just sudo apt-get install gparted, on a debian dist]. VFAT and NTFS are not agreeably supported due to their slowness, such and such. Also to my understanding, you'd need ext2,3,4 filesystems if you were to install packages on them.

Steps:

1.) USB storage required packages
2.) How to install (other) packages to your USB device

What I've learned:

There are three files you need to configure in order for this to work every time even after a router reboot. 
  • /etc/config/fstab  (this is my configuration):
  config mount                    
        option target   /mnt/usb  # Don't forget to mkdir -p /mnt/usb first
        option device   /dev/sda1
        option fstype   ext2  
        option options  rw,sync
        option enabled  1     
        option enabled_fsck 0

  • /etc/profile : [These three lines are preferably added below the existing export(s)]
export USB=/mnt/usb
export PATH=$PATH:$USB/usr/bin:$USB/usr/sbin # This PATH is dependent on existing $PATH
export LD_LIBRARY_PATH=$USB/lib:$USB/usr/lib

  • /etc/opkg.conf : [Just change this line]
dest usb /mnt/usb
# this is to indicate that there is a destination you'd like to install your packages to named "usb"

    Now with all that done, insert your usb (up to this point I assume that you must have installed the packages required in the first step).

To start using the usb run:


root@router~#: /etc/init.d/fstab start


To auto-mount usb to fstab every time the router starts(or restarts) run
:

root@router~#: /etc/init.d/fstab enable

You might as well want to source the /etc/profile so that the paths can be used instantly:

root@router~#: source /etc/profile



Then run these commands to update and install packages

opkg update
opkg install -d usb PACKAGENAME

Well that should do it. After a few poking around, I have now python2.7 able to run from my router.
Note that you'd better check that your USB functions well and isn't damaged.



Have fun!

7 comments:

  1. would you be able to share some screen captures of the router management web ui for us to refer to? is there any noticeable improvement noticed with openwrt replaced on this hardware?

    ReplyDelete
  2. These were done via commandlines, so you'd have to ssh to the router. I didn't do it through web ui.

    OpenWRT opens up options and modifications that were not bundled with the vendor firmware.

    If you'd like to see the web ui, I'd bet you could google-image them easily.

    ReplyDelete
  3. For examples, you could run python, kismet, aircrack-ng suite, right on your router. But of course you'd need a usb port for larger storage.

    ReplyDelete
  4. I have been totally unable to install OpenWRT to this router using the web interface and no amount of googling has helped me. I am no stranger to custom firmware on routers and am pretty technically literate but have not found instructions to do so. I read that you had to rename the file and read two different things to rename it . In both cases it returned a response of update failure...

    After reading you successfully updated via the web interface... I am wondering if you could post the steps you took to do that... including what version you were initially on and what you renamed the file to in order to update to OpenWRT. Itching to get this installed and set up right.

    Thanks for any consideration

    ReplyDelete
    Replies
    1. Well a strange case,

      I wrote this to the openwrt wdr4300 wiki page: (For a brand new router, you could just use the vendor web UI to flash the .bin image)

      I didn't rename any file. Just flashed the .bin via Tp-link web UI.

      My router hardware version is V1.1 and firmware I use is 12.09rc1

      I'm relatively not that experienced with the lower levels than this.

      It's a surprise you can't do it, are you sure you are flashing the squashfs 'factory' .bin image.

      specifically:

      http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/generic/openwrt-ar71xx-generic-tl-wdr4300-v1-squashfs-factory.bin

      Please tell how it goes, I wish you luck.

      Delete
    2. Thanks. I worked it out . The squashfs will not flash no matter what I named the file. I had found forums that stated that later firmwares had a crude name checking portion to it but it ends up that the webGui did not like the squashfs download. I pulled the jffs and it went like butta... thanks for the shot at it and the nice write ups.

      Delete
  5. How to register at the Lucky Club casino site? - Lucky Club
    Lucky Club offers a number of betting options, including both real money and live games. · Enter the Lucky Club mobile bonus code and get an luckyclub exclusive 30x wagering

    ReplyDelete