Entware-ng-3x is a modern alternative to Optware.
For those unfamiliar with Optware: it's a software repository that offers various software programs that can be installed on your router. They allow you to add new functionality to your router (provided you have the know-how to properly configure them).
Entware-ng-3x system library is specially modified (patched) so that standard linux files that are normally located in /etc
directory are now located in /opt/etc/
directory. To simplify things let's consider /etc/passwd
file. On Asuswrt-merlin it normally looks something like:
admin:x:0:0:admin:/root:/bin/sh
nas:x:100:100:nas:/dev/null:/dev/null
nobody:x:65534:65534:nobody:/dev/null:/dev/null
tor:x:65533:65533:tor:/dev/null:/dev/null
We call standard Entware-ng-3x installation the case, when /opt/etc/passwd
(shadow, group, gshadow, shells) files are symbolic links to the equivalent files in /etc
directory. When Entware-ng binaries need to access /opt/etc/passwd
file they access /etc/passwd
file. This is equivalent of Entware-ng behavior.
We call alternative Entware-ng-3x installation the case when /opt/etc/passwd
and /opt/etc/group
are real files (not symlinks). Entware-ng-3x binaries use user names, group names, passwords from these files. They can be different from Asuswrt-merlin firmware. The original Asuswrt-merlin firmware has admin as a superuser, Entware-ng-3x always has root as a superuser.
Important: Please remove Optware, Entware-ng, Entware.arm if it is currently installed.
You cannot use both Optware and Entware-ng-3x at the same time. Entware-ng-3x cannot be used simultaneously with Optware.
Important: Asus's Download Master
is based on Optware, and therefore is NOT compatible with Entware-ng-3x. You will have to uninstall Download Master.
After uninstalling, you should make sure asusware.arm
or asusware.
directory on mounted disk partition is deleted. Otherwise, Entware-ng-3x won't work properly.
You cannot use both Entware-ng and Entware-ng-3x at the same time. Entware-ng-3x cannot be used simultaneously with Entware-ng.
SSH to your router, change 192.168.1.1
with the ip address of your router
$ ssh [email protected]
Delete /tmp/opt
symlink
$ rm /tmp/opt
Delete start scripts
$ rm /jffs/scripts/services-start
$ rm /jffs/scripts/services-stop
$ rm /jffs/scripts/post-mount
Disable custom scripts and configs from /jffs
$ nvram set jffs2_scripts=0
$ nvram commit
Reboot router
$ reboot
Unmount and format the USB drive
$ df -h
$ umount -l /dev/sda1
$ mkfs.ext2 /dev/sda1
Reboot router
$ reboot
Important: Please check kernel version of your router using uname -a
command. Kernel version should be not less then 3.2.40!
$ uname -a
Linux RT-AC86U-E5F0 4.1.27 #2 SMP PREEMPT Sat Dec 2 01:19:36 EST 2017 aarch64 ASUSWRT-Merlin
The goal is to mount /opt
folder to some ext2|ext3|ext4 partition on a USB drive, which will be automatically mounted on every boot, so make sure to plug in a USB drive before installation.
In this example the target is an Asus RT-AC86U. The RT-AC86U contains a Broadcom BCM4906
SoC. It integrates two Cortex-A53
ARMv8-A cores that Broadcom has customized. Armv8-A has two execution states AArch32
and AArch64
. AArch32
provides backwards compatibility with ARMv7
.
This all means you can use a ready made installation scripts for ARMv7
.
SSH to your router, change 192.168.1.1
with the ip address of your router
$ ssh [email protected]
Change to /tmp/share
$ cd /tmp/share
Download entware-setup.sh from the new Asuswrt-merlin development branch
$ wget https://raw.githubusercontent.com/RMerl/asuswrt-merlin.382/master/release/src/router/others/entware-setup.sh
For standard installation (armv7,std)
$ sed -i 's~http://pkg.entware.net/binaries/armv7/installer/entware_install.sh~http://entware-3x.zyxmon.org/binaries/armv7/installer/install_std.sh~g' /tmp/share/entware-setup.sh
For alternative installation (armv7,alt)
$ sed -i 's~http://pkg.entware.net/binaries/armv7/installer/entware_install.sh~http://entware-3x.zyxmon.org/binaries/armv7/installer/install_alt.sh~g' /tmp/share/entware-setup.sh
Correct permissions to /tmp/share/entware-setup.sh
$ chmod +x /tmp/share/entware-setup.sh
Unmount and format the USB drive
$ df -h
$ umount -l /dev/sda1
$ mkfs.ext2 /dev/sda1
Install Entware-ng-3x
$ /tmp/share/entware-setup.sh
admin@RT-AC86U-E5F0:/tmp/share# /tmp/share/entware-setup.sh
Info: This script will guide you through the Entware installation.
Info: Script modifies "entware" folder only on the chosen drive,
Info: no other data will be changed. Existing installation will be
Info: replaced with this one. Also some start scripts will be installed,
Info: the old ones will be saved on Entware partition with name
Info: like /tmp/mnt/sda1/jffs_scripts_backup.tgz
Info: Looking for available partitions...
[1] --> /tmp/mnt/sda1
=> Please enter partition number or 0 to exit
Choose a partition where Entware-ng-3x should be installed, in this case [1] --> /tmp/mnt/sda1
[0-1]: 1
Info: /tmp/mnt/sda1 selected.
Output on a clean install should look like this
Info: Creating /tmp/mnt/sda1/entware folder...
Info: Creating /tmp/opt symlink...
Info: Creating /jffs scripts backup...
tar: /jffs/scripts/*: No such file or directory
tar: error exit delayed from previous errors
Info: Modifying start scripts...
Info: Enabling custom scripts and configs from /jffs...
Output on a successful install should look like this
Info: Congratulations!
Info: If there are no errors above then Entware-3x was successfully initialized.
Info: Add /opt/bin & /opt/sbin to your PATH variable
Info: Add '/opt/etc/init.d/rc.unslung start' to firmware startup script for Entware-3x services to start
The script has created a new directory named entware
admin@RT-AC86U-E5F0:/tmp/share# cd /opt
admin@RT-AC86U-E5F0:/tmp/mnt/sda1/entware#
Entware-ng-3x installs its own busybox copy. The PATH
variable has /opt/bin
and /opt/sbin
before /bin
and /sbin
$ which busybox
/opt/bin/busybox
If this is an alternative Entware-3x installation, it is recommended to install and setup Entware-ng-3x ssh server and use it instead of a firmware supplied one. There are two ssh servers in Entware-ng-3x - dropbear and openssh. You can install dropbear or openssh as an ssh server.
The superuser root has password 12345
that can be changed after the first login and is independent from Asuswrt-merlin firmware.
Install dropbear
$ opkg update
$ opkg install dropbear
You need to edit /opt/etc/init.d/S51dropbear
startup script and change the line PORT=22
to PORT=2222
to make dropbear ssh port different from the system's one.
$ sed -i 's~PORT=22~PORT=2222~g' /opt/etc/init.d/S51dropbear
Run dropbear
$ /opt/etc/init.d/S51dropbear start
Check if dropbear is currently running
$ /opt/etc/init.d/S51dropbear status
dropbear already running
SSH to your router, change 192.168.1.1
with the ip address of your router
$ ssh [email protected] -p 2222