This howto describes installing entware for the Tomato open-source router firmware.
- USB stick - 1G or more in size
- USB-capable router running TomatoUSB.
- Shibby's fork of TomatoUSB version 1.28 build 121
- ASUS RT-N66U
Pick a USB stick that you can dedicate to your router since it will be completely erased by the following process.
In the web GUI, go to the "USB and NAS->USB Support" section and tick the following options:
[x] Core USB Support
[x] USB 2.0 Support
[x] USB Storage Support
[x] Ex2/Ext3 File Systems Support
[x] Automount
Paste this text into the "Run after mounting" box:
#!/bin/sh
/opt/etc/init.d/rc.unslung start
Paste this text into the "Run before unmounting" box:
#!/bin/sh
/opt/etc/init.d/rc.unslung stop
sleep 15
for i in `cat /proc/mounts | awk '/ext3/{print($1)}'` ; do
mount -o remount,ro $i
done
Click the "Save" button and then check the "USB Status" at the bottom of the screen. If your USB stick is mounted, click "Unmount". In subsequent steps, we are going to format the USB stick, so we don't want it mounted.
Go to the "Administration->Scripts->Init" page. Paste the following into the "Init" script section:
echo "LABEL=ENTWARE /opt ext3 rw,noatime 1 1" >> /etc/fstab
Click the "Save" button.
For reference, most of the above is taking from the entware USB setup instructions.
Plug the USB stick in and ssh to the router. Remember, the next steps will completely erase the USB stick!
Run "fdisk -l" to display all the block devices and their partitions. Here is an example:
# fdisk -l
Disk /dev/sdb: 16.2 GB, 16231956480 bytes
64 heads, 32 sectors/track, 15480 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 15480 15851504 83 Linux
You can see that the disk /dev/sdb is a 16GB block device. Since there are no other 16GB devices on my router, I can be pretty sure that the 16GB stick that I plugged in is mapped to /dev/sdb.
Use fdisk to delete all the partitions on your USB disk. Then create a single partition spanning the entire drive and set its type to 83 (Linux). Write the partition table and exit fdisk.
Replace the /dev/sdb1 below with the path to your newly created partition.
mkfs.ext3 -L ENTWARE /dev/sdb1
mount /opt
entware-install.sh
There are a number of useful, general purpose packages that you might want to install. ssh to the router and run the following (these on the list are just some examples):
opkg install bash
opkg install bind-dig
opkg install binutils
opkg install bzip2
opkg install coreutils-sha1sum
opkg install coreutils-sort
opkg install curl
opkg install diffutils
opkg install file
opkg install gawk
opkg install gdb
opkg install hdparm
opkg install less
opkg install lsof
opkg install objdump
opkg install patch
opkg install perl
opkg install procps
opkg install procps-top
opkg install rsync
opkg install sed
opkg install strace
opkg install tar
opkg install tcpdump
opkg install vim
opkg install vim-runtime
opkg install wget
opkg install unzip
Reboot the router by clicking the "Reboot..." option in the web GUI. Once it restarts, ssh to the router and run "opkg list". You should get a list of possible packages that you can install. If you don't, something went wrong. Make sure that /opt is mounted (use the df command).
you also need to perform
opkg upgrade
opkg update
to be able to install new packages on newly installed entware environment.