Install on Asus stock firmware - Entware/entware GitHub Wiki
Installing Entware on ASUS stock firmware (a/k/a ASUSWRT)
🗒️ A more concise version of these instructions is also available.
It's related to any modern ASUS router with USB port: RT-N10U, RT-N13U, RT-N15U, RT-N16, RT-N56U, RT-N65U, RT-N66U, RT-AC66U and so on. ASUS stock firmware partially based on TomatoUSB code, so we may use a custom start/stop scripts to ignite external services from USB drive.
Newer versions of routers (like RT-AX88U) with recent stock firmware will show
/opt
directory exists and is read-only. So if this is the case for you then
please continue reading for workaround. Because this is only a symbolic link
that points to /tmp/opt
(which doesn't exist by default), all we need to do is
create/mount it and then /opt
will work. So for the USB disk that you use,
create an NTFS partition with the label 'opt' (I could not mount it manually as
EXT2/3/4, so it must be NTFS.) After creating the NTFS partition and plugging
the USB disk into your router. SSH/Telnet into your router and type the
following:
# mkdir -pv /tmp/opt
mkdir: created directory '/tmp/opt'
# blkid
…
/dev/sda1: LABEL="ENTWARE" UUID="01234567-89ab-cdef-0123-456789abcdef"
…
That last command will show you the partitions of your USB storage drive. Look
for the 'opt' label (for the NTFS partition you created) and take note of the
/dev/sdX#
(where X is the partition letter and # the number) of the opt
partition:
mount /dev/sdX# /tmp/opt
cd /root
chmod 644 .wget-hsts
Without doing that last command, you will get 'HSTS will be disabled' errors
when running the Entware install script below. To have /opt
auto-mount after
reboot, you will need to create a startup script and add it to nvram so it
survives reboots.
So what we want to do first is create the startup script, to do that we will use
vi since it is the only text editor installed by default. In SSH, type
vi /jffs/scripts/mountOpt
to create and start editing the script. Once it's
open hit the 'i' key on your keyboard, this allows us to begin editing.
Copy/Paste the following and make sure to edit /dev/sdX#
to what you used
before to mount your /opt
partition.
#!/bin/sh
# recreate the opt dir after every reboot
mkdir /tmp/opt
# where /dev/sdX# is your usb opt partition
mount /dev/sdX# /tmp/opt
If the command mount /dev/sdX# /tmp/opt
_raises an error - read-only, use
mount /dev/sdX# /opt
(working with EXT2/3/4)
Once you have finished editing then hit the Esc key and type :, x and then Enter to save the file and close the text editor. Finally, these are the commands that will run the startup script each time your USB drive is connected, which includes each time your router boots up with your USB drive attached.
nvram set script_usbmount="/jffs/scripts/mountOpt" && nvram commit
You're all set! Each time your router is rebooted, it will mount /opt
so that
Entware and the apps you install can be used. If you had to do this workaround
then you can skip the next section and go directly to deploying Entware. Good
luck!
Prepare USB disk with clean ext2/ext3/ext4 partition with some label (MYPART label is used in script below). USB partitions will be mounted by it's label.
Open a Telnet/SSH console and copy & paste the following scripts:
cat <<EOF >/tmp/script_usbmount.tmp
if [ \$1 = "/tmp/mnt/MYPART" ]; then
ln -sf \$1 /tmp/opt
/opt/etc/init.d/rc.unslung start
fi
EOF
nvram set script_usbmount="$(cat /tmp/script_usbmount.tmp)"
cat <<EOF >/tmp/script_usbumount.tmp
if [ \$1 = "/tmp/mnt/MYPART" ]; then
/opt/etc/init.d/rc.unslung stop
fi
EOF
nvram set script_usbumount="$(cat /tmp/script_usbumount.tmp)"
nvram commit
reboot
First check your kernel version with uname -rm
.
- If your kernel is 4.1 or higher and your architecture is aarch64 use either aarch64-k3.10 (64-bit) or armv7sf-k3.2 (32-bit) repo.
- If your kernel is 3.2 or higher and your architecture is arm use armv7sf-k3.2 repo.
- If your kernel is 2.6.36 and your architecture is arm use armv7sf-k2.6 repo.
- If your kernel is 2.6.22 and your architecture is mipsel you can use either Entware-backports or legacy Entware-ng (deprecated) repo.
After reboot, open telnet/ssh console and type following command.
-
Standard install on aarch64 4.1+ devices (RT-AC86U, RT-AX88U, e.t.c):
wget -O - http://bin.entware.net/aarch64-k3.10/installer/generic.sh | sh
-
Standard install on arm 3.2+ devices (RT-AC58U, e.t.c):
wget -O - http://bin.entware.net/armv7sf-k3.2/installer/generic.sh | sh
-
Standard install on arm 2.6.36 devices (RT-AC66U B1, RT-AC68U, RT-AC56U, RT-AC87U, RT-AC3200, RT-AC88U, RT-AC3100, RT-AC5300, e.t.c):
wget -O - http://bin.entware.net/armv7sf-k2.6/installer/generic.sh | sh
-
Entware-backports on mipsel 2.6.22 devices (RT-N66U, RT-AC66U, RT-N16, e.t.c):
❗Refer to README.md
-
Entware-ng (deprecated) on mipsel 2.6.22 devices (RT-N66U, RT-AC66U, RT-N16, etc.):
wget -O - http://pkg.entware.net/binaries/mipsel/installer/installer.sh | sh
Other arm installers can be found on the Two types of Entware installations page.