Tutorial  Updated

How to build Overlays from Code

When new version of Atmosphere is deployed, sometimes new LibNX is used and in some cases make overlays do not load or crash Tesla loading. so you need to compile the source code using the latest LibNX

For that you need a DevKitPro environment, under Linux is very easy to setup one, for Windows I do prefer to use MSYS, because is a closed setup do not affected by any software you have on your PC and can be recreated very easy.

I have a tutorial about to setup a DevKitPro environment using MSYS https://gbatemp.net/threads/setup-a-devkitpro-environment-on-windows.652238/post-10389079 is easy and quick.

Once you have a working DevKitPro you neeed to install the packages required, for most to the current OVLs you need:

Open MinGW64

1723053905777.png


And run the next command:

pacman -Syuu --needed --noconfirm git make libnx devkitA64 switch-tools devkita64-rules

And here is where the plot twist, Also sometimes the official LibNX package is not updated yet to latest one on Atmosphere, so you need to build and install the most recent version of LibNX for that you can run the next commands:

Bash:
cd ~
rm -rf libnx
git clone --recursive https://github.com/switchbrew/libnx
cd ~/libnx
make all -j$(nproc)
make install

After some minutes you will have the most recent version of LibNX installed.
1723054400413.png

This step is not always needed you can check on the repository if there is new commits after the most recent release or a PR from Atmosphère developers
1723058417428.png




Once you have all requisites in place you can clone the repository and execute the command make

Each overlay have his own repository, the most used Overlays are:


InfoNX - Shows current information and stats, also can enable «Reduced battery wearing» when docked
Repo: https://github.com/renA21/InfoNX/

DNS-MITM_Manager - Allows you edit DNS-MiTM files
Repo: https://github.com/znxDomain/DNS-MITM_Manager

EdizonOverlay - Manage cheats for the current title and also can show some System Information
Repo: https://github.com/proferabg/EdiZon-Overlay

Emuiibo - Allow you to manage the status of emulated amiibo
For this case you always can go to https://github.com/XorTroll/emuiibo/actions and get the most recent binaries.

ldn_mitm - Allows you to enable disable and setup LDN MiTM service to use LAN-Party over the internet
Repo: https://github.com/DefenderOfHyrule/ldn_mitm/

OvlSysmodules - Enable/Disable, Start/Stop Sysmodules on your console
Repo: https://github.com/WerWolv/ovl-sysmodules

QuickNTP - Allow to sync your clock with NTP server over the network
Repo: https://github.com/nedex/QuickNTP

ShareNX-Overlay - Share your screenshots with configurable storage services.
Repo: https://github.com/HookedBehemoth/ShareNX-Overlay

Status-Monitor-Overlay - Enable a floating overlay showing statistics about the console.
Repo: https://github.com/masagrator/Status-Monitor-Overlay/releases (Also you can use the latest release on repo)

Studious-Pancake (full) With Mariko support - Shows a menu of possible payloads and settings for reboot to.
https://github.com/HookedBehemoth/studious-pancake


All the overlays can be build using this commands:
Bash:
cd ~
git clone --recursive GITHUBREPOSITORYURL
cd  ~/OVERLAYNAME
make -j$(nproc)

By example to build InfoNX you execute:

Bash:
cd ~
git clone --recursive https://github.com/renA21/InfoNX/
cd  ~/InfoNX
make -j$(nproc)

1723057982112.png



Now you can copy the built OVL file to your console.


Also there is a set of software needed to run the overlays:
First and most important is the Tesla Sysmodule, this Atmosphère's sysmodule enable the use of overlays
Originally developed by @WerWolv then the torch was taken by @zdm who tweak the code.
More information: https://gbatemp.net/threads/tesla-the-nintendo-switch-overlay-menu.557362/ and https://tesla.werwolv.net/, https://github.com/WerWolv/nx-ovlloader/releases

The ZDM repository is: https://github.com/zdm65477730/nx-ovlloader

In order to build the sysmodule you need to execute the commands:

Bash:
cd ~
pacman -Syuu --needed --noconfirm git make libnx devkitA64 switch-tools zip
rm -rf ~/nx-ovlloader
git clone --recursive https://github.com/WerWolv/nx-ovlloader
cd  ~/nx-ovlloader
make all -j$(nproc)


The NX-Overlay Sysmodule, loads the main menu of overlays, called Tesla Menu, that menu should exist on the path SDMC:/switch/.overlays/ovlmenu.ovl (WITH THAT EXACT NAME)
This Overlay Menu (TESLA - Menu) is developed by @WerWolv the original repository is: https://github.com/WerWolv/
Also has been tweak by @ZDM on the repository https://github.com/zdm65477730/Tesla-Menu

