Tutorial Setting up development environment for compiling custom firmwares on *nix

Did it work?

  • Yes, Ubuntu.

    Votes: 1 100.0%
  • Yes, Linux Mint.

    Votes: 0 0.0%
  • Yes, on other Debian derivation.

    Votes: 0 0.0%
  • Yes, on other *nix.

    Votes: 0 0.0%
  • No, on Debian derivation.

    Votes: 0 0.0%
  • No, on other *nix.

    Votes: 0 0.0%

  • Total voters
    1

Pokéidiot

Well-Known Member
OP
Member
Joined
Dec 6, 2015
Messages
244
Trophies
0
Location
\n?
XP
209
Country
Brazil
This guide will assist you through setting up environment to build custom firmwares *nix distributions. As usual, you will need build tools (gcc, ld, etc.) and devkitPRO installed. None of the tools that CFW sources uses on their build scripts (like armips) are currently precompiled for linux on their respective repos, so we'll build each.

Newer custom firmwares (like Luma, etc.) requires armips to compile. These executions are on first lines of their makefiles, so typing make without having armips installing will cause the build process to fail and eventually stop. This section will assist you through the process of compiling and installing armips on *nix.
1. Open up a terminal.
2. Make sure to have git installed. We'll clone armips repo. Use the command below.
Code:
git clone --recursive https://github.com/Kingcom/armips.git
3. Once done, we'll enter armips folder. You will see that there's no makefile in there, but we'll build one from the CMakeLists.txt file present in there.
Code:
cd armips
cmake CMakeLists.txt
4. The process should be near instant. After that, build armips by typing
Code:
make
5. Time to install it. If you don't do, you will not be able to use it from any folder. We will put it into our devkitARM bin folder. This will require superuser permission, so make sure to have in mind your su password.
Code:
sudo cp ./armips /opt/devkitpro/devkitARM/bin
6. You now have armips installed. You can run it from anywhere.

makerom is needed to compile CFW, still useful to build CIAs from ARM11 homebrew.
1. Open up a terminal.
2. Make sure to have git installed. We'll clone profi200's Project_CTR repo. Use the command below.
Code:
git clone --recursive https://github.com/profi200/Project_CTR.git
3. Once done, enter Project_CTR folder. There will be 2 folders, ctrtool and makerom. We'll compile only makerom.
Code:
cd Project_CTR
cd makerom
make
4. Wait building to be complete. Once done you will end up with the "makerom" exec on the folder, ready to be used.
5. We'll install it under our devkitARM bin folder, and again, this requires superuser. Remember your su password!
Code:
sudo cp ./makerom /opt/devkitpro/devkitARM/bin
6. You now have makerom installed. You can run it from anywhere.
* If you want ctrtool, repeat step 3 to 6 by using ctrtool instead of makerom.

bin2c is a tool of which create C sources from binary files. Required to build CFW but it's also useful to hardcode binaries into code.
* bin2c isn't on github, it's on sourceforge. Get it from there.
1. You will end up with a zip file once finished download. In it should be a C script. Extract it in a folder.
2. Open up a terminal and change directory to the folder that you placed bin2c.c.
3. Done that, compile bin2c.c to bin2c.
Code:
gcc bin2c.c -o bin2c
4. This should be near instant. You will end up with a fresh bin2c binary.
5. As usual, install it on devkitARM bin. This isn't really for ARM but still... yeah. superuser permissions required, as usual.
Code:
sudo cp ./bin2c /opt/devkitpro/devkitARM/bin
6. You now have bin2c installed. You can run it from anywhere.

Now that you have all things needed installed, your *nix is now ready to compile custom firmwares. Some of them may require other tools, but this guide only covers what's needed to build the simple things (luma3DS and derivations should build with no problems).
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: @SylverReZ, Indeed lol