DEV Community

阿豪
阿豪

Posted on

easy-install: A Rust-Powered Package Installer That Actually Works on OpenWrt

What is easy-install?

easy-install is a cross-platform cli tool written in rust that simplifies installing binaries from GitHub releases and other sources. Think of it as a universal package installer that works across windows, linux, macOS, android and OpenWrt routers.

neofetch-openwrt
The beauty of ei is that it handles all the tedious stuff automatically: downloading the correct binary for your platform, extracting archives (even formats like xz that some devices don't support), setting permissions, and managing your PATH.

OpenWrt devices typically have extremely limited storage—often just 30-100MB of usable space. Plus, many regions have restricted GitHub access, and some systems blacklist curl/wget for GitHub domains. easy-install handles all these edge cases elegantly with built-in proxy support and automatic compression.

Installation

Getting started is simple. Use curl or wget:

curl -fsSL https://raw.githubusercontent.com/easy-install/easy-install/main/install.sh | sh

wget -qO- https://raw.githubusercontent.com/easy-install/easy-install/main/install.sh | sh
Enter fullscreen mode Exit fullscreen mode

Or if GitHub access is restricted in your region, use a CDN proxy:

curl -fsSL https://cdn.jsdelivr.net/gh/ahaoboy/ei-assets/install.sh | sh -s -- --proxy jsdelivr
Enter fullscreen mode Exit fullscreen mode

This installs ei to ~/.ei/ei. Add it to your PATH:

export PATH="$HOME/.ei:$PATH"
Enter fullscreen mode Exit fullscreen mode

Configuration for OpenWrt

Configure ei for your architecture (I recommend musl to avoid libgcc_s.so.1 errors):

ei config target x86_64-unknown-linux-musl  # or aarch64-unknown-linux-musl
Enter fullscreen mode Exit fullscreen mode

If GitHub is blocked, set up a proxy:

ei config proxy gh-proxy
Enter fullscreen mode Exit fullscreen mode

For storage-constrained devices, you can change the install directory:

ei config dir /tmp/large_ei
Enter fullscreen mode Exit fullscreen mode

The UPX Trick

Here's where it gets interesting. Most OpenWrt devices have very limited storage:

Filesystem                Size      Used Available Use% Mounted on
/dev/root                98.3M     25.5M     70.7M  27% /
Enter fullscreen mode Exit fullscreen mode

UPX (Ultimate Packer for eXecutables) is a compression tool that can reduce binary sizes by 30-60%. install it with ei:

ei upx/upx
export PATH="$HOME/.ei/upx:$PATH"
Enter fullscreen mode Exit fullscreen mode

Compress ei itself:

upx ~/.ei/ei

     File size         Ratio      Format      Name
--------------------   ------   -----------   -----------
5726880 ->   2388972   41.72%   linux/amd64   ei
Enter fullscreen mode Exit fullscreen mode

Enable automatic UPX compression for all future installs:

ei config upx true
Enter fullscreen mode Exit fullscreen mode

Software I've Installed

Here are some tools I'm running on my OpenWrt router, all installed with a single command:

Fish Shell

Fish is a user-friendly, cross-platform shell with excellent autocompletion.

ei fish-shell/fish-shell
# Output: -rwxr-xr-x 14.5M fish -> 2.9M /root/.ei/fish
Enter fullscreen mode Exit fullscreen mode

That's a 14.5MB binary compressed down to 2.9MB!

Starship

Starship is a blazing-fast, customizable prompt written in rust. It works across any shell and looks gorgeous.

ei starship/starship
Enter fullscreen mode Exit fullscreen mode

Coreutils (rust Edition)

If you hit missing dependency errors (like mktemp), uutils/coreutils provides rust implementations of Unix core utilities.

ei ahaoboy/coreutils-build --name mktemp
Enter fullscreen mode Exit fullscreen mode

Neofetch Alternative

The original neofetch doesn't work well with OpenWrt's default sh. There's a rust implementation that works perfectly:

ei ahaoboy/neofetch
Enter fullscreen mode Exit fullscreen mode

You could also use Brush, a rust-based bash shell implementation.

Dufs

Dufs is a powerful file server with WebDAV support—perfect for sharing media across your local network.

ei sigoden/dufs
Enter fullscreen mode Exit fullscreen mode

Amp

Amp is a text editor with syntax highlighting support for multiple languages.

ei jmacdonald/amp
Enter fullscreen mode Exit fullscreen mode

iperf3

iperf3-static is essential for network speed testing.

ei userdocs/iperf3-static
Enter fullscreen mode Exit fullscreen mode

Top comments (0)