Tesla-Menu and can be build with the commands:

Bash:
cd ~
pacman -Syuu --needed --noconfirm git make libnx devkitA64 switch-tools
git clone --recursive https://github.com/zdm65477730/Tesla-Menu
cd Tesla-Menu
make all -j$(nproc)


Build Compilation:
On a last note, on the post: https://gbatemp.net/posts/10121629/ I will try to keep a list of the last builds for most Overlays, Thanks to @Lamcza for the idea.
 
Last edited by impeeza,
I personally prefer the docker method. While msys2 is not really affecting and affected by anything on your windows pc, it is installing software to places thats hard to get rid of again without to reinstall msys2. Docker gives you a working environment that you can spin up and delete every time you need it. Its going to be 100% the same every time and if you remove it, its gone. Nothing of it is left on the system.
 
  • Like
Reactions: impeeza
I personally prefer the docker method. While msys2 is not really affecting and affected by anything on your windows pc, it is installing software to places thats hard to get rid of again without to reinstall msys2. Docker gives you a working environment that you can spin up and delete every time you need it. Its going to be 100% the same every time and if you remove it, its gone. Nothing of it is left on the system.
For me is very easy: I kept a MSYS2 folder which have the exact files after installation, so when I need to go back to a start point, only rename the current folder and copy the MSYS2 backup folder and have a full working environment on a know state on 10 seconds.
 
For me is very easy: I kept a MSYS2 folder which have the exact files after installation, so when I need to go back to a start point, only rename the current folder and copy the MSYS2 backup folder and have a full working environment on a know state on 10 seconds.
hey bud good day to you, thanks for an useful tutorial to build overlay and i do some question that i hope you can answer

with the below command enter into MYSYS, we can obtained the latest libnx and you mentioned its not needed but good to check against the repo for new commit.

Bash:
cd ~
rm -rf libnx
git clone --recursive https://github.com/switchbrew/libnx
cd ~/libnx
make all -j$(nproc)
make install


How do we compare the result from MYSYS and from the repos if we have the latest libnx updated? I got the result below

make[1]: Entering directory '/home/XXXX/libnx/nx'
make[2]: '/home/XXXX/libnx/nx/lib/libnx.a' is up to date.
mkdir -p /opt/devkitpro/libnx
bzip2 -cd libnx-4.7.0.tar.bz2 | tar -xf - -C /opt/devkitpro/libnx
make[1]: Leaving directory '/home/XXXX/libnx/nx'
 
hey bud good day to you, thanks for an useful tutorial to build overlay and i do some question that i hope you can answer

with the below command enter into MYSYS, we can obtained the latest libnx and you mentioned its not needed but good to check against the repo for new commit.

Bash:
cd ~
rm -rf libnx
git clone --recursive https://github.com/switchbrew/libnx
cd ~/libnx
make all -j$(nproc)
make install


How do we compare the result from MYSYS and from the repos if we have the latest libnx updated? I got the result below

make[1]: Entering directory '/home/XXXX/libnx/nx'
make[2]: '/home/XXXX/libnx/nx/lib/libnx.a' is up to date.
mkdir -p /opt/devkitpro/libnx
bzip2 -cd libnx-4.7.0.tar.bz2 | tar -xf - -C /opt/devkitpro/libnx
make[1]: Leaving directory '/home/XXXX/libnx/nx'
you only need to generate LIBNX manually if there is a pending PR needed, by example today the PR 651 https://github.com/switchbrew/libnx/pull/651 add support to FW 19

so you need to merge that PR on your local repo clone.

But onche the PR get merged you will NOT NEED to build LibNX.
 
you only need to generate LIBNX manually if there is a pending PR needed, by example today the PR 651 https://github.com/switchbrew/libnx/pull/651 add support to FW 19

so you need to merge that PR on your local repo clone.

But onche the PR get merged you will NOT NEED to build LibNX.
bud wait let me correct myself, does this meant

pacman -Syuu --needed --noconfirm git make libnx devkitA64 switch-tools devkita64-rules is cloning the repo into my computer?

and by entering the below, im actually pulling the pending pr into the libnx on my computer ?
Bash:
cd ~
rm -rf libnx
git clone --recursive https://github.com/switchbrew/libnx
cd ~/libnx
make all -j$(nproc)
make install
 
Last edited by Project_Paradise,
I tried to build a forked ShareNX-Overlay in this way, but it didn't work. I also tried to build the edizon overlay, but it failed to build anything other than infoNX. Can someone help me?
 
