2023-05-20 21:52:47 +02:00
# sys-patch
2023-05-26 22:51:45 +02:00
A script-like system module that patches **fs** , **es** , **ldr** and **nifm** on boot.
2023-05-20 21:52:47 +02:00
---
2023-05-23 15:22:44 +02:00
## Config
2023-05-26 22:51:45 +02:00
**sys-patch** features a simple config. This can be manually edited or updated using the overlay.
2023-05-23 15:22:44 +02:00
2023-05-26 22:51:45 +02:00
The configuration file can be found in `/config/sys-patch/config.ini` . The file is generated once the module is ran for the first time.
2023-05-23 15:22:44 +02:00
```ini
[options]
patch_sysmmc=1 ; 1=(default) patch sysmmc, 0=don't patch sysmmc
patch_emummc=1 ; 1=(default) patch emummc, 0=don't patch emummc
2023-05-25 20:52:32 +02:00
logging=1 ; 1=(default) output /config/sys-patch/log.ini 0=no log
2023-05-25 18:05:10 +02:00
version_skip=1 ; 1=(default) skips out of date patterns, 0=search all patterns
2023-05-23 15:22:44 +02:00
```
---
2023-05-25 05:39:51 +02:00
## Overlay
2023-05-26 22:51:45 +02:00
The overlay can be used to change the config options and to see what patches are applied.
2023-05-25 05:39:51 +02:00
- Unpatched means the patch wasn't applied (likely not found).
- Patched (green) means it was patched by sys-patch.
2023-05-26 22:51:45 +02:00
- Patched (yellow) means it was already patched, likely by sigpatches or a custom Atmosphere build.
2023-05-25 05:39:51 +02:00
< p float = "left" >
2023-05-25 23:10:08 +02:00
< img src = "https://i.imgur.com/yDhTdI6.jpg" width = "400" / >
< img src = "https://i.imgur.com/G6U9wGa.jpg" width = "400" / >
< img src = "https://i.imgur.com/cSXUIWS.jpg" width = "400" / >
< img src = "https://i.imgur.com/XNLWLqL.jpg" width = "400" / >
2023-05-25 05:39:51 +02:00
< / p >
---
2023-05-20 21:52:47 +02:00
## Building
### prerequisites
2023-05-26 22:51:45 +02:00
- Install [devkitpro ](https://devkitpro.org/wiki/Getting_Started )
- Run the following:
```sh
git clone --recurse-submodules https://github.com/ITotalJustice/sys-patch.git
cd ./sys-patch
make
```
2023-05-20 21:52:47 +02:00
2023-05-26 22:51:45 +02:00
The output of `out/` can be copied to your SD card.
To activate the sys-module, reboot your switch, or, use [sysmodules overlay ](https://github.com/WerWolv/ovl-sysmodules/releases/latest ) with the accompanying overlay to activate it.
2023-05-25 23:10:08 +02:00
2023-05-20 21:52:47 +02:00
---
## What is being patched?
2023-05-26 22:51:45 +02:00
Here's a quick run down of what's being patched:
2023-05-20 21:52:47 +02:00
2023-05-26 22:51:45 +02:00
- **fs**
- **es**
- **ldr**
- **nifm**
2023-05-20 21:52:47 +02:00
2023-05-26 22:51:45 +02:00
**fs** and **es** need new patches after every new firmware version.
**ldr** needs new patches after every new [Atmosphere ](https://github.com/Atmosphere-NX/Atmosphere/ ) release.
**nifm** ctest patch allows the device to connect to a network without needing to make a connection to a server.
2023-05-20 21:52:47 +02:00
2023-05-26 22:51:45 +02:00
The patches are applied on boot. Once done, the sys-module stops running.
The memory footprint *(16kib)* and the binary size *(~50kib)* are both very small.
2023-05-20 21:52:47 +02:00
---
2023-05-26 22:51:45 +02:00
## FAQ:
2023-05-20 21:52:47 +02:00
2023-05-26 22:51:45 +02:00
### If I am using sigpatches already, is there any point in using this?
2023-05-20 21:52:47 +02:00
2023-05-26 22:51:45 +02:00
Yes, in 3 situations.
2023-05-20 21:52:47 +02:00
2023-05-26 22:51:45 +02:00
1. A new **ldr** patch needs to be created after every Atmosphere update. Sometimes, a new silent Atmosphere update is released. This tool will always patch **ldr** without having to update patches.
2023-05-20 21:52:47 +02:00
2023-05-26 22:51:45 +02:00
2. Building Atmosphere from src will require you to generate a new **ldr** patch for that custom built Atmosphere. This is easy enough due to the public scripts / tools that exist out there, however this will always be able to patch **ldr** .
2023-05-20 21:52:47 +02:00
2023-05-26 22:51:45 +02:00
3. If you forget to update your patches when you update your firmware / Atmosphere, this sys-module should be able to patch everything. So it can be used as a fall back.
2023-05-20 21:52:47 +02:00
2023-05-26 22:51:45 +02:00
### Does this mean that I should stop downloading / using sigpatches?
2023-05-20 21:52:47 +02:00
2023-05-26 22:51:45 +02:00
No, I would personally recommend continuing to use sigpatches. Reason being is that should this tool ever break, i likely wont be quick to fix it.
2023-05-20 21:52:47 +02:00
---
## Credits / Thanks
2023-05-26 22:51:45 +02:00
Software is built on the shoulders of giants. This tool wouldn't be possible without these people:
2023-05-20 21:52:47 +02:00
- MrDude
- BornToHonk (farni)
- TeJay
- ArchBox
- Switchbrew (libnx, switch-examples)
- DevkitPro (toolchain)
2023-05-23 00:22:04 +02:00
- [minIni ](https://github.com/compuphase/minIni )
2023-05-25 05:39:51 +02:00
- [libtesla ](https://github.com/WerWolv/libtesla )