Skip to content

Device Debugging Toolset

Luís Pinto edited this page Jun 22, 2026 · 7 revisions

Prebuilt binary-analysis and debugging tools for the Miyoo Mini+ can be downloaded from the main MMP repository.

What's Included

Binary Version Linkage Use Cases
addr2line binutils 2.32 dynamic glibc Map addresses to source lines with DEBUG info.
nm ↑ ↑ List symbols in binaries and object files.
objdump ↑ ↑ Disassemble code and inspect relocations.
readelf ↑ ↑ Inspect ELF headers, sections, and dependencies.
file 5.39 ↑ Identify file types using MAGIC <magic.mgc>.
gdb 8.3.1 ↑ Debug programs directly on the device via GDB.
gdbserver 8.3.1 static Let host's GDB debug a program on the device.
strace 5.10 ↑ Trace a process's system calls.
ldd Shell script -- Show shared library dependencies.

Note

Dynamically linked binaries use the device's existing glibc loader and libraries; including /lib/ld-linux-armhf.so.3, /lib/libc.so.6; and, where needed, /lib/libdl.so.2 or /lib/libm.so.6.

Using the Prebuilt Bundle

# SSH connection details for your Miyoo Mini+ device will depend on your firmware and LAN setup:
ipAddress="192.168.1.128"
user="root"
localDirectory="$HOME/binaries"
remoteDirectory="/mnt/SDCARD/.tmp_update/bin"
sshOptions=(
    -o StrictHostKeyChecking=accept-new
    -o MACs=hmac-sha1
    -o IgnoreUnknown=WarnWeakCrypto
    -o WarnWeakCrypto=no
)

# Read the SSH password:
read -r -s -p "SSH password: " SSHPASS
export SSHPASS
printf '\n'

# Download the prebuilt binaries to the '$localDirectory':
githubRawBaseUrl="https://github.com/Luspin/MMP/raw/refs/heads/main/src/tools/binaries"

binaryFiles=(
    addr2line
    file
    gdb
    gdbserver
    ldd
    magic.mgc
    nm
    objdump
    readelf
    strace
)

wgetOptions=(
    --continue
    --directory-prefix="$localDirectory"
    --input-file=-
    --no-http-keep-alive
    --random-wait
    --retry-on-http-error=429,500,502,503,504
    --tries=5
    --wait=5
    --waitretry=10
)

mkdir --parents "$localDirectory"

for binaryFile in "${binaryFiles[@]}"; do
    printf '%s/%s\n' "$githubRawBaseUrl" "$binaryFile"
done | wget "${wgetOptions[@]}"

# Create the $remoteDirectory on the Miyoo Mini+ device:
sshpass -e ssh \
    "${sshOptions[@]}" \
    "$user@$ipAddress" \
    "mkdir -p '$remoteDirectory'"

# Copy each file to the $remoteDirectory:
for binaryFile in "${binaryFiles[@]}"; do
    remoteMode=755
    if [[ "$binaryFile" == "magic.mgc" ]]; then
        remoteMode=644
    fi

    sshpass -e ssh \
        "${sshOptions[@]}" \
        "$user@$ipAddress" \
        "cat > '$remoteDirectory/$binaryFile' && chmod $remoteMode '$remoteDirectory/$binaryFile'" \
        < "$localDirectory/$binaryFile"
done

unset SSHPASS

Note

  • Remember to replace the ipAddress, user, and remoteDirectory variables with values that match your firmware and LAN setup.
  • The GitHub API allows unauthenticated requests, but repeated requests may hit IP-based rate limits:
    Rate limits for the REST API

Optional Steps

After copying the binaries to the Miyoo Mini+, you can SSH into it with the $remoteDirectory added to its PATH:

# 'MAGIC' lets 'file' find 'magic.mgc' without passing '--magic-file' each time:
sshpass -e ssh \
    -t \
    "${sshOptions[@]}" \
    "$user@$ipAddress" \
    "export PATH='$remoteDirectory':\$PATH; export MAGIC='$remoteDirectory/magic.mgc'; exec sh"

Rebuilding From Source

You can run the build.sh script directly from the MMP repository if you need to regenerate the binaries/ bundle:

# Set the local build directory and GitHub source URL:
toolSourceDirectory="$HOME/src/MMP/src/tools"
toolSourceBaseUrl="https://github.com/Luspin/MMP/raw/refs/heads/main/src/tools"

# Create the directory layout expected by 'build.sh':
mkdir --parents "$toolSourceDirectory/binaries"
cd "$toolSourceDirectory"

# Download the build script:
wget \
    --output-document=build.sh \
    "$toolSourceBaseUrl/build.sh"

# Download the maintained 'ldd' wrapper required by the build script:
wget \
    --output-document=binaries/ldd \
    "$toolSourceBaseUrl/binaries/ldd"

# Make the downloaded scripts executable (755):
chmod 755 \
    build.sh \
    binaries/ldd

# Build:
./build.sh

The build.sh script creates src/, src/Downloads/, and binaries/ next to build.sh.
It then downloads source archives into src/Downloads/, extracts source trees under src/, cross-compiles the tools, and stages the result in binaries/.

Note

  • gdb is built without TUI, curses, expat, Python, or Guile to avoid extra on-device dependencies.
  • gdb has libstdc++ and libgcc linked in, so those do not need to be installed separately on the Miyoo Mini+.

Source versions are fixed by default in the build.sh script, but you can edit the script to build different versions if needed:

Tool(s) Source package Version
readelf, objdump, nm, addr2line binutils 2.32
file, magic.mgc file 5.39
gdb, gdbserver gdb 8.3.1
ldd Shell script --
strace strace 5.10

⬅️ Previous Article
Deployment and Testing

Next Article ➡️
GDB Usage

Clone this wiki locally