Compare commits
26 Commits
72a2083d76
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| eb18bf8c72 | |||
| 05926f7828 | |||
| 7b85d428a8 | |||
| dce83bc3be | |||
| a26531c702 | |||
| c0741beda3 | |||
| d6ec345cce | |||
| 9990dfb2ba | |||
| c7ad761592 | |||
| 59f103874c | |||
| dce11538d1 | |||
| 21f8e0e38a | |||
| 0ad2c63123 | |||
| 6780936d2d | |||
| 82639a7a86 | |||
| bff8bc1910 | |||
| c9bcb29f50 | |||
| dc97677e72 | |||
| 4535c4508f | |||
| 726ef77194 | |||
| 13c35400a1 | |||
| f71b6ab629 | |||
| 9b559eb7e6 | |||
| d3735d17ee | |||
| db7d83304f | |||
| 113542f7fb |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -20,3 +20,6 @@ Thumbs.db
|
||||
# Version file is tracked, ignore local edits
|
||||
# VERSION
|
||||
|
||||
# Vendored TegraExplorer tree
|
||||
source/TegraExplorer/
|
||||
|
||||
|
||||
90
DEBUG_INI.md
Normal file
90
DEBUG_INI.md
Normal file
@@ -0,0 +1,90 @@
|
||||
# Debug configuration (`debug.ini`)
|
||||
|
||||
Optional file to **skip parts of the install** for testing (e.g. run only deletion and inspect the SD card). If the file is **missing**, the installer ignores debug entirely and runs the full flow.
|
||||
|
||||
## Location
|
||||
|
||||
```
|
||||
sd:/config/omninx/debug.ini
|
||||
```
|
||||
|
||||
Create the folder `sd:/config/omninx/` on the SD card if it does not exist. Same parent directory as `manifest.ini` and `config.ini`.
|
||||
|
||||
## Format
|
||||
|
||||
- Section name must be exactly **`[Debug]`** (case-sensitive in the parser).
|
||||
- One key per line: `name=value`.
|
||||
- **Enabling a skip:** set the value so it **starts** with one of: `1`, `t`, `T`, `y`, `Y`
|
||||
Examples: `1`, `true`, `yes`, `True` — all enable that skip.
|
||||
- **Disabling:** `0`, `false`, `no`, or omit the key.
|
||||
|
||||
## Parameters
|
||||
|
||||
### Clean install mode (`INSTALL_MODE_CLEAN`)
|
||||
|
||||
| Key | What is skipped |
|
||||
|-----|-----------------|
|
||||
| `skip_clean_backup` | Step 1 — backup of `sd:/switch/DBI/dbi.config`, `sd:/switch/prod.keys` to `sd:/temp_backup` |
|
||||
| `skip_clean_wipe` | Step 2 — all cleanup from `deletion_lists_clean.h` (deletion / wipe) |
|
||||
| `skip_clean_restore` | Step 3 — restore from `sd:/temp_backup` and post-restore paths (e.g. delete `sd:/switch/tinfoil/db`) |
|
||||
| `skip_clean_install` | Step 4 — copy files from the OmniNX staging folder to the SD root |
|
||||
| `skip_clean_staging_cleanup` | After install: do not remove the staging directory or other variant staging folders |
|
||||
|
||||
### Update mode (`INSTALL_MODE_UPDATE`)
|
||||
|
||||
| Key | What is skipped |
|
||||
|-----|-----------------|
|
||||
| `skip_update_cleanup` | Step 1 — selective deletion from `deletion_lists_update.h` |
|
||||
| `skip_update_install` | Step 2 — copy from staging to SD |
|
||||
| `skip_update_staging_cleanup` | End: do not remove staging / other variant folders |
|
||||
| `skip_update_horizon_oc` | **OC variant only:** HorizonOC config backup before update, restore and cleanup after (entire HorizonOC update side path) |
|
||||
|
||||
### Both modes
|
||||
|
||||
| Key | What is skipped |
|
||||
|-----|-----------------|
|
||||
| `skip_hekate_8gb_post_copy` | After a successful copy: the optional `hekate_8GB` / RAM menu and related file moves (see `install_hekate_8gb_post_copy` in `install.c`) |
|
||||
|
||||
## Behaviour
|
||||
|
||||
- On startup, if `debug.ini` exists and parses successfully, the payload prints a **DEBUG-MODUS** banner listing which skips are active.
|
||||
- If the file is absent, unreadable, or has no `[Debug]` section, **no** skips apply — behaviour matches a release install.
|
||||
- Skipping steps can leave the SD in an inconsistent state; this is **for developers/testers only**.
|
||||
|
||||
## Examples
|
||||
|
||||
### Wipe only (test deletion, no backup/restore/copy)
|
||||
|
||||
Inspect leftovers after the clean-install wipe, without backing up, restoring, installing, or cleaning staging:
|
||||
|
||||
```ini
|
||||
[Debug]
|
||||
skip_clean_backup=1
|
||||
skip_clean_restore=1
|
||||
skip_clean_install=1
|
||||
skip_clean_staging_cleanup=1
|
||||
skip_hekate_8gb_post_copy=1
|
||||
```
|
||||
|
||||
Do **not** set `skip_clean_wipe` (leave unset or `0`).
|
||||
|
||||
### Update: deletion only
|
||||
|
||||
```ini
|
||||
[Debug]
|
||||
skip_update_install=1
|
||||
skip_update_staging_cleanup=1
|
||||
skip_hekate_8gb_post_copy=1
|
||||
```
|
||||
|
||||
### OC update without touching HorizonOC backup/restore
|
||||
|
||||
```ini
|
||||
[Debug]
|
||||
skip_update_horizon_oc=1
|
||||
```
|
||||
|
||||
## Implementation
|
||||
|
||||
- Parsed in `install.c`: `install_debug_load()`, `perform_installation()`.
|
||||
- Uses the same INI parser as `config.ini` (`ini_parse` from BDK).
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
This document provides a detailed, step-by-step breakdown of everything that is checked and done during the OmniNX installation/update process.
|
||||
|
||||
For **optional debug step skips** (`sd:/config/omninx/debug.ini`), see **[DEBUG_INI.md](DEBUG_INI.md)**.
|
||||
|
||||
## Overview
|
||||
|
||||
The OmniNX Installer Payload operates in two modes:
|
||||
@@ -88,7 +90,9 @@ The OmniNX Installer Payload operates in two modes:
|
||||
**Trigger**: `INSTALL_MODE_UPDATE` (OmniNX already installed)
|
||||
|
||||
### Step 1: Cleanup (Selective Deletion)
|
||||
**Location**: `install.c:321-380`
|
||||
**Location**: `install_update.c` (`update_mode_cleanup`), `install.c` (`delete_path_lists_grouped`)
|
||||
|
||||
Before deletion, the payload reads optional **`sd:/config/omninx/preserve.ini`** (section `[Preserve]`). Paths enabled there are skipped, as are delete targets that would remove them (parent/child overlap). See **[PRESERVE_INI.md](PRESERVE_INI.md)**. Clean install does not use this file.
|
||||
|
||||
#### 10. Clean Atmosphere Subdirectories
|
||||
**Location**: `install.c:325-327`, `deletion_lists.h:9-34`
|
||||
@@ -305,17 +309,12 @@ channel_pack={variant} # Same as current_pack
|
||||
#### 32. Create Backup Directory
|
||||
- Creates `sd:/temp_backup/` directory
|
||||
|
||||
#### 33. Backup DBI
|
||||
- **Source**: `sd:/switch/DBI/`
|
||||
- **Destination**: `sd:/temp_backup/DBI/`
|
||||
- Only if source exists
|
||||
#### 33. Backup DBI settings
|
||||
- **Source**: `sd:/switch/DBI/dbi.config` (file only, not the whole `DBI` tree)
|
||||
- **Destination**: `sd:/temp_backup/dbi.config`
|
||||
- Only if the source file exists
|
||||
|
||||
#### 34. Backup Tinfoil
|
||||
- **Source**: `sd:/switch/tinfoil/`
|
||||
- **Destination**: `sd:/temp_backup/tinfoil/`
|
||||
- Only if source exists
|
||||
|
||||
#### 35. Backup prod.keys
|
||||
#### 34. Backup prod.keys
|
||||
- **Source**: `sd:/switch/prod.keys`
|
||||
- **Destination**: `sd:/temp_backup/prod.keys`
|
||||
- Only if source exists
|
||||
@@ -325,22 +324,22 @@ channel_pack={variant} # Same as current_pack
|
||||
### Step 2: Wipe Directories
|
||||
**Location**: `install.c:543-602`
|
||||
|
||||
#### 36. Delete Entire Directories
|
||||
#### 35. Delete Entire Directories
|
||||
Recursively deletes (if they exist):
|
||||
- `sd:/atmosphere/` (entire directory tree)
|
||||
- `sd:/bootloader/` (entire directory tree)
|
||||
- `sd:/config/` (entire directory tree)
|
||||
- `sd:/switch/` (entire directory tree)
|
||||
|
||||
#### 37. Delete Root Files
|
||||
#### 36. Delete Root Files
|
||||
- Uses same deletion list as update mode (Step 19)
|
||||
- Deletes `boot.dat`, `boot.ini`, `exosphere.ini`, etc.
|
||||
|
||||
#### 38. Delete Miscellaneous Items
|
||||
#### 37. Delete Miscellaneous Items
|
||||
- Uses same deletion lists as update mode (Steps 20-21)
|
||||
- Deletes `argon/`, `games/`, `SaltySD/`, etc.
|
||||
|
||||
#### 39. Recreate Switch Directory
|
||||
#### 38. Recreate Switch Directory
|
||||
- Creates empty `sd:/switch/` directory for restoration
|
||||
|
||||
---
|
||||
@@ -348,27 +347,17 @@ Recursively deletes (if they exist):
|
||||
### Step 3: Restore User Data
|
||||
**Location**: `backup.c:55-95`
|
||||
|
||||
#### 40. Restore DBI
|
||||
- **Source**: `sd:/temp_backup/DBI/`
|
||||
- **Destination**: `sd:/switch/DBI/`
|
||||
- **Cleanup**: After restoration, deletes old DBI NRO files:
|
||||
- `sd:/switch/DBI/DBI_810_EN.nro`
|
||||
- `sd:/switch/DBI/DBI_810_DE.nro`
|
||||
- `sd:/switch/DBI/DBI_845_EN.nro`
|
||||
- `sd:/switch/DBI/DBI_845_DE.nro`
|
||||
- `sd:/switch/DBI/DBI.nro`
|
||||
#### 39. Restore DBI settings
|
||||
- **Source**: `sd:/temp_backup/dbi.config`
|
||||
- **Destination**: `sd:/switch/DBI/dbi.config` (creates `sd:/switch/DBI/` if needed)
|
||||
- No longer copies the full `DBI` folder; old `.nro` cleanup is unnecessary
|
||||
|
||||
#### 41. Restore Tinfoil
|
||||
- **Source**: `sd:/temp_backup/tinfoil/`
|
||||
- **Destination**: `sd:/switch/tinfoil/`
|
||||
- **Cleanup**: After restoration, deletes `sd:/switch/tinfoil/tinfoil.nro`
|
||||
|
||||
#### 42. Restore prod.keys
|
||||
#### 40. Restore prod.keys
|
||||
- **Source**: `sd:/temp_backup/prod.keys`
|
||||
- **Destination**: `sd:/switch/prod.keys`
|
||||
|
||||
#### 43. Cleanup Backup Directory
|
||||
**Location**: `backup.c:98-103`
|
||||
#### 41. Cleanup Backup Directory
|
||||
**Location**: `backup.c` (`cleanup_backup`)
|
||||
- Deletes `sd:/temp_backup/` directory after restoration
|
||||
|
||||
---
|
||||
|
||||
3
Makefile
3
Makefile
@@ -31,6 +31,9 @@ OBJS += $(patsubst $(BDKDIR)/%.S, $(BUILDDIR)/$(TARGET)/%.o, \
|
||||
$(patsubst $(BDKDIR)/%.c, $(BUILDDIR)/$(TARGET)/%.o, \
|
||||
$(call rwildcard, $(BDKDIR), *.S *.c)))
|
||||
|
||||
# Optional vendored tree under source/TegraExplorer/ is not part of this payload build.
|
||||
OBJS := $(filter-out $(BUILDDIR)/$(TARGET)/TegraExplorer/%,$(OBJS))
|
||||
|
||||
GFX_INC := '"../$(SOURCEDIR)/gfx.h"'
|
||||
FFCFG_INC := '"../$(SOURCEDIR)/libs/fatfs/ffconf.h"'
|
||||
|
||||
|
||||
59
PRESERVE_INI.md
Normal file
59
PRESERVE_INI.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# User preserve list (`preserve.ini`)
|
||||
|
||||
**Update mode only.** During OmniNX update cleanup (selective deletion), any path listed here with a truthy value is **not** deleted. Paths that would remove a preserved path (parent directory) are skipped as well.
|
||||
|
||||
- **File:** `sd:/config/omninx/preserve.ini`
|
||||
- If missing or invalid, behavior is unchanged (full update deletion list applies).
|
||||
|
||||
## Format
|
||||
|
||||
Section **`[Preserve]`** (case-sensitive). Each line is **path as key**, **enable flag as value**:
|
||||
|
||||
```ini
|
||||
[Preserve]
|
||||
'sd:/ROMs'=1
|
||||
sd:/switch/MyHomebrewFolder=0
|
||||
sd:/backup/tools=1
|
||||
```
|
||||
|
||||
### Path (key)
|
||||
|
||||
- Must start with **`sd:/`** (after optional quoting).
|
||||
- **Optional** matching **single** or **double** quotes around the key are stripped (helps Ultrahand `set-ini-val` and readability).
|
||||
- Trailing slashes are normalized away (except the volume root).
|
||||
- **`sd:/` alone** is rejected (too broad).
|
||||
- Minimum useful length after `sd:/` is enforced (at least one more character).
|
||||
|
||||
### Value (enable)
|
||||
|
||||
**On** if the value starts with `1`, `t`, `T`, `y`, or `Y` (e.g. `1`, `true`, `yes`). Anything else is **off** (path ignored).
|
||||
|
||||
### Limits
|
||||
|
||||
- Up to **96** preserved paths; longer keys truncated internally (~224 bytes per path).
|
||||
- Duplicate paths after normalization are skipped.
|
||||
- The list is allocated on the **heap** only while update cleanup runs (not a large static buffer in IPL IRAM), to avoid crowding hardware-adjacent memory used by Joy-Con UART and similar peripherals.
|
||||
|
||||
## Overlap rules
|
||||
|
||||
For each delete candidate from `deletion_lists_update.h`, deletion is skipped if it **overlaps** any enabled preserve path:
|
||||
|
||||
- Same path, or
|
||||
- Delete target is **inside** a preserved tree (preserved path is a prefix), or
|
||||
- Delete target is an **ancestor** of a preserved path (deleting it would remove the preserved data).
|
||||
|
||||
So preserving `sd:/ROMs` also blocks deleting `sd:/ROMs/title` if that were on the delete list, and blocks deleting `sd:/` if `sd:/ROMs` is preserved.
|
||||
|
||||
## Ultrahand
|
||||
|
||||
You can toggle entries with:
|
||||
|
||||
```text
|
||||
set-ini-val sd:/config/omninx/preserve.ini Preserve 'sd:/ROMs' 1
|
||||
```
|
||||
|
||||
and `0` to disable. Use the same quoted path in the key argument as in your INI.
|
||||
|
||||
## Clean install
|
||||
|
||||
**Not used** in clean install mode. `preserve.ini` is only read for **update** cleanup (`update_mode_cleanup`).
|
||||
@@ -12,7 +12,7 @@ Based on [HATS-Installer-Payload](https://github.com/sthetix/HATS-Installer-Payl
|
||||
- **Automatic Variant Detection**: Detects which OmniNX pack variant is present (Standard/Light/OC)
|
||||
- **Smart Installation Modes**:
|
||||
- **Update Mode**: Selective deletion when OmniNX is already installed
|
||||
- **Clean Install**: Full wipe with backup/restore of user data (DBI, Tinfoil, prod.keys)
|
||||
- **Clean Install**: Full wipe with backup/restore of user data (DBI `dbi.config`, prod.keys)
|
||||
- **Version Detection**: Detects installed OmniNX version via marker files (`1.0.0s`, `1.0.0l`, `1.0.0oc`)
|
||||
- **Progress Display**: Visual status messages during installation
|
||||
- **Error Handling**: Detailed error reporting on screen
|
||||
@@ -22,12 +22,15 @@ Based on [HATS-Installer-Payload](https://github.com/sthetix/HATS-Installer-Payl
|
||||
|
||||
For detailed information about the installation process, see:
|
||||
- **[INSTALLATION_PROCESS.md](INSTALLATION_PROCESS.md)** - Complete step-by-step breakdown of everything checked and done during installation/update
|
||||
- **[DEBUG_INI.md](DEBUG_INI.md)** - Optional `sd:/config/omninx/debug.ini` parameters to skip install steps (for testing)
|
||||
- **[PRESERVE_INI.md](PRESERVE_INI.md)** - Optional `sd:/config/omninx/preserve.ini` to skip deleting chosen paths in **update** mode
|
||||
|
||||
## Installation Modes
|
||||
|
||||
### Update Mode (OmniNX Detected)
|
||||
- Detected when version marker files (`1.0.0s`, `1.0.0l`, or `1.0.0oc`) are found
|
||||
- Performs selective deletion of specific directories/files
|
||||
- Optional **`sd:/config/omninx/preserve.ini`**: user-listed `sd:/…` paths (with `=1`) are excluded from that cleanup (see [PRESERVE_INI.md](PRESERVE_INI.md))
|
||||
- Preserves user data, savegames, and installed games
|
||||
- Updates only necessary CFW components
|
||||
|
||||
@@ -35,8 +38,7 @@ For detailed information about the installation process, see:
|
||||
- Detected when no version marker files are found
|
||||
- Performs full wipe of `/atmosphere`, `/bootloader`, `/config`, and `/switch`
|
||||
- **Backs up and restores**:
|
||||
- `sd:/switch/DBI` → preserved
|
||||
- `sd:/switch/tinfoil` → preserved
|
||||
- `sd:/switch/DBI/dbi.config` → preserved (not the whole `DBI` folder)
|
||||
- `sd:/switch/prod.keys` → preserved
|
||||
- Fresh installation of all CFW components
|
||||
|
||||
|
||||
@@ -721,6 +721,12 @@ void jc_deinit()
|
||||
clock_disable_uart(UART_C);
|
||||
}
|
||||
|
||||
/* Drop current button state without power-cycling the Joy-Cons. */
|
||||
void jc_clear_input(void)
|
||||
{
|
||||
jc_gamepad.buttons = 0;
|
||||
}
|
||||
|
||||
static void jc_init_conn(joycon_ctxt_t *jc)
|
||||
{
|
||||
if (((u32)get_tmr_ms() - jc->last_received_time) > 1000)
|
||||
|
||||
@@ -92,6 +92,7 @@ typedef struct _jc_gamepad_rpt_t
|
||||
void jc_power_supply(u8 uart, bool enable);
|
||||
void jc_init_hw();
|
||||
void jc_deinit();
|
||||
void jc_clear_input(void);
|
||||
jc_gamepad_rpt_t *joycon_poll();
|
||||
jc_gamepad_rpt_t *jc_get_bt_pairing_info(bool *is_l_hos, bool *is_r_hos);
|
||||
|
||||
|
||||
129
source/backup.c
129
source/backup.c
@@ -24,17 +24,9 @@ int backup_user_data(void) {
|
||||
return res;
|
||||
}
|
||||
|
||||
// Backup DBI if it exists
|
||||
if (path_exists("sd:/switch/DBI")) {
|
||||
res = folder_copy("sd:/switch/DBI", TEMP_BACKUP_PATH);
|
||||
if (res != FR_OK) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
// Backup Tinfoil if it exists
|
||||
if (path_exists("sd:/switch/tinfoil")) {
|
||||
res = folder_copy("sd:/switch/tinfoil", TEMP_BACKUP_PATH);
|
||||
// Backup DBI settings file only (not .nro installers)
|
||||
if (path_exists(DBI_CONFIG_PATH)) {
|
||||
res = file_copy(DBI_CONFIG_PATH, TEMP_BACKUP_DBI_CONFIG);
|
||||
if (res != FR_OK) {
|
||||
return res;
|
||||
}
|
||||
@@ -48,6 +40,35 @@ int backup_user_data(void) {
|
||||
}
|
||||
}
|
||||
|
||||
// Backup CyberFoil (nro, config, remotes) if installed
|
||||
if (path_exists(CYBERFOIL_DIR)) {
|
||||
res = f_mkdir(TEMP_BACKUP_CYBERFOIL);
|
||||
if (res != FR_OK && res != FR_EXIST) {
|
||||
return res;
|
||||
}
|
||||
|
||||
if (path_exists(CYBERFOIL_NRO)) {
|
||||
res = file_copy(CYBERFOIL_NRO, TEMP_BACKUP_CYBERFOIL_NRO);
|
||||
if (res != FR_OK) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
if (path_exists(CYBERFOIL_CONFIG)) {
|
||||
res = file_copy(CYBERFOIL_CONFIG, TEMP_BACKUP_CYBERFOIL_CONFIG);
|
||||
if (res != FR_OK) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
if (path_exists(CYBERFOIL_REMOTES)) {
|
||||
res = folder_copy(CYBERFOIL_REMOTES, TEMP_BACKUP_CYBERFOIL);
|
||||
if (res != FR_OK) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FR_OK;
|
||||
}
|
||||
|
||||
@@ -61,25 +82,15 @@ int restore_user_data(void) {
|
||||
return res;
|
||||
}
|
||||
|
||||
// Restore DBI if backup exists
|
||||
if (path_exists("sd:/temp_backup/DBI")) {
|
||||
res = folder_copy("sd:/temp_backup/DBI", "sd:/switch");
|
||||
if (res == FR_OK) {
|
||||
// Delete old DBI .nro files
|
||||
f_unlink("sd:/switch/DBI/DBI_810_EN.nro");
|
||||
f_unlink("sd:/switch/DBI/DBI_810_DE.nro");
|
||||
f_unlink("sd:/switch/DBI/DBI_845_EN.nro");
|
||||
f_unlink("sd:/switch/DBI/DBI_845_DE.nro");
|
||||
f_unlink("sd:/switch/DBI/DBI.nro");
|
||||
// Restore DBI settings if backed up
|
||||
if (path_exists(TEMP_BACKUP_DBI_CONFIG)) {
|
||||
res = f_mkdir("sd:/switch/DBI");
|
||||
if (res != FR_OK && res != FR_EXIST) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
// Restore Tinfoil if backup exists
|
||||
if (path_exists("sd:/temp_backup/tinfoil")) {
|
||||
res = folder_copy("sd:/temp_backup/tinfoil", "sd:/switch");
|
||||
if (res == FR_OK) {
|
||||
// Delete old tinfoil.nro
|
||||
f_unlink("sd:/switch/tinfoil/tinfoil.nro");
|
||||
res = file_copy(TEMP_BACKUP_DBI_CONFIG, DBI_CONFIG_PATH);
|
||||
if (res != FR_OK) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +102,35 @@ int restore_user_data(void) {
|
||||
}
|
||||
}
|
||||
|
||||
// Restore CyberFoil if backed up
|
||||
if (path_exists(TEMP_BACKUP_CYBERFOIL)) {
|
||||
res = f_mkdir(CYBERFOIL_DIR);
|
||||
if (res != FR_OK && res != FR_EXIST) {
|
||||
return res;
|
||||
}
|
||||
|
||||
if (path_exists(TEMP_BACKUP_CYBERFOIL_NRO)) {
|
||||
res = file_copy(TEMP_BACKUP_CYBERFOIL_NRO, CYBERFOIL_NRO);
|
||||
if (res != FR_OK) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
if (path_exists(TEMP_BACKUP_CYBERFOIL_CONFIG)) {
|
||||
res = file_copy(TEMP_BACKUP_CYBERFOIL_CONFIG, CYBERFOIL_CONFIG);
|
||||
if (res != FR_OK) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
if (path_exists(TEMP_BACKUP_CYBERFOIL_REMOTES)) {
|
||||
res = folder_copy(TEMP_BACKUP_CYBERFOIL_REMOTES, CYBERFOIL_DIR);
|
||||
if (res != FR_OK) {
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FR_OK;
|
||||
}
|
||||
|
||||
@@ -101,3 +141,34 @@ int cleanup_backup(void) {
|
||||
}
|
||||
return FR_OK;
|
||||
}
|
||||
|
||||
int backup_horizon_oc_config_for_oc_update(void) {
|
||||
if (!path_exists(HORIZON_OC_CONFIG_PATH))
|
||||
return FR_OK;
|
||||
|
||||
int res = f_mkdir(HORIZON_OC_UPDATE_BACKUP_DIR);
|
||||
if (res != FR_OK && res != FR_EXIST)
|
||||
return res;
|
||||
|
||||
return file_copy(HORIZON_OC_CONFIG_PATH, HORIZON_OC_UPDATE_BACKUP_INI);
|
||||
}
|
||||
|
||||
int restore_horizon_oc_config_after_oc_update(void) {
|
||||
if (!path_exists(HORIZON_OC_UPDATE_BACKUP_INI))
|
||||
return FR_OK;
|
||||
|
||||
int res = f_mkdir("sd:/config");
|
||||
if (res != FR_OK && res != FR_EXIST)
|
||||
return res;
|
||||
res = f_mkdir("sd:/config/horizon-oc");
|
||||
if (res != FR_OK && res != FR_EXIST)
|
||||
return res;
|
||||
|
||||
return file_copy(HORIZON_OC_UPDATE_BACKUP_INI, HORIZON_OC_CONFIG_PATH);
|
||||
}
|
||||
|
||||
int cleanup_horizon_oc_update_backup(void) {
|
||||
if (!path_exists(HORIZON_OC_UPDATE_BACKUP_DIR))
|
||||
return FR_OK;
|
||||
return folder_delete(HORIZON_OC_UPDATE_BACKUP_DIR);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,27 @@
|
||||
#include <utils/types.h>
|
||||
|
||||
#define TEMP_BACKUP_PATH "sd:/temp_backup"
|
||||
/** DBI settings; preserved across clean install (not whole DBI folder). */
|
||||
#define DBI_CONFIG_PATH "sd:/switch/DBI/dbi.config"
|
||||
#define TEMP_BACKUP_DBI_CONFIG TEMP_BACKUP_PATH "/dbi.config"
|
||||
|
||||
// Backup user data (DBI, Tinfoil, prod.keys) before clean install
|
||||
/** CyberFoil homebrew; preserved across clean install (nro, config, remotes only). */
|
||||
#define CYBERFOIL_DIR "sd:/switch/CyberFoil"
|
||||
#define CYBERFOIL_NRO CYBERFOIL_DIR "/cyberfoil.nro"
|
||||
#define CYBERFOIL_CONFIG CYBERFOIL_DIR "/config.json"
|
||||
#define CYBERFOIL_REMOTES CYBERFOIL_DIR "/remotes"
|
||||
#define TEMP_BACKUP_CYBERFOIL TEMP_BACKUP_PATH "/CyberFoil"
|
||||
#define TEMP_BACKUP_CYBERFOIL_NRO TEMP_BACKUP_CYBERFOIL "/cyberfoil.nro"
|
||||
#define TEMP_BACKUP_CYBERFOIL_CONFIG TEMP_BACKUP_CYBERFOIL "/config.json"
|
||||
#define TEMP_BACKUP_CYBERFOIL_REMOTES TEMP_BACKUP_CYBERFOIL "/remotes"
|
||||
|
||||
/** Live HorizonOC settings (Overclock tool). */
|
||||
#define HORIZON_OC_CONFIG_PATH "sd:/config/horizon-oc/config.ini"
|
||||
/** Scratch dir during OC-variant update only; removed after successful restore. */
|
||||
#define HORIZON_OC_UPDATE_BACKUP_DIR "sd:/.omninx_oc_update"
|
||||
#define HORIZON_OC_UPDATE_BACKUP_INI HORIZON_OC_UPDATE_BACKUP_DIR "/config.ini"
|
||||
|
||||
// Backup user data (CyberFoil, DBI dbi.config, prod.keys) before clean install
|
||||
int backup_user_data(void);
|
||||
|
||||
// Restore user data after clean install
|
||||
@@ -16,3 +35,10 @@ int restore_user_data(void);
|
||||
|
||||
// Clean up temporary backup directory
|
||||
int cleanup_backup(void);
|
||||
|
||||
// HorizonOC: backup config.ini before OC pack update (update mode only); no-op if missing
|
||||
int backup_horizon_oc_config_for_oc_update(void);
|
||||
// Restore after file copy; no-op if no backup from this run
|
||||
int restore_horizon_oc_config_after_oc_update(void);
|
||||
// Delete sd:/.omninx_oc_update after successful restore
|
||||
int cleanup_horizon_oc_update_backup(void);
|
||||
|
||||
@@ -1,86 +1,23 @@
|
||||
/*
|
||||
* OmniNX Installer - Deletion Lists for Clean Install Mode
|
||||
* Selective deletion when no OmniNX install was found.
|
||||
* Only listed paths are removed; does not wipe whole card or user configs.
|
||||
* Deletion policy aligned with NiklasCFW pack clean install (TegraExplorer script):
|
||||
* full sd:/atmosphere, bootloader/config subsets, sd:/switch, root + misc, then
|
||||
* post-restore paths (e.g. tinfoil db). CyberFoil/DBI/prod.keys backup is in backup.c.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Atmosphere subdirectories to delete
|
||||
// Entire atmosphere/ tree (NiklasCFW: deldir("sd:/atmosphere"))
|
||||
static const char* clean_atmosphere_dirs_to_delete[] = {
|
||||
"sd:/atmosphere/config",
|
||||
"sd:/atmosphere/crash_reports",
|
||||
"sd:/atmosphere/erpt_reports",
|
||||
"sd:/atmosphere/exefs_patches/CrunchPatch",
|
||||
"sd:/atmosphere/exefs_patches/Crunchyroll Patch 1.10.0",
|
||||
"sd:/atmosphere/exefs_patches/bluetooth_patches",
|
||||
"sd:/atmosphere/exefs_patches/bootlogo",
|
||||
"sd:/atmosphere/exefs_patches/btm_patches",
|
||||
"sd:/atmosphere/exefs_patches/es_patches",
|
||||
"sd:/atmosphere/exefs_patches/hid_patches",
|
||||
"sd:/atmosphere/exefs_patches/logo1",
|
||||
"sd:/atmosphere/exefs_patches/nfim_ctest",
|
||||
"sd:/atmosphere/exefs_patches/nim_ctest",
|
||||
"sd:/atmosphere/exefs_patches/nvnflinger_cmu",
|
||||
"sd:/atmosphere/extrazz",
|
||||
"sd:/atmosphere/fatal_errors",
|
||||
"sd:/atmosphere/fatal_reports",
|
||||
"sd:/atmosphere/flags",
|
||||
"sd:/atmosphere/hbl_html",
|
||||
"sd:/atmosphere/hosts",
|
||||
"sd:/atmosphere/kips",
|
||||
"sd:/atmosphere/kip1",
|
||||
"sd:/atmosphere/kip_patches",
|
||||
"sd:/atmosphere/logs",
|
||||
"sd:/atmosphere",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Atmosphere contents directories (title IDs; only under atmosphere/contents/)
|
||||
static const char* clean_atmosphere_contents_dirs_to_delete[] = {
|
||||
"sd:/atmosphere/contents/0000000000534C56",
|
||||
"sd:/atmosphere/contents/00FF0000B378D640",
|
||||
"sd:/atmosphere/contents/00FF0000636C6BFF",
|
||||
"sd:/atmosphere/contents/00FF0000A53BB665",
|
||||
"sd:/atmosphere/contents/0100000000000008",
|
||||
"sd:/atmosphere/contents/010000000000000D",
|
||||
"sd:/atmosphere/contents/010000000000002B",
|
||||
"sd:/atmosphere/contents/0100000000000032",
|
||||
"sd:/atmosphere/contents/0100000000000034",
|
||||
"sd:/atmosphere/contents/0100000000000036",
|
||||
"sd:/atmosphere/contents/0100000000000037",
|
||||
"sd:/atmosphere/contents/010000000000003C",
|
||||
"sd:/atmosphere/contents/0100000000000042",
|
||||
"sd:/atmosphere/contents/0100000000000895",
|
||||
"sd:/atmosphere/contents/0100000000000F12",
|
||||
"sd:/atmosphere/contents/0100000000001000",
|
||||
"sd:/atmosphere/contents/0100000000001007",
|
||||
"sd:/atmosphere/contents/0100000000001013",
|
||||
"sd:/atmosphere/contents/010000000000DA7A",
|
||||
"sd:/atmosphere/contents/010000000000bd00",
|
||||
"sd:/atmosphere/contents/01006a800016e000",
|
||||
"sd:/atmosphere/contents/01009D901BC56000",
|
||||
"sd:/atmosphere/contents/0100A3900C3E2000",
|
||||
"sd:/atmosphere/contents/0100F43008C44000",
|
||||
"sd:/atmosphere/contents/050000BADDAD0000",
|
||||
"sd:/atmosphere/contents/4200000000000000",
|
||||
"sd:/atmosphere/contents/420000000000000B",
|
||||
"sd:/atmosphere/contents/420000000000000E",
|
||||
"sd:/atmosphere/contents/4200000000000010",
|
||||
"sd:/atmosphere/contents/4200000000000FFF",
|
||||
"sd:/atmosphere/contents/420000000007E51A",
|
||||
"sd:/atmosphere/contents/420000000007E51B",
|
||||
"sd:/atmosphere/contents/690000000000000D",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Atmosphere files to delete
|
||||
static const char* clean_atmosphere_files_to_delete[] = {
|
||||
"sd:/atmosphere/config/exosphere.ini",
|
||||
"sd:/atmosphere/config/stratosphere.ini",
|
||||
"sd:/atmosphere/hbl.nsp",
|
||||
"sd:/atmosphere/package3",
|
||||
"sd:/atmosphere/reboot_payload.bin",
|
||||
"sd:/atmosphere/stratosphere.romfs",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -101,7 +38,6 @@ static const char* clean_bootloader_files_to_delete[] = {
|
||||
"sd:/bootloader/ArgonNX.bin",
|
||||
"sd:/bootloader/bootlogo.bmp",
|
||||
"sd:/bootloader/hekate_ipl.ini",
|
||||
"sd:/bootloader/nyx.ini",
|
||||
"sd:/bootloader/patches.ini",
|
||||
"sd:/bootloader/update.bin",
|
||||
"sd:/bootloader/ini/EmuMMC ohne Mods.ini",
|
||||
@@ -114,7 +50,6 @@ static const char* clean_config_dirs_to_delete[] = {
|
||||
"sd:/config/blue_pack_updater",
|
||||
"sd:/config/kefir-updater",
|
||||
"sd:/config/nx-hbmenu",
|
||||
"sd:/config/quickntp",
|
||||
"sd:/config/sys-con",
|
||||
"sd:/config/sys-patch",
|
||||
"sd:/config/uberhand",
|
||||
@@ -122,120 +57,13 @@ static const char* clean_config_dirs_to_delete[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
// Switch directories to delete
|
||||
// Entire switch/ tree (clean install recreates sd:/switch after wipe)
|
||||
static const char* clean_switch_dirs_to_delete[] = {
|
||||
"sd:/switch/.overlays",
|
||||
"sd:/switch/.packages",
|
||||
"sd:/switch/90DNS_tester",
|
||||
"sd:/switch/aio-switch-updater",
|
||||
"sd:/switch/amsPLUS-downloader",
|
||||
"sd:/switch/appstore",
|
||||
"sd:/switch/AtmoXL-Titel-Installer",
|
||||
"sd:/switch/breeze",
|
||||
"sd:/switch/checkpoint",
|
||||
"sd:/switch/cheats-updater",
|
||||
"sd:/switch/chiaki",
|
||||
"sd:/switch/ChoiDujourNX",
|
||||
"sd:/switch/crash_ams",
|
||||
"sd:/switch/Daybreak",
|
||||
"sd:/switch/DNS_mitm Tester",
|
||||
"sd:/switch/EdiZon",
|
||||
"sd:/switch/Fizeau",
|
||||
"sd:/switch/FTPD",
|
||||
"sd:/switch/fw-downloader",
|
||||
"sd:/switch/gamecard_installer",
|
||||
"sd:/switch/Goldleaf",
|
||||
"sd:/switch/haze",
|
||||
"sd:/switch/JKSV",
|
||||
"sd:/switch/kefir-updater",
|
||||
"sd:/switch/ldnmitm_config",
|
||||
"sd:/switch/Linkalho",
|
||||
"sd:/switch/Moonlight-Switch",
|
||||
"sd:/switch/Neumann",
|
||||
"sd:/switch/NX-Activity-Log",
|
||||
"sd:/switch/NX-Save-Sync",
|
||||
"sd:/switch/NX-Shell",
|
||||
"sd:/switch/NX-Update-Checker ",
|
||||
"sd:/switch/NXGallery",
|
||||
"sd:/switch/NXRemoteLauncher",
|
||||
"sd:/switch/NXThemesInstaller",
|
||||
"sd:/switch/nxdumptool",
|
||||
"sd:/switch/nxmtp",
|
||||
"sd:/switch/Payload_launcher",
|
||||
"sd:/switch/Reboot",
|
||||
"sd:/switch/reboot_to_argonNX",
|
||||
"sd:/switch/reboot_to_hekate",
|
||||
"sd:/switch/Shutdown_System",
|
||||
"sd:/switch/SimpleModDownloader",
|
||||
"sd:/switch/SimpleModManager",
|
||||
"sd:/switch/sphaira",
|
||||
"sd:/switch/studious-pancake",
|
||||
"sd:/switch/Switch-Time",
|
||||
"sd:/switch/SwitchIdent",
|
||||
"sd:/switch/Switch_themes_Installer",
|
||||
"sd:/switch/Switchfin",
|
||||
"sd:/switch/Sys-Clk Manager",
|
||||
"sd:/switch/Sys-Con",
|
||||
"sd:/switch/sys-clk-manager",
|
||||
"sd:/switch/themezer-nx",
|
||||
"sd:/switch/themezernx",
|
||||
"sd:/switch/tinwoo",
|
||||
"sd:/switch",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Switch files (NRO) to delete
|
||||
static const char* clean_switch_files_to_delete[] = {
|
||||
"sd:/switch/90DNS_tester/90DNS_tester.nro",
|
||||
"sd:/switch/breeze.nro",
|
||||
"sd:/switch/cheats-updater.nro",
|
||||
"sd:/switch/chiaki.nro",
|
||||
"sd:/switch/ChoiDujourNX.nro",
|
||||
"sd:/switch/daybreak.nro",
|
||||
"sd:/switch/DBI.nro",
|
||||
"sd:/switch/DBI/DBI.nro",
|
||||
"sd:/switch/DBI/DBI_810_DE.nro",
|
||||
"sd:/switch/DBI/DBI_810_EN.nro",
|
||||
"sd:/switch/DBI/DBI_845_DE.nro",
|
||||
"sd:/switch/DBI/DBI_845_EN.nro",
|
||||
"sd:/switch/DBI/DBI_849_DE.nro",
|
||||
"sd:/switch/DBI/DBI_849_EN.nro",
|
||||
"sd:/switch/DBI/DBI_874_DE.nro",
|
||||
"sd:/switch/DBI/DBI_874_EN.nro",
|
||||
"sd:/switch/DBI_810_DE/DBI_810.nro",
|
||||
"sd:/switch/DBI_810_DE/DBI_810_DE.nro",
|
||||
"sd:/switch/DBI_810_EN/DBI_810_EN.nro",
|
||||
"sd:/switch/DBI_RU/DBI_RU.nro",
|
||||
"sd:/switch/DBI/DBI_EN.nro",
|
||||
"sd:/switch/DBI_DE/DBI_DE.nro",
|
||||
"sd:/switch/DNS_mitm Tester.nro",
|
||||
"sd:/switch/EdiZon.nro",
|
||||
"sd:/switch/Fizeau.nro",
|
||||
"sd:/switch/Goldleaf.nro",
|
||||
"sd:/switch/haze.nro",
|
||||
"sd:/switch/JKSV.nro",
|
||||
"sd:/switch/ldnmitm_config.nro",
|
||||
"sd:/switch/linkalho.nro",
|
||||
"sd:/switch/Moonlight-Switch.nro",
|
||||
"sd:/switch/Neumann.nro",
|
||||
"sd:/switch/NX-Shell.nro",
|
||||
"sd:/switch/NXGallery.nro",
|
||||
"sd:/switch/NXThemesInstaller.nro",
|
||||
"sd:/switch/nxdumptool.nro",
|
||||
"sd:/switch/nxtc.bin",
|
||||
"sd:/switch/reboot_to_payload.nro",
|
||||
"sd:/switch/SimpleModDownloader.nro",
|
||||
"sd:/switch/SimpleModManager.nro",
|
||||
"sd:/switch/sphaira.nro",
|
||||
"sd:/switch/SwitchIdent.nro",
|
||||
"sd:/switch/Switch_themes_Installer/NXThemesInstaller.nro",
|
||||
"sd:/switch/Switchfin.nro",
|
||||
"sd:/switch/Sys-Clk Manager/sys-clk-manager.nro",
|
||||
"sd:/switch/Sys-Con.nro",
|
||||
"sd:/switch/sys-clk-manager.nro",
|
||||
"sd:/switch/tinfoil.nro",
|
||||
"sd:/switch/tinfoil/tinfoil.nro",
|
||||
"sd:/switch/tinwoo.nro",
|
||||
"sd:/switch/tinwoo/tinwoo.nro",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -263,8 +91,10 @@ static const char* clean_misc_dirs_to_delete[] = {
|
||||
"sd:/NSPs (Tools)",
|
||||
"sd:/Patched Apps",
|
||||
"sd:/SaltySD/flags",
|
||||
"sd:/SaltySD/patches",
|
||||
"sd:/scripts",
|
||||
"sd:/switch/tinfoil/db",
|
||||
"sd:/TegraExplorer",
|
||||
"sd:/themes/systemData",
|
||||
"sd:/tools",
|
||||
"sd:/warmboot_mariko",
|
||||
NULL
|
||||
@@ -283,16 +113,21 @@ static const char* clean_misc_files_to_delete[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
// After DBI/prod.keys restore (NiklasCFW: deldir("sd:/switch/tinfoil/db"))
|
||||
static const char* clean_post_restore_dirs_to_delete[] = {
|
||||
"sd:/switch/tinfoil/db",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Old version marker files to delete (clean install only)
|
||||
static const char* old_version_files_to_delete[] = {
|
||||
"sd:/1.0.0l",
|
||||
"sd:/1.0.0s",
|
||||
"sd:/1.0.0oc",
|
||||
"sd:/1.4.0-pre",
|
||||
"sd:/1.4.0-pre-c",
|
||||
"sd:/1.4.0-pre-d",
|
||||
"sd:/1.4.1",
|
||||
"sd:/1.5.0",
|
||||
"sd:/1.6.0",
|
||||
"sd:/1.6.1",
|
||||
"sd:/1.6.2",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -10,14 +10,16 @@ static const char* atmosphere_dirs_to_delete[] = {
|
||||
"sd:/atmosphere/config",
|
||||
"sd:/atmosphere/crash_reports",
|
||||
"sd:/atmosphere/erpt_reports",
|
||||
"sd:/atmosphere/exefs_patches/audio_mastervolume",
|
||||
"sd:/atmosphere/exefs_patches/CrunchPatch",
|
||||
"sd:/atmosphere/exefs_patches/SaltyNX_Fixes",
|
||||
"sd:/atmosphere/exefs_patches/Crunchyroll Patch 1.10.0",
|
||||
"sd:/atmosphere/exefs_patches/bluetooth_patches",
|
||||
"sd:/atmosphere/exefs_patches/bootlogo",
|
||||
"sd:/atmosphere/exefs_patches/btm_patches",
|
||||
"sd:/atmosphere/exefs_patches/es_patches",
|
||||
"sd:/atmosphere/exefs_patches/hid_patches",
|
||||
"sd:/atmosphere/exefs_patches/logo1",
|
||||
"sd:/atmosphere/exefs_patches/logo",
|
||||
"sd:/atmosphere/exefs_patches/nfim_ctest",
|
||||
"sd:/atmosphere/exefs_patches/nim_ctest",
|
||||
"sd:/atmosphere/exefs_patches/nvnflinger_cmu",
|
||||
@@ -80,6 +82,8 @@ static const char* atmosphere_files_to_delete[] = {
|
||||
"sd:/atmosphere/package3",
|
||||
"sd:/atmosphere/reboot_payload.bin",
|
||||
"sd:/atmosphere/stratosphere.romfs",
|
||||
"sd:/atmosphere/kips/loader.kip",
|
||||
"sd:/atmosphere/kips/hoc.kip",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -130,17 +134,19 @@ static const char* switch_dirs_to_delete[] = {
|
||||
"sd:/switch/amsPLUS-downloader",
|
||||
"sd:/switch/appstore",
|
||||
"sd:/switch/AtmoXL-Titel-Installer",
|
||||
"sd:/switch/Benchmark-Toolbox",
|
||||
"sd:/switch/breeze",
|
||||
"sd:/switch/checkpoint",
|
||||
"sd:/switch/cheats-updater",
|
||||
"sd:/switch/chiaki",
|
||||
"sd:/switch/ChoiDujourNX",
|
||||
"sd:/switch/crash_ams",
|
||||
"sd:/switch/Daybreak",
|
||||
"sd:/switch/DNS-Block_Tester",
|
||||
"sd:/switch/DNS_mitm Tester",
|
||||
"sd:/switch/EdiZon",
|
||||
"sd:/switch/Fizeau",
|
||||
"sd:/switch/FTPD",
|
||||
"sd:/switch/Furmark-NX",
|
||||
"sd:/switch/fw-downloader",
|
||||
"sd:/switch/gamecard_installer",
|
||||
"sd:/switch/Goldleaf",
|
||||
@@ -165,6 +171,7 @@ static const char* switch_dirs_to_delete[] = {
|
||||
"sd:/switch/reboot_to_argonNX",
|
||||
"sd:/switch/reboot_to_hekate",
|
||||
"sd:/switch/Shutdown_System",
|
||||
"sd:/switch/SimpleModAlchemist",
|
||||
"sd:/switch/SimpleModDownloader",
|
||||
"sd:/switch/SimpleModManager",
|
||||
"sd:/switch/sphaira",
|
||||
@@ -172,18 +179,22 @@ static const char* switch_dirs_to_delete[] = {
|
||||
"sd:/switch/Switch-Time",
|
||||
"sd:/switch/SwitchIdent",
|
||||
"sd:/switch/Switch_themes_Installer",
|
||||
"sd:/switch/swr-ini-tool",
|
||||
"sd:/switch/Sys-Clk Manager",
|
||||
"sd:/switch/Sys-Con",
|
||||
"sd:/switch/sys-clk-manager",
|
||||
"sd:/switch/themezer-nx",
|
||||
"sd:/switch/ThemezerNX",
|
||||
"sd:/switch/themezernx",
|
||||
"sd:/switch/tinwoo",
|
||||
"sd:/switch/Ultrahand-Reload",
|
||||
NULL
|
||||
};
|
||||
|
||||
// Switch files (NRO) to delete
|
||||
static const char* switch_files_to_delete[] = {
|
||||
"sd:/switch/90DNS_tester/90DNS_tester.nro",
|
||||
"sd:/switch/Benchmark-Toolbox/Benchmark-Toolbox.nro",
|
||||
"sd:/switch/breeze.nro",
|
||||
"sd:/switch/cheats-updater.nro",
|
||||
"sd:/switch/chiaki.nro",
|
||||
@@ -203,9 +214,11 @@ static const char* switch_files_to_delete[] = {
|
||||
"sd:/switch/DBI_RU/DBI_RU.nro",
|
||||
"sd:/switch/DBI/DBI_EN.nro",
|
||||
"sd:/switch/DBI_DE/DBI_DE.nro",
|
||||
"sd:/switch/DNS-Block_Tester/dns_tester.nro",
|
||||
"sd:/switch/DNS_mitm Tester.nro",
|
||||
"sd:/switch/EdiZon.nro",
|
||||
"sd:/switch/Fizeau.nro",
|
||||
"sd:/switch/Furmark-NX/Furmark-NX.nro",
|
||||
"sd:/switch/Goldleaf.nro",
|
||||
"sd:/switch/haze.nro",
|
||||
"sd:/switch/JKSV.nro",
|
||||
@@ -219,6 +232,7 @@ static const char* switch_files_to_delete[] = {
|
||||
"sd:/switch/nxdumptool.nro",
|
||||
"sd:/switch/nxtc.bin",
|
||||
"sd:/switch/reboot_to_payload.nro",
|
||||
"sd:/switch/SimpleModAlchemist/Simple_Mod_Alchemist.nro",
|
||||
"sd:/switch/SimpleModDownloader.nro",
|
||||
"sd:/switch/SimpleModManager.nro",
|
||||
"sd:/switch/sphaira.nro",
|
||||
@@ -228,10 +242,12 @@ static const char* switch_files_to_delete[] = {
|
||||
"sd:/switch/Sys-Clk Manager/sys-clk-manager.nro",
|
||||
"sd:/switch/Sys-Con.nro",
|
||||
"sd:/switch/sys-clk-manager.nro",
|
||||
"sd:/switch/ThemezerNX/themezer-nx.nro",
|
||||
"sd:/switch/tinfoil.nro",
|
||||
"sd:/switch/tinfoil/tinfoil.nro",
|
||||
"sd:/switch/tinwoo.nro",
|
||||
"sd:/switch/tinwoo/tinwoo.nro",
|
||||
"sd:/switch/Ultrahand-Reload/Ultrahand-Reload.nro",
|
||||
NULL
|
||||
};
|
||||
|
||||
@@ -261,6 +277,7 @@ static const char* misc_dirs_to_delete[] = {
|
||||
"sd:/SaltySD/flags",
|
||||
"sd:/scripts",
|
||||
"sd:/switch/tinfoil/db",
|
||||
"sd:/themes/systemData",
|
||||
"sd:/tools",
|
||||
"sd:/warmboot_mariko",
|
||||
NULL
|
||||
|
||||
996
source/install.c
996
source/install.c
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,10 @@ typedef enum {
|
||||
INSTALL_MODE_CLEAN // No OmniNX - selective deletion from clean list
|
||||
} install_mode_t;
|
||||
|
||||
// Main installation function
|
||||
// If a sub-menu aborts to Hekate / update.bin (does not return if launch succeeds)
|
||||
void installer_launch_hekate_payload(void);
|
||||
|
||||
// Main installation function (optional debug: see DEBUG_INI.md in repo root)
|
||||
int perform_installation(omninx_variant_t pack_variant, install_mode_t mode);
|
||||
|
||||
// Update mode operations (install_update.c)
|
||||
@@ -29,6 +32,9 @@ int clean_mode_wipe(void);
|
||||
int clean_mode_restore(void);
|
||||
int clean_mode_install(omninx_variant_t variant);
|
||||
|
||||
void install_preserve_update_cleanup_begin(void);
|
||||
void install_preserve_update_cleanup_end(void);
|
||||
|
||||
// Shared helpers (install.c) - used by install_update.c and install_clean.c
|
||||
void install_set_color(u32 color);
|
||||
void install_check_and_clear_screen_if_needed(void);
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
// Clean mode: Backup user data
|
||||
int clean_mode_backup(void) {
|
||||
set_color(COLOR_CYAN);
|
||||
gfx_printf(" Sichere: DBI, Tinfoil, prod.keys\n");
|
||||
gfx_printf(" Sichere: CyberFoil, DBI (dbi.config), prod.keys\n");
|
||||
set_color(COLOR_WHITE);
|
||||
int res = backup_user_data();
|
||||
if (res == FR_OK) {
|
||||
@@ -95,13 +95,14 @@ int clean_mode_wipe(void) {
|
||||
// Clean mode: Restore user data
|
||||
int clean_mode_restore(void) {
|
||||
set_color(COLOR_CYAN);
|
||||
gfx_printf(" Stelle wieder her: DBI, Tinfoil, prod.keys\n");
|
||||
gfx_printf(" Stelle wieder her: CyberFoil, DBI (dbi.config), prod.keys\n");
|
||||
set_color(COLOR_WHITE);
|
||||
int res = restore_user_data();
|
||||
if (res == FR_OK) {
|
||||
set_color(COLOR_GREEN);
|
||||
gfx_printf(" [OK] Wiederherstellung abgeschlossen\n");
|
||||
set_color(COLOR_WHITE);
|
||||
delete_path_list(clean_post_restore_dirs_to_delete, "switch/ (nach Restore)");
|
||||
}
|
||||
cleanup_backup();
|
||||
return res;
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
#include <string.h>
|
||||
#include <utils/sprintf.h>
|
||||
|
||||
#ifndef VERSION
|
||||
#define VERSION "1.0.0"
|
||||
#endif
|
||||
|
||||
#undef COLOR_CYAN
|
||||
#undef COLOR_WHITE
|
||||
#undef COLOR_GREEN
|
||||
@@ -37,6 +33,8 @@
|
||||
// Update mode: Cleanup specific directories/files
|
||||
int update_mode_cleanup(omninx_variant_t variant) {
|
||||
(void)variant;
|
||||
install_preserve_update_cleanup_begin();
|
||||
|
||||
check_and_clear_screen_if_needed();
|
||||
|
||||
set_color(COLOR_WHITE);
|
||||
@@ -66,6 +64,8 @@ int update_mode_cleanup(omninx_variant_t variant) {
|
||||
misc_files_to_delete,
|
||||
NULL);
|
||||
|
||||
install_preserve_update_cleanup_end();
|
||||
|
||||
set_color(COLOR_GREEN);
|
||||
gfx_printf(" Bereinigung abgeschlossen!\n");
|
||||
set_color(COLOR_WHITE);
|
||||
@@ -119,6 +119,10 @@ int update_mode_install(omninx_variant_t variant) {
|
||||
if (res != FR_OK && res != FR_NO_FILE) return res;
|
||||
}
|
||||
|
||||
s_printf(src_path, "%s/extras", staging);
|
||||
res = folder_copy_with_progress_v2(src_path, "sd:/", "extras/");
|
||||
if (res != FR_OK && res != FR_NO_FILE) return res;
|
||||
|
||||
set_color(COLOR_CYAN);
|
||||
gfx_printf(" Kopiere Root-Dateien...\n");
|
||||
set_color(COLOR_WHITE);
|
||||
|
||||
@@ -243,9 +243,9 @@
|
||||
|
||||
|
||||
#define FF_FS_NORTC 1
|
||||
#define FF_NORTC_MON 1
|
||||
#define FF_NORTC_MDAY 1
|
||||
#define FF_NORTC_YEAR 2020
|
||||
#define FF_NORTC_MON 7
|
||||
#define FF_NORTC_MDAY 17
|
||||
#define FF_NORTC_YEAR 2026
|
||||
/* The option FF_FS_NORTC switches timestamp function. If the system does not have
|
||||
/ any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable
|
||||
/ the timestamp function. Every object modified by FatFs will have a fixed timestamp
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
* Based on TegraExplorer/hekate by CTCaer, naehrwert, shchmue
|
||||
*/
|
||||
|
||||
#ifndef VERSION
|
||||
#define VERSION "1.0.0"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <display/di.h>
|
||||
@@ -145,7 +141,7 @@ static int launch_payload(const char *path) {
|
||||
if (sd_mount()) {
|
||||
FIL fp;
|
||||
if (f_open(&fp, path, FA_READ)) {
|
||||
gfx_printf("Payload nicht gefunden: %s\n", path);
|
||||
gfx_printf("Hekate nicht gefunden: %s\n", path);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -189,6 +185,12 @@ static int file_exists(const char *path) {
|
||||
return (f_stat(path, &fno) == FR_OK);
|
||||
}
|
||||
|
||||
void installer_launch_hekate_payload(void) {
|
||||
if (file_exists(PAYLOAD_PATH))
|
||||
launch_payload(PAYLOAD_PATH);
|
||||
power_set_state(POWER_OFF_REBOOT);
|
||||
}
|
||||
|
||||
extern void pivot_stack(u32 stack_top);
|
||||
|
||||
void ipl_main(void) {
|
||||
@@ -295,7 +297,7 @@ void ipl_main(void) {
|
||||
if (file_exists(PAYLOAD_PATH)) {
|
||||
gfx_printf("\n");
|
||||
set_color(COLOR_CYAN);
|
||||
gfx_printf("Payload wird gestartet...\n");
|
||||
gfx_printf("Hekate wird gestartet...\n");
|
||||
set_color(COLOR_WHITE);
|
||||
msleep(500);
|
||||
launch_payload(PAYLOAD_PATH);
|
||||
@@ -474,7 +476,8 @@ void ipl_main(void) {
|
||||
gfx_con_setpos(0, 0);
|
||||
print_header();
|
||||
|
||||
// UHS class check: recommend U2 / V30 / A2 for emuMMC (speed and reliability)
|
||||
// UHS class check: recommend U2 / V30 / A2 for emuMMC (clean install only)
|
||||
if (mode == INSTALL_MODE_CLEAN) {
|
||||
#define UHS_U2_MIN 2
|
||||
#define UHS_V30_MIN 30
|
||||
#define UHS_A2_MIN 2
|
||||
@@ -551,6 +554,7 @@ void ipl_main(void) {
|
||||
gfx_con_setpos(0, 0);
|
||||
print_header();
|
||||
}
|
||||
}
|
||||
|
||||
// Show information
|
||||
set_color(COLOR_CYAN);
|
||||
@@ -645,7 +649,7 @@ void ipl_main(void) {
|
||||
int result = perform_installation(pack_variant, mode);
|
||||
|
||||
// Wait 3 seconds before clearing screen to allow errors to be visible
|
||||
msleep(3000);
|
||||
msleep(1500);
|
||||
// take_screenshot(); // Take a screenshot of the installation summary
|
||||
|
||||
// Clear screen for final summary to ensure it's visible
|
||||
@@ -653,25 +657,20 @@ void ipl_main(void) {
|
||||
gfx_con_setpos(0, 0);
|
||||
|
||||
// Summary
|
||||
set_color(COLOR_CYAN);
|
||||
gfx_printf("========================================\n");
|
||||
gfx_printf(" OmniNX Installer Payload v%s\n", VERSION);
|
||||
gfx_printf("========================================\n\n");
|
||||
set_color(COLOR_WHITE);
|
||||
|
||||
const char *op_name = (mode == INSTALL_MODE_UPDATE) ? " Update" : " Installation";
|
||||
if (result == FR_OK && total_errors == 0) {
|
||||
set_color(COLOR_GREEN);
|
||||
gfx_printf("========================================\n");
|
||||
gfx_printf(" Installation abgeschlossen!\n");
|
||||
gfx_printf("========================================\n");
|
||||
gfx_printf("=======================================\n");
|
||||
gfx_printf(" %s abgeschlossen!\n", op_name);
|
||||
gfx_printf("=======================================\n");
|
||||
} else {
|
||||
set_color(COLOR_RED);
|
||||
gfx_printf("========================================\n");
|
||||
gfx_printf(" Installation beendet\n");
|
||||
gfx_printf("=======================================\n");
|
||||
gfx_printf(" %s beendet\n", op_name);
|
||||
if (total_errors > 0) {
|
||||
gfx_printf(" %d Fehler\n", total_errors);
|
||||
}
|
||||
gfx_printf("========================================\n");
|
||||
gfx_printf("=======================================\n");
|
||||
}
|
||||
set_color(COLOR_WHITE);
|
||||
|
||||
@@ -715,16 +714,16 @@ void ipl_main(void) {
|
||||
|
||||
gfx_printf("\n");
|
||||
set_color(COLOR_CYAN);
|
||||
gfx_printf("Payload wird gestartet...\n");
|
||||
gfx_printf("Hekate wird gestartet...\n");
|
||||
set_color(COLOR_WHITE);
|
||||
msleep(500); // Brief delay before launch
|
||||
|
||||
if (file_exists(PAYLOAD_PATH)) {
|
||||
launch_payload(PAYLOAD_PATH);
|
||||
} else {
|
||||
// Payload not found, show error
|
||||
// Hekate (update.bin) not found, show error
|
||||
set_color(COLOR_RED);
|
||||
gfx_printf("\nFEHLER: Payload nicht gefunden!\n");
|
||||
gfx_printf("\nFEHLER: Hekate nicht gefunden!\n");
|
||||
gfx_printf("Pfad: %s\n", PAYLOAD_PATH);
|
||||
set_color(COLOR_WHITE);
|
||||
gfx_printf("\nDruecke A oder Power zum Neustart...\n");
|
||||
|
||||
Reference in New Issue
Block a user