I tried to build a forked ShareNX-Overlay in this way, but it didn't work. I also tried to build the edizon overlay, but it failed to build anything other than infoNX. Can someone help me?
The original ShareNX-Overlay can be build from code using this commands:

Code:
cd ~
rm -rf ShareNX-Overlay
pacman -Syuu --noconfirm git make devkit-env libnx devkitA64 switch-tools switch-curl
git clone --recursive https://github.com/HookedBehemoth/ShareNX-Overlay
cd ~/ShareNX-Overlay
git fetch origin pull/13/head
git checkout -b pullrequest FETCH_HEAD
make all -j$(nproc)

I do use MSYS2 if you use another OS you may be need to use dkp-pacman

You Must note that repository needs the PR#13 merged which corrects some build errors on latest LibNX and part of the QR Code.

The fork of @TotalJustice (https://github.com/ITotalJustice/ShareNX-Overlay) have the PR merged, He is the hero whom created the PR13.
 
Last edited by impeeza,
  • Like
Reactions: HoRy205
The original ShareNX-Overlay can be build from code using this commands:

Code:
cd ~
rm -rf ShareNX-Overlay
pacman -Syuu --noconfirm git make devkit-env libnx devkitA64 switch-tools switch-curl
git clone --recursive https://github.com/HookedBehemoth/ShareNX-Overlay
cd ~/ShareNX-Overlay
git fetch origin pull/13/head
git checkout -b pullrequest FETCH_HEAD
make all -j$(nproc)

I do use MSYS2 if you use another OS you may be need to use dkp-pacman

You Must note that repository needs the PR#13 merged which corrects some build errors on latest LibNX and part of the QR Code.

The fork of @TotalJustice (https://github.com/ITotalJustice/ShareNX-Overlay) have the PR merged, He is the hero whom created the PR13.


hello Impeeza, firstly thanks for all the usseful posts you did from setup a devkitpro environment on windows to updating libnx.
this is the first time im trying to update libnx and learn how to rebuild those repos (since ams 20.0.1) is out
Referring to my attached photo, i have libnx folder created after typing

cd ~
rm -rf libnx
git clone --recursive https://github.com/switchbrew/libnx
cd ~/libnx
make all -j$(nproc)
make install

your first post to this thread and i quote " Once you have all requisites in place you can clone the repository and execute the command make"

does that mean i still need to execute the command make in the libnx folder in order for libnx to be updated ?
Screenshot 2025-05-08 103257.png

Screenshot 2025-05-08 101753.png
Screenshot 2025-05-08 102246.png
 
Last edited by impeeza,
  • Like
Reactions: Project_Paradise
To be clear you don't need to rebuild overlays. All of tesla overlay foundation works fine with 20.0.0

Only what libnx change does is mainly fixing stylistic warnings. I know no overlay that uses code that was fixed in 20_support branch. And you wouldn't be able to compile code using changed functions anyway without source code update.
 
Last edited by masagrator,
Hi. Thanks for you kind words. Yes you need to run make install from libnx folder.

If you want the most recent version (today) you need to clone the https://github.com/Atmosphere-NX/libnx repo ON THE BRANCH 20_support white the command:

git clone --recursive https://github.com/Atmosphere-NX/libnx -b 20_support



@impeeza Yes, i followed the link you gave me to obtain the latest libnx as shown, so i just need to make install from libnx folder after this ?
Screenshot 2025-05-08 101753.png
Screenshot 2025-05-08 114558.png
Post automatically merged:

To be clear you don't need to rebuild overlays. All of tesla overlay foundation works fine with 20.0.0

Only what libnx change does is mainly fixing stylistic warnings. I know no overlay that uses code that was fixed in 20_support branch. And you wouldn't be able to compile code using changed functions anyway without source code update.
thank you, i am not rebuilding overlays. Im just taking this opportunity to learn how to update libnx and use it for updating other repos
 
Post automatically merged:


thank you, i am not rebuilding overlays. Im just taking this opportunity to learn how to update libnx and use it for updating other repos
I haven't test nor overkay sysmodule nor overkay menus nor overlays in fwm. But as far I has been to see on new atmosphère and LibNX code, no need for new builds so far
 
  • Like
Reactions: Project_Paradise
I haven't test nor overkay sysmodule nor overkay menus nor overlays in fwm. But as far I has been to see on new atmosphère and LibNX code, no need for new builds so far


No i am not updating overlay, i am just trying to learn how to build and update libnx so i can update other repo in future.
 
  • Love
Reactions: impeeza

Site & Scene News

Popular threads in this forum