Skip to content
Wolfvak edited this page Jul 28, 2021 · 1 revision

How to build

Install dependencies

$ sudo apt install git build-essential flex bison libssl-dev bc

Fetch sources

$ git clone https://github.com/linux-3ds/buildroot.git

Build

Compilation is pretty slow because it will download and compile an entire gcc toolchain, locally install it, and then build the libc (musl) and the single busybox package. It can easily take over 30 minutes on a fairly modern Core i7 with 4C/8T, and take around 4GB of RAM.

$ cd buildroot
$ make nintendo3ds_defconfig
$ make -j$(nproc) all # this will take a lot of time

Copy the output to the linux tree

There will be a rootfs.cpio.gz file in the buildroot/output/images/ directory, this file can then be fed into the kernel tree in order to compile a kernel that will automatically boot into the generated rootfs.

example:

$ cp output/images/rootfs.cpio.gz ~/linux_3ds_source_code/rootfs.cpio.gz
$ ... follow the build instructions in the kernel wiki ...
Clone this wiki locally