Skip to content

Building from Source

This guide explains how to build ryu_ldn_nx from source.

  • Docker
  • Docker Compose
  • devkitPro with devkitA64
  • libnx
  • Atmosphere-libs (submodule)
  • libultrahand (submodule, for overlay)

The easiest way to build is using Docker:

Terminal window
# Clone the repository
git clone --recursive https://github.com/Ethiquema/ryu_ldn_nx.git
cd ryu_ldn_nx
# Build sysmodule + overlay + dist ZIP + output/ directory
docker compose run --rm build
# Run host unit tests
docker compose run --rm test
# Clean all build artifacts and output/
docker compose run --rm clean

Run individual test suites:

Terminal window
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 report
make COVERAGE=1 coverage

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.ovl

If you prefer building natively (requires devkitPro toolchain):

Follow the devkitPro getting started guide.

Terminal window
dkp-pacman -S switch-dev libnx
Terminal window
git clone --recursive https://github.com/Ethiquema/ryu_ldn_nx.git
cd ryu_ldn_nx
Terminal window
cd sysmodule
make -j$(nproc)

The overlay uses libultrahand (included as a submodule in overlay/libultrahand/):

Terminal window
cd overlay
make -j$(nproc)
Terminal window
cd sysmodule && make dist

This 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.

The recommended way is using the dist target:

Terminal window
# Build everything + dist
docker compose run --rm build # includes dist
# Or natively:
cd sysmodule && make dist

This produces the correct directory structure with all required files including boot2.flag and toolbox.json.

Interactive GDB against a running Switch:

Terminal window
docker compose run --rm debugger <SWITCH_IP> [PID]

GDB presets and component-specific debug scripts live in scripts/debugger/.

Terminal window
git submodule update --init --recursive
Terminal window
dkp-pacman -S libnx

Make sure you have the correct version:

Terminal window
cd sysmodule/Atmosphere-libs
git checkout <required-version>

The overlay uses libultrahand as a submodule in overlay/libultrahand/. Make sure submodules are initialized:

Terminal window
git submodule update --init --recursive