Building from Source
Building from Source
Section titled “Building from Source”This guide explains how to build ryu_ldn_nx from source.
Prerequisites
Section titled “Prerequisites”Using Docker (Recommended)
Section titled “Using Docker (Recommended)”- Docker
- Docker Compose
Native Build
Section titled “Native Build”- devkitPro with devkitA64
- libnx
- Atmosphere-libs (submodule)
- libultrahand (submodule, for overlay)
Docker Build
Section titled “Docker Build”The easiest way to build is using Docker:
# Clone the repositorygit clone --recursive https://github.com/Ethiquema/ryu_ldn_nx.gitcd ryu_ldn_nx
# Build sysmodule + overlay + dist ZIP + output/ directorydocker compose run --rm build
# Run host unit testsdocker compose run --rm test
# Clean all build artifacts and output/docker compose run --rm cleanPer-Suite Test Targets
Section titled “Per-Suite Test Targets”Run individual test suites:
cd tests && make test-ldn-state-machine# Available: protocol, config, config-manager, log, socket,# tcp-client, connection-state, reconnect, client, ldn-types,# ldn-state-machine, ldn-proxy, ldn-error, ldn-integration,# overlay, ipc-config, config-ipc-service, shared-state,# packet-dispatcher, session-handler, proxy-handler,# handler-integration, upnp, p2p-proxy, p2p-client,# p2p-integration, p2p-create-network
# Coverage reportmake COVERAGE=1 coverageBuild Outputs
Section titled “Build Outputs”After building:
| Output | Path | Description |
|--------|------|-------------|
| Sysmodule (.nsp) | sysmodule/ryu_ldn_nx.nsp | Main sysmodule binary |
| Overlay (.ovl) | overlay/ryu_ldn_nx_overlay.ovl | Tesla overlay |
| Debug symbols | sysmodule/ryu_ldn_nx.elf | Debug ELF |
| Dist package | output/ | SD card directory structure |
| Release ZIP | sysmodule/ryu_ldn_nx-release.zip | Release package |
The output/ directory contains the full SD card layout:
output/├── atmosphere/contents/4200000000000010/│ ├── exefs.nsp│ ├── main.npdm│ ├── toolbox.json│ └── flags/boot2.flag├── config/ryu_ldn_nx/│ ├── config.ini.example│ └── gamelist.txt└── switch/.overlays/ └── ryu_ldn_nx_overlay.ovlNative Build
Section titled “Native Build”If you prefer building natively (requires devkitPro toolchain):
1. Install devkitPro
Section titled “1. Install devkitPro”Follow the devkitPro getting started guide.
dkp-pacman -S switch-dev libnx2. Clone Repository
Section titled “2. Clone Repository”git clone --recursive https://github.com/Ethiquema/ryu_ldn_nx.gitcd ryu_ldn_nx3. Build Sysmodule
Section titled “3. Build Sysmodule”cd sysmodulemake -j$(nproc)4. Build Overlay
Section titled “4. Build Overlay”The overlay uses libultrahand (included as a submodule in overlay/libultrahand/):
cd overlaymake -j$(nproc)5. Distribution Package
Section titled “5. Distribution Package”cd sysmodule && make distThis produces the output/ directory and ryu_ldn_nx-release.zip with the correct SD card layout. The config file is not included in dist because ensure_config_exists() in config.cpp auto-creates it on first boot.
Creating a Release Package
Section titled “Creating a Release Package”The recommended way is using the dist target:
# Build everything + distdocker compose run --rm build # includes dist
# Or natively:cd sysmodule && make distThis produces the correct directory structure with all required files including boot2.flag and toolbox.json.
Debugging
Section titled “Debugging”Interactive GDB against a running Switch:
docker compose run --rm debugger <SWITCH_IP> [PID]GDB presets and component-specific debug scripts live in scripts/debugger/.
Troubleshooting Build Issues
Section titled “Troubleshooting Build Issues”Submodules not initialized
Section titled “Submodules not initialized”git submodule update --init --recursiveMissing libnx
Section titled “Missing libnx”dkp-pacman -S libnxAtmosphere-libs errors
Section titled “Atmosphere-libs errors”Make sure you have the correct version:
cd sysmodule/Atmosphere-libsgit checkout <required-version>libultrahand not found
Section titled “libultrahand not found”The overlay uses libultrahand as a submodule in overlay/libultrahand/. Make sure submodules are initialized:
git submodule update --init --recursive