Minimal HTTP download utility for constrained embedded Linux environments
such as HiSilicon-based IP cameras. Works as a lightweight curl/wget
replacement when binary size matters.
Two variants are provided:
| Variant | Size | Description |
|---|---|---|
uget |
~4.7 KB | C version — portable, easy to modify |
uget-asm |
~2.6 KB | ARM32 assembly — smallest possible, uses raw syscalls |
Both are functionally identical. The assembly version eliminates CRT startup
overhead and uses Linux syscalls directly, keeping only gethostbyname and
mkstemp from libc.
Pre-built binaries for all supported platforms are available on the Releases page.
- HTTP-only (no HTTPS, no redirects) to keep the binary small
- Download to stdout, just like
curl - Download-and-execute mode (
uget run <url>) for ad-hoc binary deployment - Companion
bin2shtool to transfer binaries over telnet via copy-paste - Exit codes derived from HTTP status (e.g., 404 -> exit 44)
Download a file to stdout:
uget ifconfig.meDownload and run a binary from an S3 bucket:
uget run openipc.s3-eu-west-1.amazonaws.com/ipc_chip_infoThe bin2sh tool converts a binary into a shell script of printf commands
that can be copy-pasted over a telnet session:
# On your workstation
./bin2sh uget > uget.sh
# Log in to the device via telnet, then paste the contents of uget.sh.
# The binary will be reconstructed in /tmp.
# If the target system does not support printf:
./bin2sh -echo uget > uget.shRequires a HiSilicon cross-compiler and upx. See the
toolchains repo for available
cross-compilers.
# Cross-compile both variants (default: arm-hisiv510-linux-)
make
# Cross-compile with a different toolchain
make CROSS_COMPILE=arm-hisiv500-linux-uclibcgnueabi-
# Build only the C version
make uget
# Build only the assembly version
make uget-asm
# Build bin2sh only (native, no cross-compiler needed)
make bin2sh| Code | Description |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Socket creation error |
| 3 | DNS resolution error |
| 4 | Connection error |
| 5 | Send error |
| 6 | Invalid command-line options |
HTTP response codes other than 2xx are compressed from three digits to two:
the first and last digit are kept (e.g., 404 -> exit 44, 502 -> exit 52).