mirror of
https://github.com/CTCaer/hekate.git
synced 2025-08-29 05:35:44 +00:00
hos: refactor fss to pkg3
To `fss0` config is now renamed to `pkg3`. `fss0` still works but is deprecated. Additionally `fss0experimental` key is now renamed to `pkg3ex`
This commit is contained in:
parent
08872325c8
commit
f110f97099
8 changed files with 88 additions and 80 deletions
2
Makefile
2
Makefile
|
@ -48,7 +48,7 @@ OBJS += $(addprefix $(BUILDDIR)/$(TARGET)/, \
|
||||||
|
|
||||||
# Horizon.
|
# Horizon.
|
||||||
OBJS += $(addprefix $(BUILDDIR)/$(TARGET)/, \
|
OBJS += $(addprefix $(BUILDDIR)/$(TARGET)/, \
|
||||||
hos.o hos_config.o pkg1.o pkg2.o pkg2_ini_kippatch.o fss.o secmon_exo.o \
|
hos.o hos_config.o pkg1.o pkg2.o pkg3.o pkg2_ini_kippatch.o secmon_exo.o \
|
||||||
)
|
)
|
||||||
|
|
||||||
# Libraries.
|
# Libraries.
|
||||||
|
|
19
README.md
19
README.md
|
@ -98,8 +98,9 @@ There are four possible type of entries. "**[ ]**": Boot entry, "**{ }**": Capti
|
||||||
| kernel={FILE path} | Replaces the kernel binary |
|
| kernel={FILE path} | Replaces the kernel binary |
|
||||||
| kip1={FILE path} | Replaces/Adds kernel initial process. Multiple can be set. |
|
| kip1={FILE path} | Replaces/Adds kernel initial process. Multiple can be set. |
|
||||||
| kip1={FOLDER path}/* | Loads every .kip/.kip1 inside a folder. Compatible with single kip1 keys. |
|
| kip1={FOLDER path}/* | Loads every .kip/.kip1 inside a folder. Compatible with single kip1 keys. |
|
||||||
| fss0={FILE path} | Takes an Atmosphere `package3` binary (formerly fusee-secondary.bin) and `extracts` all needed parts from it. kips, exosphere, warmboot and mesophere if enabled. |
|
| pkg3={FILE path} | Takes an Atmosphere `package3` binary and `extracts` all needed parts from it. kips, exosphere, warmboot and mesophere. |
|
||||||
| fss0experimental=1 | Enables loading of experimental content from a FSS0 storage |
|
| fss0={FILE path} | Same as above. Deprecated! |
|
||||||
|
| pkg3ex=1 | Enables loading of experimental content from a PKG3/FSS0 storage |
|
||||||
| exofatal={FILE path} | Replaces the exosphere fatal binary for Mariko |
|
| exofatal={FILE path} | Replaces the exosphere fatal binary for Mariko |
|
||||||
| ---------------------- | ---------------------------------------------------------- |
|
| ---------------------- | ---------------------------------------------------------- |
|
||||||
| kip1patch=patchname | Enables a kip1 patch. Specify with multiple lines and/or in one line with `,` as separator. If actual patch is not found, a warning will show up |
|
| kip1patch=patchname | Enables a kip1 patch. Specify with multiple lines and/or in one line with `,` as separator. If actual patch is not found, a warning will show up |
|
||||||
|
@ -109,7 +110,7 @@ There are four possible type of entries. "**[ ]**": Boot entry, "**{ }**": Capti
|
||||||
| stock=1 | OFW via hekate bootloader. Disables unneeded kernel patching and CFW kips when running stock. `If emuMMC is enabled, emummc_force_disable=1` is required. emuMMC is not supported on stock. If additional KIPs are needed other than OFW's, you can define them with `kip1` key. No kip should be used that relies on Atmosphère patching, because it will hang. If `NOGC` is needed, use `kip1patch=nogc`. |
|
| stock=1 | OFW via hekate bootloader. Disables unneeded kernel patching and CFW kips when running stock. `If emuMMC is enabled, emummc_force_disable=1` is required. emuMMC is not supported on stock. If additional KIPs are needed other than OFW's, you can define them with `kip1` key. No kip should be used that relies on Atmosphère patching, because it will hang. If `NOGC` is needed, use `kip1patch=nogc`. |
|
||||||
| fullsvcperm=1 | Disables SVC verification (full services permission). Doesn't work with Mesosphere as kernel. |
|
| fullsvcperm=1 | Disables SVC verification (full services permission). Doesn't work with Mesosphere as kernel. |
|
||||||
| debugmode=1 | Enables Debug mode. Obsolete when used with exosphere as secmon. |
|
| debugmode=1 | Enables Debug mode. Obsolete when used with exosphere as secmon. |
|
||||||
| kernelprocid=1 | Enables stock kernel process id send/recv patching. Not needed when `fss0` is used. |
|
| kernelprocid=1 | Enables stock kernel process id send/recv patching. Not needed when `pkg3`/`fss0` is used. |
|
||||||
| ---------------------- | ---------------------------------------------------------- |
|
| ---------------------- | ---------------------------------------------------------- |
|
||||||
| payload={FILE path} | Payload launching. Tools, Android/Linux, CFW bootloaders, etc. Any key above when used with that, doesn't get into account. |
|
| payload={FILE path} | Payload launching. Tools, Android/Linux, CFW bootloaders, etc. Any key above when used with that, doesn't get into account. |
|
||||||
| ---------------------- | ---------------------------------------------------------- |
|
| ---------------------- | ---------------------------------------------------------- |
|
||||||
|
@ -129,11 +130,11 @@ There are four possible type of entries. "**[ ]**": Boot entry, "**{ }**": Capti
|
||||||
|
|
||||||
**Note1**: When using the wildcard (`/*`) with `kip1` you can still use the normal `kip1` after that to load extra single kips.
|
**Note1**: When using the wildcard (`/*`) with `kip1` you can still use the normal `kip1` after that to load extra single kips.
|
||||||
|
|
||||||
**Note2**: When using FSS0 it parses exosphere, warmboot and all core kips. You can override the first 2 by using `secmon`/`warmboot` after defining `fss0`.
|
**Note2**: When using PKG3/FSS0 it parses exosphere, warmboot and all core kips. You can override the first 2 by using `secmon`/`warmboot` after defining `pkg3`/`fss0`.
|
||||||
You can define `kip1` to load an extra kip or many via the wildcard (`/*`) usage.
|
You can define `kip1` to load an extra kip or many via the wildcard (`/*`) usage.
|
||||||
|
|
||||||
**Warning**: Careful when you define *fss0 core* kips when using `fss0` or the folder (when using `/*`) includes them.
|
**Warning**: Careful when you define *pkg3/fss core* kips when using `pkg3`/`fss0` or the folder (when using `/*`) includes them.
|
||||||
This is in case the kips are incompatible between them. If compatible, you can override `fss0` kips with no issues (useful for testing with intermediate kip changes). In such cases, the `kip1` line must be under `fss0` line.
|
That's in case the kips are incompatible between them. If compatible, you can override `pkg3`/`fss0` kips with no issues (useful for testing with intermediate kip changes). In such cases, the `kip1` line must be after `pkg3`/`fss0` line.
|
||||||
|
|
||||||
|
|
||||||
### Boot entry key/value combinations for Exosphère:
|
### Boot entry key/value combinations for Exosphère:
|
||||||
|
@ -155,7 +156,7 @@ This is in case the kips are incompatible between them. If compatible, you can o
|
||||||
|
|
||||||
### Payload storage:
|
### Payload storage:
|
||||||
|
|
||||||
hekate has a boot storage in the binary that helps it configure it outside of BPMP enviroment:
|
hekate has a boot storage in the binary that helps it configure it outside of BPMP environment:
|
||||||
|
|
||||||
| Offset / Name | Description |
|
| Offset / Name | Description |
|
||||||
| ----------------------- | ----------------------------------------------------------------- |
|
| ----------------------- | ----------------------------------------------------------------- |
|
||||||
|
@ -188,9 +189,9 @@ hekate has a boot storage in the binary that helps it configure it outside of BP
|
||||||
|
|
||||||
```
|
```
|
||||||
hekate (c) 2018, naehrwert, st4rk.
|
hekate (c) 2018, naehrwert, st4rk.
|
||||||
(c) 2018-2024, CTCaer.
|
(c) 2018-2025, CTCaer.
|
||||||
|
|
||||||
Nyx GUI (c) 2019-2024, CTCaer.
|
Nyx GUI (c) 2019-2025, CTCaer.
|
||||||
|
|
||||||
Thanks to: derrek, nedwill, plutoo, shuffle2, smea, thexyz, yellows8.
|
Thanks to: derrek, nedwill, plutoo, shuffle2, smea, thexyz, yellows8.
|
||||||
Greetings to: fincs, hexkyz, SciresM, Shiny Quagsire, WinterMute.
|
Greetings to: fincs, hexkyz, SciresM, Shiny Quagsire, WinterMute.
|
||||||
|
|
|
@ -698,7 +698,7 @@ out:
|
||||||
static void _free_launch_components(launch_ctxt_t *ctxt)
|
static void _free_launch_components(launch_ctxt_t *ctxt)
|
||||||
{
|
{
|
||||||
// Free the malloc'ed guaranteed addresses.
|
// Free the malloc'ed guaranteed addresses.
|
||||||
free(ctxt->fss0);
|
free(ctxt->pkg3);
|
||||||
free(ctxt->keyblob);
|
free(ctxt->keyblob);
|
||||||
free(ctxt->pkg1);
|
free(ctxt->pkg1);
|
||||||
free(ctxt->pkg2);
|
free(ctxt->pkg2);
|
||||||
|
|
|
@ -111,8 +111,8 @@ typedef struct _launch_ctxt_t
|
||||||
bool stock;
|
bool stock;
|
||||||
bool emummc_forced;
|
bool emummc_forced;
|
||||||
|
|
||||||
void *fss0;
|
void *pkg3;
|
||||||
u32 fss0_hosver;
|
u32 pkg3_hosver;
|
||||||
bool patch_krn_proc_id;
|
bool patch_krn_proc_id;
|
||||||
|
|
||||||
int ucid;
|
int ucid;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "hos.h"
|
#include "hos.h"
|
||||||
#include "hos_config.h"
|
#include "hos_config.h"
|
||||||
#include "fss.h"
|
#include "pkg3.h"
|
||||||
#include <libs/fatfs/ff.h>
|
#include <libs/fatfs/ff.h>
|
||||||
|
|
||||||
//#define DPRINTF(...) gfx_printf(__VA_ARGS__)
|
//#define DPRINTF(...) gfx_printf(__VA_ARGS__)
|
||||||
|
@ -255,9 +255,9 @@ static int _config_exo_cal0_writes_enable(launch_ctxt_t *ctxt, const char *value
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _config_fss(launch_ctxt_t *ctxt, const char *value)
|
static int _config_pkg3(launch_ctxt_t *ctxt, const char *value)
|
||||||
{
|
{
|
||||||
return parse_fss(ctxt, value);
|
return parse_pkg3(ctxt, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _config_exo_fatal_payload(launch_ctxt_t *ctxt, const char *value)
|
static int _config_exo_fatal_payload(launch_ctxt_t *ctxt, const char *value)
|
||||||
|
@ -295,7 +295,8 @@ static const cfg_handler_t _config_handlers[] = {
|
||||||
{ "kernelprocid", _config_kernel_proc_id },
|
{ "kernelprocid", _config_kernel_proc_id },
|
||||||
|
|
||||||
// To override elements from PKG3, it should be set before others.
|
// To override elements from PKG3, it should be set before others.
|
||||||
{ "fss0", _config_fss },
|
{ "pkg3", _config_pkg3 },
|
||||||
|
{ "fss0", _config_pkg3 },
|
||||||
|
|
||||||
{ "exofatal", _config_exo_fatal_payload},
|
{ "exofatal", _config_exo_fatal_payload},
|
||||||
{ "emummcforce", _config_emummc_forced },
|
{ "emummcforce", _config_emummc_forced },
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Atmosphère Fusée Secondary Storage (Package3) parser.
|
* Atmosphère Package 3 parser.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2019-2024 CTCaer
|
* Copyright (c) 2019-2025 CTCaer
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#include <bdk.h>
|
#include <bdk.h>
|
||||||
|
|
||||||
#include "fss.h"
|
#include "pkg3.h"
|
||||||
#include "hos.h"
|
#include "hos.h"
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#include <libs/fatfs/ff.h>
|
#include <libs/fatfs/ff.h>
|
||||||
|
@ -33,12 +33,14 @@ extern hekate_config h_cfg;
|
||||||
|
|
||||||
extern bool is_ipl_updated(void *buf, const char *path, bool force);
|
extern bool is_ipl_updated(void *buf, const char *path, bool force);
|
||||||
|
|
||||||
// FSS0 Magic and Meta header offset.
|
#define PKG3_KIP_SKIP_MAX 16
|
||||||
#define FSS0_MAGIC 0x30535346
|
|
||||||
#define FSS0_META_OFFSET 0x4
|
|
||||||
#define FSS0_VERSION_0_17_0 0x110000
|
|
||||||
|
|
||||||
// FSS0 Content Types.
|
// PKG3 Magic and Meta header offset.
|
||||||
|
#define PKG3_MAGIC 0x30535346 // FSS0.
|
||||||
|
#define PKG3_META_OFFSET 0x4
|
||||||
|
#define PKG3_VERSION_0_17_0 0x110000
|
||||||
|
|
||||||
|
// PKG3 Content Types.
|
||||||
#define CNT_TYPE_FSP 0
|
#define CNT_TYPE_FSP 0
|
||||||
#define CNT_TYPE_EXO 1 // Exosphere (Secure Monitor).
|
#define CNT_TYPE_EXO 1 // Exosphere (Secure Monitor).
|
||||||
#define CNT_TYPE_WBT 2 // Warmboot (SC7Exit fw).
|
#define CNT_TYPE_WBT 2 // Warmboot (SC7Exit fw).
|
||||||
|
@ -53,11 +55,11 @@ extern bool is_ipl_updated(void *buf, const char *path, bool force);
|
||||||
#define CNT_TYPE_EXF 11 // Exosphere Mariko fatal payload.
|
#define CNT_TYPE_EXF 11 // Exosphere Mariko fatal payload.
|
||||||
#define CNT_TYPE_TKG 12 // Tsec Keygen.
|
#define CNT_TYPE_TKG 12 // Tsec Keygen.
|
||||||
|
|
||||||
// FSS0 Content Flags.
|
// PKG3 Content Flags.
|
||||||
#define CNT_FLAG0_EXPERIMENTAL BIT(0)
|
#define CNT_FLAG0_EXPERIMENTAL BIT(0)
|
||||||
|
|
||||||
// FSS0 Meta Header.
|
// PKG3 Meta Header.
|
||||||
typedef struct _fss_meta_t
|
typedef struct _pkg3_meta_t
|
||||||
{
|
{
|
||||||
u32 magic;
|
u32 magic;
|
||||||
u32 size;
|
u32 size;
|
||||||
|
@ -67,10 +69,10 @@ typedef struct _fss_meta_t
|
||||||
u32 hos_ver;
|
u32 hos_ver;
|
||||||
u32 version;
|
u32 version;
|
||||||
u32 git_rev;
|
u32 git_rev;
|
||||||
} fss_meta_t;
|
} pkg3_meta_t;
|
||||||
|
|
||||||
// FSS0 Content Header.
|
// PKG3 Content Header.
|
||||||
typedef struct _fss_content_t
|
typedef struct _pkg3_content_t
|
||||||
{
|
{
|
||||||
u32 offset;
|
u32 offset;
|
||||||
u32 size;
|
u32 size;
|
||||||
|
@ -80,9 +82,9 @@ typedef struct _fss_content_t
|
||||||
u8 flags2;
|
u8 flags2;
|
||||||
u32 rsvd1;
|
u32 rsvd1;
|
||||||
char name[0x10];
|
char name[0x10];
|
||||||
} fss_content_t;
|
} pkg3_content_t;
|
||||||
|
|
||||||
static void _fss_update_r2p()
|
static void _pkg3_update_r2p()
|
||||||
{
|
{
|
||||||
u8 *r2p_payload = sd_file_read("atmosphere/reboot_payload.bin", NULL);
|
u8 *r2p_payload = sd_file_read("atmosphere/reboot_payload.bin", NULL);
|
||||||
|
|
||||||
|
@ -91,7 +93,7 @@ static void _fss_update_r2p()
|
||||||
free(r2p_payload);
|
free(r2p_payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
int parse_fss(launch_ctxt_t *ctxt, const char *path)
|
int parse_pkg3(launch_ctxt_t *ctxt, const char *path)
|
||||||
{
|
{
|
||||||
FIL fp;
|
FIL fp;
|
||||||
|
|
||||||
|
@ -108,7 +110,7 @@ int parse_fss(launch_ctxt_t *ctxt, const char *path)
|
||||||
if (kv->val[0] == '1')
|
if (kv->val[0] == '1')
|
||||||
stock = true;
|
stock = true;
|
||||||
|
|
||||||
if (!strcmp("fss0experimental", kv->key))
|
if (!strcmp("pkg3ex", kv->key))
|
||||||
if (kv->val[0] == '1')
|
if (kv->val[0] == '1')
|
||||||
experimental = true;
|
experimental = true;
|
||||||
}
|
}
|
||||||
|
@ -121,48 +123,48 @@ int parse_fss(launch_ctxt_t *ctxt, const char *path)
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Try to open FSS0.
|
// Try to open PKG3.
|
||||||
if (f_open(&fp, path, FA_READ) != FR_OK)
|
if (f_open(&fp, path, FA_READ) != FR_OK)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
void *fss = malloc(f_size(&fp));
|
void *pkg3 = malloc(f_size(&fp));
|
||||||
|
|
||||||
// Read first 1024 bytes of the FSS0 file.
|
// Read first 1024 bytes of the PKG3 file.
|
||||||
f_read(&fp, fss, 1024, NULL);
|
f_read(&fp, pkg3, 1024, NULL);
|
||||||
|
|
||||||
// Get FSS0 Meta header offset.
|
// Get PKG3 Meta header offset.
|
||||||
u32 fss_meta_addr = *(u32 *)(fss + FSS0_META_OFFSET);
|
u32 pkg3_meta_addr = *(u32 *)(pkg3 + PKG3_META_OFFSET);
|
||||||
fss_meta_t *fss_meta = (fss_meta_t *)(fss + fss_meta_addr);
|
pkg3_meta_t *pkg3_meta = (pkg3_meta_t *)(pkg3 + pkg3_meta_addr);
|
||||||
|
|
||||||
// Check if valid FSS0 and parse it.
|
// Check if valid PKG3 and parse it.
|
||||||
if (fss_meta->magic == FSS0_MAGIC)
|
if (pkg3_meta->magic == PKG3_MAGIC)
|
||||||
{
|
{
|
||||||
gfx_printf("Atmosphere %d.%d.%d-%08x via FSS0/PKG3\n"
|
gfx_printf("Atmosphere %d.%d.%d-%08x via PKG3\n"
|
||||||
"Max HOS: %d.%d.%d\n"
|
"Max HOS: %d.%d.%d\n"
|
||||||
"Unpacking.. ",
|
"Unpacking.. ",
|
||||||
fss_meta->version >> 24, (fss_meta->version >> 16) & 0xFF, (fss_meta->version >> 8) & 0xFF, fss_meta->git_rev,
|
pkg3_meta->version >> 24, (pkg3_meta->version >> 16) & 0xFF, (pkg3_meta->version >> 8) & 0xFF, pkg3_meta->git_rev,
|
||||||
fss_meta->hos_ver >> 24, (fss_meta->hos_ver >> 16) & 0xFF, (fss_meta->hos_ver >> 8) & 0xFF);
|
pkg3_meta->hos_ver >> 24, (pkg3_meta->hos_ver >> 16) & 0xFF, (pkg3_meta->hos_ver >> 8) & 0xFF);
|
||||||
|
|
||||||
ctxt->patch_krn_proc_id = true;
|
ctxt->patch_krn_proc_id = true;
|
||||||
ctxt->fss0_hosver = fss_meta->hos_ver;
|
ctxt->pkg3_hosver = pkg3_meta->hos_ver;
|
||||||
|
|
||||||
// Parse FSS0 contents.
|
// Parse PKG3 contents.
|
||||||
fss_content_t *curr_fss_cnt = (fss_content_t *)(fss + fss_meta->cnt_off);
|
pkg3_content_t *curr_pkg3_cnt = (pkg3_content_t *)(pkg3 + pkg3_meta->cnt_off);
|
||||||
void *content;
|
void *content;
|
||||||
for (u32 i = 0; i < fss_meta->cnt_count; i++)
|
for (u32 i = 0; i < pkg3_meta->cnt_count; i++)
|
||||||
{
|
{
|
||||||
content = (void *)(fss + curr_fss_cnt[i].offset);
|
content = (void *)(pkg3 + curr_pkg3_cnt[i].offset);
|
||||||
|
|
||||||
// Check if offset is inside limits.
|
// Check if offset is inside limits.
|
||||||
if ((curr_fss_cnt[i].offset + curr_fss_cnt[i].size) > fss_meta->size)
|
if ((curr_pkg3_cnt[i].offset + curr_pkg3_cnt[i].size) > pkg3_meta->size)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If content is experimental and experimental config is not enabled, skip it.
|
// If content is experimental and experimental config is not enabled, skip it.
|
||||||
if ((curr_fss_cnt[i].flags0 & CNT_FLAG0_EXPERIMENTAL) && !experimental)
|
if ((curr_pkg3_cnt[i].flags0 & CNT_FLAG0_EXPERIMENTAL) && !experimental)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Prepare content.
|
// Prepare content.
|
||||||
switch (curr_fss_cnt[i].type)
|
switch (curr_pkg3_cnt[i].type)
|
||||||
{
|
{
|
||||||
case CNT_TYPE_KIP:
|
case CNT_TYPE_KIP:
|
||||||
if (stock)
|
if (stock)
|
||||||
|
@ -170,30 +172,30 @@ int parse_fss(launch_ctxt_t *ctxt, const char *path)
|
||||||
merge_kip_t *mkip1 = (merge_kip_t *)malloc(sizeof(merge_kip_t));
|
merge_kip_t *mkip1 = (merge_kip_t *)malloc(sizeof(merge_kip_t));
|
||||||
mkip1->kip1 = content;
|
mkip1->kip1 = content;
|
||||||
list_append(&ctxt->kip1_list, &mkip1->link);
|
list_append(&ctxt->kip1_list, &mkip1->link);
|
||||||
DPRINTF("Loaded %s.kip1 from FSS0 (size %08X)\n", curr_fss_cnt[i].name, curr_fss_cnt[i].size);
|
DPRINTF("Loaded %s.kip1 from PKG3 (size %08X)\n", curr_pkg3_cnt[i].name, curr_pkg3_cnt[i].size);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CNT_TYPE_KRN:
|
case CNT_TYPE_KRN:
|
||||||
if (stock)
|
if (stock)
|
||||||
continue;
|
continue;
|
||||||
ctxt->kernel_size = curr_fss_cnt[i].size;
|
ctxt->kernel_size = curr_pkg3_cnt[i].size;
|
||||||
ctxt->kernel = content;
|
ctxt->kernel = content;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CNT_TYPE_EXO:
|
case CNT_TYPE_EXO:
|
||||||
ctxt->secmon_size = curr_fss_cnt[i].size;
|
ctxt->secmon_size = curr_pkg3_cnt[i].size;
|
||||||
ctxt->secmon = content;
|
ctxt->secmon = content;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CNT_TYPE_EXF:
|
case CNT_TYPE_EXF:
|
||||||
ctxt->exofatal_size = curr_fss_cnt[i].size;
|
ctxt->exofatal_size = curr_pkg3_cnt[i].size;
|
||||||
ctxt->exofatal = content;
|
ctxt->exofatal = content;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CNT_TYPE_WBT:
|
case CNT_TYPE_WBT:
|
||||||
if (h_cfg.t210b01)
|
if (h_cfg.t210b01)
|
||||||
continue;
|
continue;
|
||||||
ctxt->warmboot_size = curr_fss_cnt[i].size;
|
ctxt->warmboot_size = curr_pkg3_cnt[i].size;
|
||||||
ctxt->warmboot = content;
|
ctxt->warmboot = content;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -202,23 +204,24 @@ int parse_fss(launch_ctxt_t *ctxt, const char *path)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load content to launch context.
|
// Load content to launch context.
|
||||||
f_lseek(&fp, curr_fss_cnt[i].offset);
|
f_lseek(&fp, curr_pkg3_cnt[i].offset);
|
||||||
f_read(&fp, content, curr_fss_cnt[i].size, NULL);
|
f_read(&fp, content, curr_pkg3_cnt[i].size, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx_printf("Done!\n");
|
gfx_printf("Done!\n");
|
||||||
f_close(&fp);
|
f_close(&fp);
|
||||||
|
|
||||||
ctxt->fss0 = fss;
|
ctxt->pkg3 = pkg3;
|
||||||
|
|
||||||
// Update r2p if needed.
|
// Update r2p if needed.
|
||||||
_fss_update_r2p();
|
_pkg3_update_r2p();
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Failed. Close and free all.
|
||||||
f_close(&fp);
|
f_close(&fp);
|
||||||
free(fss);
|
free(pkg3);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
|
@ -14,11 +14,11 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _FSS_H_
|
#ifndef _PKG3_H_
|
||||||
#define _FSS_H_
|
#define _PKG3_H_
|
||||||
|
|
||||||
#include "hos.h"
|
#include "hos.h"
|
||||||
|
|
||||||
int parse_fss(launch_ctxt_t *ctxt, const char *path);
|
int parse_pkg3(launch_ctxt_t *ctxt, const char *path);
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -9,10 +9,13 @@ autonogc=1
|
||||||
updater2p=1
|
updater2p=1
|
||||||
bootprotect=0
|
bootprotect=0
|
||||||
|
|
||||||
|
# Only include above what you want to change from defaults.
|
||||||
|
# config.c in bootloader and Nyx have all the defaults.
|
||||||
|
|
||||||
|
|
||||||
{-------- Stock -------}
|
{-------- Stock -------}
|
||||||
[Stock]
|
[Stock]
|
||||||
fss0=atmosphere/package3
|
pkg3=atmosphere/package3
|
||||||
stock=1
|
stock=1
|
||||||
emummc_force_disable=1
|
emummc_force_disable=1
|
||||||
|
|
||||||
|
@ -26,7 +29,7 @@ emummc_force_disable=1
|
||||||
|
|
||||||
{-- Custom Firmwares --}
|
{-- Custom Firmwares --}
|
||||||
[Atmo Vanilla]
|
[Atmo Vanilla]
|
||||||
fss0=atmosphere/package3
|
pkg3=atmosphere/package3
|
||||||
kip1=atmosphere/kips/*
|
kip1=atmosphere/kips/*
|
||||||
|
|
||||||
# Note:
|
# Note:
|
||||||
|
@ -36,11 +39,11 @@ kip1=atmosphere/kips/*
|
||||||
|
|
||||||
|
|
||||||
[Atmo EMU]
|
[Atmo EMU]
|
||||||
fss0=atmosphere/package3
|
pkg3=atmosphere/package3
|
||||||
emummcforce=1
|
emummcforce=1
|
||||||
|
|
||||||
[Atmo SYS]
|
[Atmo SYS]
|
||||||
fss0=atmosphere/package3
|
pkg3=atmosphere/package3
|
||||||
emummc_force_disable=1
|
emummc_force_disable=1
|
||||||
|
|
||||||
# Note:
|
# Note:
|
||||||
|
@ -55,7 +58,7 @@ emummc_force_disable=1
|
||||||
|
|
||||||
|
|
||||||
[Atmo EMU2]
|
[Atmo EMU2]
|
||||||
fss0=atmosphere/package3
|
pkg3=atmosphere/package3
|
||||||
emupath=emuMMC/SD02
|
emupath=emuMMC/SD02
|
||||||
emummcforce=1
|
emummcforce=1
|
||||||
|
|
||||||
|
@ -68,26 +71,26 @@ emummcforce=1
|
||||||
|
|
||||||
|
|
||||||
[Atmo with extra kips]
|
[Atmo with extra kips]
|
||||||
fss0=atmosphere/package3
|
pkg3=atmosphere/package3
|
||||||
kip1=cfw/mods/mods_extra/*
|
kip1=cfw/mods/mods_extra/*
|
||||||
kip1=cfw/mods/mods_extra/single/extra.kip
|
kip1=cfw/mods/mods_extra/single/extra.kip
|
||||||
|
|
||||||
# Note:
|
# Note:
|
||||||
# The above can be used with any fss0 entry. Like the ones above.
|
# The above can be used with any pkg3 entry. Like the ones above.
|
||||||
# You can even override atmosphere (fss0) kips with this.
|
# You can even override atmosphere (pkg3) kips with this.
|
||||||
# The wildcard '*' like above can be used to load all kips from a selected directory.
|
# The wildcard '*' like above can be used to load all kips from a selected directory.
|
||||||
|
|
||||||
|
|
||||||
{-- Custom Firmwares Old methods --}
|
{-- Custom Firmwares Old methods --}
|
||||||
[CFW FSS0 extra kips & patches]
|
[CFW PKG3 extra kips & patches]
|
||||||
fss0=atmosphere/package3
|
pkg3=atmosphere/package3
|
||||||
kip1patch=name_of_patch
|
kip1patch=name_of_patch
|
||||||
kip1=cfw/mods/mods_extra/*
|
kip1=cfw/mods/mods_extra/*
|
||||||
kip1=cfw/mods/mods_extra/single/extra.kip
|
kip1=cfw/mods/mods_extra/single/extra.kip
|
||||||
|
|
||||||
# Note:
|
# Note:
|
||||||
# Both options for kip1 can be used. Wildcard and single.
|
# Both options for kip1 can be used. Wildcard and single.
|
||||||
# You can override kips loaded from FSS0/PKG3 if you define them after the fss0 key.
|
# You can override kips loaded from PKG3/FSS0 if you define them after the pkg3 key.
|
||||||
# If kip1 patch resides in patches.ini and that file OR the patch for
|
# If kip1 patch resides in patches.ini and that file OR the patch for
|
||||||
# current HOS version does not exist, it will error out.
|
# current HOS version does not exist, it will error out.
|
||||||
|
|
||||||
|
@ -106,7 +109,7 @@ atmosphere=1
|
||||||
|
|
||||||
# Note:
|
# Note:
|
||||||
# All kips defined method. This can be changed to what is below also.
|
# All kips defined method. This can be changed to what is below also.
|
||||||
# atmosphere=1 key is IMPORTANT when no FFS0 is defined.
|
# atmosphere=1 key is IMPORTANT when no PKG3/FSS0 is defined.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue