Install on the TomatoUSB
This how to describes installing Entware-ng for the Tomato open-source router firmware. Originally posted here.
- USB stick - 8MB or more in size (keep in mind this becomes your main hard drive, choose size appropriately)
- USB-capable router running TomatoUSB.
Pick a USB stick that you can dedicate to your router since it will be completely erased by the following process.
Configure the GUI for Entware-ng
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 umount /opt
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.
Prepare the USB stick
Plug the USB stick in and ssh to the router. Remember, the next steps will completely erase the USB stick!
Find the device name for your 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.
Partition the USB stick
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.
Format the USB stick
Replace the /dev/sdb1 below with the path to your newly created partition.
mkfs.ext3 -L ENTWARE /dev/sdb1
Mount the /opt partition
Mount the newly created partition as /opt. The installer in the next step will need /opt mounted.
echo "LABEL=ENTWARE /opt ext3 rw,noatime 1 1" >> /etc/fstab mount /opt
Perform the entware install
After reboot, Open telnet/ssh console and type following command.
- On ARM devices:
wget -O - http://pkg.entware.net/binaries/armv7/installer/entware_install.sh | sh
- On MIPS devices:
wget -O - http://pkg.entware.net/binaries/mipsel/installer/installer.sh | sh
Verify the installation
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