Skip to main content
Upload, list, and remove custom binaries on Lagerboxes for use in Python scripts.

Syntax

lager binaries COMMAND [OPTIONS]

Commands

CommandDescription
addUpload a binary to a Lager Box
listList custom binaries on a Lager Box
removeRemove a binary from a Lager Box

Command Reference

add

Upload a binary file to the Lager Box.
lager binaries add BINARY_PATH [OPTIONS]
Arguments:
  • BINARY_PATH - Local path to the binary file
Options:
  • --box BOX - Lagerbox name or IP address
  • --name NAME - Name for the binary on Lager Box (defaults to filename)
  • --yes - Skip confirmation prompt
Examples:
# Upload with default name
lager binaries add ./my_tool --box lab-lager-box

# Upload with custom name
lager binaries add ./rt_newtmgr_v1.2 --name rt_newtmgr --box lab-lager-box

# Skip confirmation
lager binaries add ./firmware_flasher --box lab-lager-box --yes

list

List all custom binaries on a Lager Box.
lager binaries list --box BOX
Output:
Custom binaries on lab-lager-box:
  rt_newtmgr (1.2 MB)
  firmware_flasher (856 KB)
  custom_tool (234 KB)

remove

Remove a binary from the Lager Box.
lager binaries remove BINARY_NAME [OPTIONS]
Arguments:
  • BINARY_NAME - Name of the binary to remove
Options:
  • --box BOX - Lagerbox name or IP address
  • --yes - Skip confirmation prompt
Examples:
# Remove with confirmation
lager binaries remove old_tool --box lab-lager-box

# Remove without confirmation
lager binaries remove old_tool --box lab-lager-box --yes

Storage Locations

Binaries are stored in:
LocationPath
Host (Lager Box)/home/lagerdata/third_party/customer-binaries/
Container/home/www-data/customer-binaries/

Using Binaries in Python Scripts

Once uploaded, binaries can be called from Python scripts running on the Lager Box:
import subprocess

# Call the binary with arguments
result = subprocess.run(
    ['/home/www-data/customer-binaries/rt_newtmgr', 'arg1', 'arg2'],
    capture_output=True,
    text=True,
    timeout=30
)

if result.returncode == 0:
    print(f"Success: {result.stdout}")
else:
    print(f"Error: {result.stderr}")

Adding to PATH (Optional)

To call binaries without the full path, modify the Lager Box Dockerfile:
# In gateway/lager/docker/gatewaypy3.Dockerfile
ENV PATH="/home/www-data/customer-binaries:${PATH}"
Then rebuild the container:
lager update --box lab-lager-box --yes
Now you can call binaries directly:
subprocess.run(['rt_newtmgr', 'arg1', 'arg2'], ...)

Examples

# Complete workflow
# 1. Upload binary
lager binaries add ./my_custom_tool --box lab-lager-box --yes

# 2. Verify it's there
lager binaries list --box lab-lager-box

# 3. Use in Python script
lager python ./test_script.py --box lab-lager-box

# 4. Clean up when done
lager binaries remove my_custom_tool --box lab-lager-box --yes

Use Cases

Device Communication Tools

Upload vendor-specific tools for device interaction:
lager binaries add ./vendor_cli --box lab-lager-box

Firmware Tools

Upload custom firmware manipulation tools:
lager binaries add ./sign_firmware --box lab-lager-box
lager binaries add ./encrypt_image --box lab-lager-box

Test Utilities

Upload test-specific utilities:
lager binaries add ./stress_test --box lab-lager-box
lager binaries add ./validate_output --box lab-lager-box

Notes

  • Binaries must be Linux x86_64 compatible
  • Files are automatically made executable
  • Container restart is not required (volume mount)
  • File sizes are displayed in human-readable format
  • Use --yes to skip confirmation in scripts