This directory contains the unified build environment for the Lidl/Silvercrest Gateway project. It provides all tools needed to build both:
- Main SoC (RTL8196E) — Linux kernel, root filesystem, userdata
- Zigbee Radio (Silabs EFR32) — NCP/RCP firmware
| Docker | Native Ubuntu | |
|---|---|---|
| Setup time | ~45 min (one-time) | ~45 min (one-time) |
| Disk space | ~8 GB (image) | ~4 GB (tools) |
| Best for | Any OS, reproducible builds | Ubuntu 22.04, faster I/O |
| Windows | Requires Docker Desktop | Recommended: WSL2 + native |
Windows users: WSL2 with Ubuntu 22.04 is the recommended approach. Native builds in WSL2 are simpler and faster than Docker Desktop.
Build the Docker image once, then use it for all builds.
cd 1-Build-Environment
docker build -t lidl-gateway-builder .This takes ~45 minutes (downloads and compiles toolchains).
From the 1-Build-Environment directory:
# Interactive shell
docker run -it --rm -v $(pwd)/..:/workspace lidl-gateway-builder
# Build Main SoC (bootloader + kernel + rootfs + userdata)
docker run -it --rm -v $(pwd)/..:/workspace lidl-gateway-builder \
/workspace/3-Main-SoC-Realtek-RTL8196E/build_rtl8196e.sh
# Build all EFR32 firmware (bootloader + NCP + RCP + OT-RCP + Router)
docker run -it --rm -v $(pwd)/..:/workspace lidl-gateway-builder \
/workspace/2-Zigbee-Radio-Silabs-EFR32/build_efr32.sh| Option | Description |
|---|---|
-it |
Interactive mode with terminal |
--rm |
Remove container after exit |
-v $(pwd)/..:/workspace |
Mount project root to /workspace |
The -v mount is bidirectional: built files appear in your local directories.
For native Ubuntu or WSL2 users. Recommended for Windows users.
# Clone the repository (anywhere, rename if you want)
git clone https://github.com/jnilo1/hacking-lidl-silvercrest-gateway.git
cd hacking-lidl-silvercrest-gateway/1-Build-Environment
# Install everything — takes ~45 minutes
sudo ./install_deps.shThis single command installs everything:
- Ubuntu packages (build tools, Java, etc.)
- Lexra MIPS toolchain (for Main SoC)
- Realtek tools (cvimg, lzma)
- Silabs tools (slc-cli, Gecko SDK, ARM GCC, Commander)
All tools are installed inside the project directory:
<project>/x-tools/— Lexra toolchain<project>/silabs-tools/— Silabs toolchain
Build scripts auto-detect these locations — no PATH configuration needed.
<project>/
├── x-tools/ # Lexra toolchain (created by build)
│ └── mips-lexra-linux-musl/
│
├── silabs-tools/ # Silabs toolchain (created by install)
│ ├── slc_cli/
│ ├── gecko_sdk/
│ ├── arm-gnu-toolchain/
│ ├── commander/
│ ├── SimplicityStudio/ # slc workspace (kept here via JAVA_TOOL_OPTIONS)
│ └── env.sh # Source to load Silabs environment
│
└── 1-Build-Environment/
├── README.md # This file
├── CHANGELOG.md # Build environment & toolchain changelog
├── Dockerfile # Docker image definition
├── install_deps.sh # Ubuntu package installation
│
├── 10-lexra-toolchain/ # Lexra MIPS toolchain
│ ├── build_toolchain.sh # Build script
│ ├── crosstool-ng.config # Crosstool-ng configuration
│ ├── TOOLCHAIN_UPDATE.md # Toolchain modernization spec (Alpine rebase)
│ └── patches/ # GCC / binutils / musl patches for Lexra
│
├── 11-realtek-tools/ # Realtek image tools
│ ├── build_tools.sh # Build script (also downloads mtd-utils for flash_erase)
│ ├── bin/ # Built binaries: cvimg, lzma, flash_erase (output)
│ ├── cvimg/ # cvimg source
│ ├── lzma-4.65/ # LZMA compressor source
│ └── lzma-loader/ # LZMA decompression loader source
│
└── 12-silabs-toolchain/ # Silicon Labs tools
└── install_silabs.sh # Download and install slc-cli + SDK
| Item | Value |
|---|---|
| Target | mips-lexra-linux-musl |
| GCC | 15.2.0 |
| binutils | 2.45.1 |
| C library | musl 1.2.6 |
| Location | <project>/x-tools/mips-lexra-linux-musl/ |
The Lexra architecture is a MIPS variant without unaligned access instructions (lwl, lwr, swl, swr). Standard MIPS toolchains won't work.
| Item | Value |
|---|---|
| Target | arm-none-eabi |
| GCC | 12.2 |
| SDK | Gecko SDK 4.5.0 |
| CLI | slc-cli 5.11.1.0 |
| Location | <project>/silabs-tools/ |
| Tool | Description |
|---|---|
cvimg |
Create Realtek flash images |
lzma |
LZMA compressor |
lzma-loader |
LZMA decompressor (legacy, replaced by zboot) |
If the toolchain build fails with network errors, retry:
docker build --no-cache -t lidl-gateway-builder .The Silabs download may require login. If wget fails, manually download from: https://www.silabs.com/developers/simplicity-studio
Both toolchains are auto-detected by build scripts when installed in the project directory:
- Lexra:
<project>/x-tools/mips-lexra-linux-musl/ - Silabs:
<project>/silabs-tools/
If you installed elsewhere, set the PATH manually or use the env.sh script generated during installation.
After setting up the build environment:
- Build Main SoC:
./3-Main-SoC-Realtek-RTL8196E/build_rtl8196e.sh— See 3-Main-SoC-Realtek-RTL8196E - Build EFR32 firmware:
./2-Zigbee-Radio-Silabs-EFR32/build_efr32.sh— See 2-Zigbee-Radio-Silabs-EFR32
Both scripts accept individual targets (e.g., build_rtl8196e.sh kernel, build_efr32.sh ncp rcp). Run with --help for details.