JoeZhao

跨出界

Hey, I’m JoeZhao, a software engineer, and a gamer.

Merlin (梅林) enables Entware.

What is Entware#

Entware-ng is a software package library for embedded systems, managed using the opkg package management system. There are now over 2000 packages available on the official repository.

The original plan was to use the built-in ipkg, but the packages were too outdated.

Official website: Entware

Prerequisites#

The space on the router itself is actually very small, so whether you want to enable ipkg or opkg, you can use an external hard drive (USB flash drive).

Of course, if your router's hard drive is large enough, you can ignore this.

USB Flash Drive, Hard Drive Formatting and Mounting#

# After plugging in your USB flash drive, enter SSH
$ df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                28.3M     28.3M         0 100% /
devtmpfs                124.7M         0    124.7M   0% /dev
tmpfs                   124.8M      1.2M    123.6M   1% /tmp
/dev/mtdblock4           62.8M     21.3M     41.5M  34% /jffs
/dev/sda1               916.9G    240.0G    630.3G  28% /tmp/mnt/sda1

# Find the line with your disk and note the Filesystem and Mounted on parameters;
# Mine are `/dev/sda1` and `/tmp/mnt/sda1`
# ---
# First, unmount the disk
$ umount /tmp/mnt/sda1

# After successful unmount, perform the formatting operation (ext3), enter y for all prompts
$ mkfs.ext3 /dev/sda1

# After formatting, you need to manually create a folder and mount the disk
$ mkdir -p /tmp/mnt/sda1
$ mount /dev/sda1 /tmp/mnt/sda1
# This completes the formatting operation.

# The following command is for adding virtual memory, if needed. If you need a different size, please refer to 256Mb: count=262148; 512Mb: count=524292; 1024Mb: count=1024004
$ dd if=/dev/zero of=/tmp/mnt/sda1/swapfile bs=1024 count=524292
$ mkswap /tmp/mnt/sda1/swapfile
$ chmod 600 /tmp/mnt/sda1/swapfile
$ swapon /tmp/mnt/sda1/swapfile

Installing Entware#

Merlin has a built-in installation script for Entware, simply execute entware-setup.sh to complete the installation, as follows:

$ entware-setup.sh
# Then you will be prompted to choose a partition, select the one you mounted earlier
···omitted
Info:  Looking for available partitions...
[1] --> /tmp/mnt/sda1
=>  Please enter partition number or 0 to exit
[0-1]: 1 # Select 1 and press Enter
···omitted
# As long as there are no error prompts after running, the installation is successful

Using Entware#

Similar to apt-get used in Ubuntu/Debian, Entware uses opkg.

# View help
$ opkg -h

For example, if I want to install git

$ opkg install git

--EOF--

References:

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.