From 8abda7f2596fb0957321b40e4bb5e65787690147 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Mon, 9 Mar 2020 08:58:12 +0200 Subject: [PATCH] fss0: Support experimental content Use key `fss0experimental=1` in a boot entry with `fss0=` defined to enable experimental content. (Older versions of hekate will just skip any experimental content.) --- README.md | 1 + bootloader/hos/fss.c | 10 +++++++++- bootloader/hos/hos.h | 1 + bootloader/hos/hos_config.c | 9 +++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4627cf6..909bd94 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ You can find a template [Here](./res/hekate_ipl_template.ini) | kip1={SD path} | Replaces/Adds kernel initial process. Multiple can be set. | | kip1={SD folder}/* | Loads every .kip/.kip1 inside a folder. Compatible with single kip1 keys. | | fss0={SD path} | Takes a fusee-secondary binary and `extracts` all needed parts from it. kips, exosphere, warmboot and sept. | +| fss0experimental=1 | Enables loading of experimental content from a FSS0 storage | | kip1patch=patchname | Enables a kip1 patch. Specify with multiple lines and/or as CSV. If not found, an error will show up | | fullsvcperm=1 | Disables SVC verification (full services permission) | | debugmode=1 | Enables Debug mode. Obsolete when used with exosphere as secmon. | diff --git a/bootloader/hos/fss.c b/bootloader/hos/fss.c index 80c75c4..9c9e0c2 100644 --- a/bootloader/hos/fss.c +++ b/bootloader/hos/fss.c @@ -44,6 +44,8 @@ extern bool is_ipl_updated(void *buf, char *path, bool force); #define CNT_TYPE_BMP 7 #define CNT_TYPE_EMC 8 +#define CNT_FLAG0_EXPERIMENTAL (1 << 0) + typedef struct _fss_t { u32 magic; @@ -60,7 +62,10 @@ typedef struct _fss_content_t { u32 offset; u32 size; - u32 type; + u8 type; + u8 flags0; + u8 flags1; + u8 flags2; u32 rsvd1; char name[0x10]; } fss_content_t; @@ -142,6 +147,9 @@ int parse_fss(launch_ctxt_t *ctxt, const char *path, fss0_sept_t *sept_ctxt) if ((curr_fss_cnt[i].offset + curr_fss_cnt[i].size) > fss_meta->size) continue; + if ((curr_fss_cnt[i].flags0 & CNT_FLAG0_EXPERIMENTAL) && !ctxt->fss0_enable_experimental) + continue; + // Load content to launch context. if (!sept_ctxt) { diff --git a/bootloader/hos/hos.h b/bootloader/hos/hos.h index 63f724d..cc218b1 100644 --- a/bootloader/hos/hos.h +++ b/bootloader/hos/hos.h @@ -67,6 +67,7 @@ typedef struct _launch_ctxt_t bool atmosphere; bool exo_no_user_exceptions; bool exo_user_pmu; + bool fss0_enable_experimental; bool emuMMC; ini_sec_t *cfg; diff --git a/bootloader/hos/hos_config.c b/bootloader/hos/hos_config.c index d0b09c8..390d51d 100644 --- a/bootloader/hos/hos_config.c +++ b/bootloader/hos/hos_config.c @@ -213,6 +213,15 @@ static int _config_exo_user_pmu_access(launch_ctxt_t *ctxt, const char *value) static int _config_fss(launch_ctxt_t *ctxt, const char *value) { + LIST_FOREACH_ENTRY(ini_kv_t, kv, &ctxt->cfg->kvs, link) + { + if (!strcmp("fss0experimental", kv->key)) + { + ctxt->fss0_enable_experimental = *kv->val == '1'; + break; + } + } + return parse_fss(ctxt, value, NULL); }