merged with atmosphere 0.16.0-p2

This commit is contained in:
Michael Scire 2020-12-03 12:54:44 -08:00 committed by rashevskyv
parent d2f48d5e36
commit 4695edc3b7
14 changed files with 5090 additions and 104 deletions

123
Makefile
View File

@ -39,7 +39,7 @@ clean:
$(MAKE) -C fusee clean $(MAKE) -C fusee clean
rm -rf out rm -rf out
dist-no-debug: all dist: all
$(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \ $(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
| tr -s [:blank:] \ | tr -s [:blank:] \
| cut -d' ' -f3)) | cut -d' ' -f3))
@ -49,67 +49,70 @@ dist-no-debug: all
$(eval MICROVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MICRO\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \ $(eval MICROVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MICRO\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
| tr -s [:blank:] \ | tr -s [:blank:] \
| cut -d' ' -f3)) | cut -d' ' -f3))
$(eval AMSVER = $(MAJORVER).$(MINORVER).$(MICROVER)-$(AMSREV)) $(eval AMSVER = out)
rm -rf ../atmosphere-$(AMSVER).zip
rm -rf atmosphere-$(AMSVER) rm -rf atmosphere-$(AMSVER)
rm -rf out rm -rf out
mkdir atmosphere-$(AMSVER)
mkdir atmosphere-$(AMSVER)/atmosphere mkdir -p atmosphere-$(AMSVER)
mkdir atmosphere-$(AMSVER)/sept mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere
mkdir atmosphere-$(AMSVER)/switch mkdir -p atmosphere-$(AMSVER)/base/bootloader/payloads
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000008 mkdir -p atmosphere-$(AMSVER)/atmo/sept
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/010000000000000D mkdir -p atmosphere-$(AMSVER)/atmo/switch/daybreak
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/010000000000002B mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000008
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032 mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/contents/010000000000000D
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000034 mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/contents/010000000000002B
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000036 mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000032
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000037 mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000034
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/010000000000003C mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000036
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000042 mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000037
mkdir -p atmosphere-$(AMSVER)/atmosphere/fatal_errors mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/contents/010000000000003C
mkdir -p atmosphere-$(AMSVER)/atmosphere/config_templates mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000042
mkdir -p atmosphere-$(AMSVER)/atmosphere/config mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/fatal_errors
cp fusee/fusee-primary/fusee-primary.bin atmosphere-$(AMSVER)/atmosphere/reboot_payload.bin mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/config_templates
cp fusee/fusee-mtc/fusee-mtc.bin atmosphere-$(AMSVER)/atmosphere/fusee-mtc.bin mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/config
cp fusee/fusee-secondary/fusee-secondary-experimental.bin atmosphere-$(AMSVER)/atmosphere/fusee-secondary.bin
cp fusee/fusee-secondary/fusee-secondary-experimental.bin atmosphere-$(AMSVER)/sept/payload.bin cp fusee/fusee-mtc/fusee-mtc.bin atmosphere-$(AMSVER)/atmo/atmosphere/fusee-mtc.bin
cp sept/sept-primary/sept-primary.bin atmosphere-$(AMSVER)/sept/sept-primary.bin cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/atmo/atmosphere/fusee-secondary.bin
cp sept/sept-secondary/sept-secondary.bin atmosphere-$(AMSVER)/sept/sept-secondary.bin cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/atmo/sept/payload.bin
cp sept/sept-secondary/sept-secondary_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_00.enc
cp sept/sept-secondary/sept-secondary_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_01.enc
cp sept/sept-secondary/sept-secondary_dev_00.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_00.enc cp sept/sept-primary/sept-primary.bin atmosphere-$(AMSVER)/atmo/sept/sept-primary.bin
cp sept/sept-secondary/sept-secondary_dev_01.enc atmosphere-$(AMSVER)/sept/sept-secondary_dev_01.enc cp sept/sept-secondary/sept-secondary.bin atmosphere-$(AMSVER)/atmo/sept/sept-secondary.bin
cp config_templates/BCT.ini atmosphere-$(AMSVER)/atmosphere/config/BCT.ini cp sept/sept-secondary/sept-secondary_00.enc atmosphere-$(AMSVER)/atmo/sept/sept-secondary_00.enc
cp config_templates/override_config.ini atmosphere-$(AMSVER)/atmosphere/config_templates/override_config.ini cp sept/sept-secondary/sept-secondary_01.enc atmosphere-$(AMSVER)/atmo/sept/sept-secondary_01.enc
cp config_templates/system_settings.ini atmosphere-$(AMSVER)/atmosphere/config_templates/system_settings.ini cp sept/sept-secondary/sept-secondary_dev_00.enc atmosphere-$(AMSVER)/atmo/sept/sept-secondary_dev_00.enc
cp config_templates/exosphere.ini atmosphere-$(AMSVER)/atmosphere/config_templates/exosphere.ini cp sept/sept-secondary/sept-secondary_dev_01.enc atmosphere-$(AMSVER)/atmo/sept/sept-secondary_dev_01.enc
cp -r config_templates/kip_patches atmosphere-$(AMSVER)/atmosphere/kip_patches
cp -r config_templates/hbl_html atmosphere-$(AMSVER)/atmosphere/hbl_html cp config_templates/override_config.ini atmosphere-$(AMSVER)/atmo/atmosphere/config_templates/override_config.ini
cp stratosphere/boot2/boot2.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000008/exefs.nsp cp config_templates/system_settings.ini atmosphere-$(AMSVER)/atmo/atmosphere/config_templates/system_settings.ini
cp stratosphere/dmnt/dmnt.nsp atmosphere-$(AMSVER)/atmosphere/contents/010000000000000D/exefs.nsp cp config_templates/exosphere.ini atmosphere-$(AMSVER)/atmo/atmosphere/config_templates/exosphere.ini
cp stratosphere/erpt/erpt.nsp atmosphere-$(AMSVER)/atmosphere/contents/010000000000002B/exefs.nsp
cp stratosphere/eclct.stub/eclct.stub.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032/exefs.nsp cp -r config_templates/kip_patches atmosphere-$(AMSVER)/atmo/atmosphere/kip_patches
cp stratosphere/fatal/fatal.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000034/exefs.nsp cp -r config_templates/hbl_html atmosphere-$(AMSVER)/atmo/atmosphere/hbl_html
cp stratosphere/creport/creport.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000036/exefs.nsp cp stratosphere/boot2/boot2.nsp atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000008/exefs.nsp
cp stratosphere/ro/ro.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000037/exefs.nsp cp stratosphere/dmnt/dmnt.nsp atmosphere-$(AMSVER)/atmo/atmosphere/contents/010000000000000D/exefs.nsp
cp stratosphere/jpegdec/jpegdec.nsp atmosphere-$(AMSVER)/atmosphere/contents/010000000000003C/exefs.nsp cp stratosphere/erpt/erpt.nsp atmosphere-$(AMSVER)/atmo/atmosphere/contents/010000000000002B/exefs.nsp
cp stratosphere/pgl/pgl.nsp atmosphere-$(AMSVER)/atmosphere/contents/0100000000000042/exefs.nsp cp stratosphere/eclct.stub/eclct.stub.nsp atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000032/exefs.nsp
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032/flags cp stratosphere/fatal/fatal.nsp atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000034/exefs.nsp
touch atmosphere-$(AMSVER)/atmosphere/contents/0100000000000032/flags/boot2.flag cp stratosphere/creport/creport.nsp atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000036/exefs.nsp
mkdir -p atmosphere-$(AMSVER)/atmosphere/contents/0100000000000037/flags cp stratosphere/ro/ro.nsp atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000037/exefs.nsp
touch atmosphere-$(AMSVER)/atmosphere/contents/0100000000000037/flags/boot2.flag cp stratosphere/jpegdec/jpegdec.nsp atmosphere-$(AMSVER)/atmo/atmosphere/contents/010000000000003C/exefs.nsp
cp troposphere/reboot_to_payload/reboot_to_payload.nro atmosphere-$(AMSVER)/switch/reboot_to_payload.nro cp stratosphere/pgl/pgl.nsp atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000042/exefs.nsp
cp troposphere/daybreak/daybreak.nro atmosphere-$(AMSVER)/switch/daybreak.nro
cd atmosphere-$(AMSVER); zip -r ../atmosphere-EXPERIMENTAL-$(AMSVER).zip ./*; cd ../; mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000032/flags
cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/atmosphere/fusee-secondary.bin touch atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000032/flags/boot2.flag
cp fusee/fusee-secondary/fusee-secondary.bin atmosphere-$(AMSVER)/sept/payload.bin mkdir -p atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000037/flags
touch atmosphere-$(AMSVER)/atmo/atmosphere/contents/0100000000000037/flags/boot2.flag
cp fusee/fusee-primary/fusee-primary.bin atmosphere-$(AMSVER)/base/bootloader/payloads/fusee-primary.bin
cp troposphere/daybreak/daybreak.nro atmosphere-$(AMSVER)/atmo/switch/daybreak/daybreak.nro
cd atmosphere-$(AMSVER); zip -r ../atmosphere-$(AMSVER).zip ./*; cd ../; cd atmosphere-$(AMSVER); zip -r ../atmosphere-$(AMSVER).zip ./*; cd ../;
rm -r atmosphere-$(AMSVER) rm -r atmosphere-$(AMSVER)
mkdir out mkdir out
mv atmosphere-EXPERIMENTAL-$(AMSVER).zip out/atmosphere-EXPERIMENTAL-$(AMSVER).zip mv atmosphere-$(AMSVER).zip ../atmosphere-$(AMSVER).zip
mv atmosphere-$(AMSVER).zip out/atmosphere-$(AMSVER).zip
cp fusee/fusee-primary/fusee-primary.bin out/fusee-primary.bin
dist: dist-no-debug dist-debug: debug
$(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \ $(eval MAJORVER = $(shell grep 'define ATMOSPHERE_RELEASE_VERSION_MAJOR\b' libraries/libvapours/include/vapours/ams/ams_api_version.h \
| tr -s [:blank:] \ | tr -s [:blank:] \
| cut -d' ' -f3)) | cut -d' ' -f3))
@ -131,7 +134,6 @@ dist: dist-no-debug
cp exosphere/loader_stub/loader_stub.elf atmosphere-$(AMSVER)-debug/exosphere-loader-stub.elf cp exosphere/loader_stub/loader_stub.elf atmosphere-$(AMSVER)-debug/exosphere-loader-stub.elf
cp exosphere/program/program.elf atmosphere-$(AMSVER)-debug/exosphere-program.elf cp exosphere/program/program.elf atmosphere-$(AMSVER)-debug/exosphere-program.elf
cp exosphere/warmboot/warmboot.elf atmosphere-$(AMSVER)-debug/exosphere-warmboot.elf cp exosphere/warmboot/warmboot.elf atmosphere-$(AMSVER)-debug/exosphere-warmboot.elf
cp exosphere/mariko_fatal/mariko_fatal.elf atmosphere-$(AMSVER)-debug/exosphere-mariko-fatal.elf
cp exosphere/program/sc7fw/sc7fw.elf atmosphere-$(AMSVER)-debug/exosphere-sc7fw.elf cp exosphere/program/sc7fw/sc7fw.elf atmosphere-$(AMSVER)-debug/exosphere-sc7fw.elf
cp exosphere/program/rebootstub/rebootstub.elf atmosphere-$(AMSVER)-debug/exosphere-rebootstub.elf cp exosphere/program/rebootstub/rebootstub.elf atmosphere-$(AMSVER)-debug/exosphere-rebootstub.elf
cp mesosphere/kernel_ldr/kernel_ldr.elf atmosphere-$(AMSVER)-debug/kernel_ldr.elf cp mesosphere/kernel_ldr/kernel_ldr.elf atmosphere-$(AMSVER)-debug/kernel_ldr.elf
@ -141,16 +143,15 @@ dist: dist-no-debug
cp stratosphere/creport/creport.elf atmosphere-$(AMSVER)-debug/creport.elf cp stratosphere/creport/creport.elf atmosphere-$(AMSVER)-debug/creport.elf
cp stratosphere/dmnt/dmnt.elf atmosphere-$(AMSVER)-debug/dmnt.elf cp stratosphere/dmnt/dmnt.elf atmosphere-$(AMSVER)-debug/dmnt.elf
cp stratosphere/eclct.stub/eclct.stub.elf atmosphere-$(AMSVER)-debug/eclct.stub.elf cp stratosphere/eclct.stub/eclct.stub.elf atmosphere-$(AMSVER)-debug/eclct.stub.elf
cp stratosphere/erpt/erpt.elf atmosphere-$(AMSVER)-debug/erpt.elf
cp stratosphere/fatal/fatal.elf atmosphere-$(AMSVER)-debug/fatal.elf cp stratosphere/fatal/fatal.elf atmosphere-$(AMSVER)-debug/fatal.elf
cp stratosphere/jpegdec/jpegdec.elf atmosphere-$(AMSVER)-debug/jpegdec.elf
cp stratosphere/loader/loader.elf atmosphere-$(AMSVER)-debug/loader.elf cp stratosphere/loader/loader.elf atmosphere-$(AMSVER)-debug/loader.elf
cp stratosphere/ncm/ncm.elf atmosphere-$(AMSVER)-debug/ncm.elf
cp stratosphere/pgl/pgl.elf atmosphere-$(AMSVER)-debug/pgl.elf
cp stratosphere/pm/pm.elf atmosphere-$(AMSVER)-debug/pm.elf cp stratosphere/pm/pm.elf atmosphere-$(AMSVER)-debug/pm.elf
cp stratosphere/ro/ro.elf atmosphere-$(AMSVER)-debug/ro.elf cp stratosphere/ro/ro.elf atmosphere-$(AMSVER)-debug/ro.elf
cp stratosphere/sm/sm.elf atmosphere-$(AMSVER)-debug/sm.elf cp stratosphere/sm/sm.elf atmosphere-$(AMSVER)-debug/sm.elf
cp stratosphere/spl/spl.elf atmosphere-$(AMSVER)-debug/spl.elf cp stratosphere/spl/spl.elf atmosphere-$(AMSVER)-debug/spl.elf
cp stratosphere/erpt/erpt.elf atmosphere-$(AMSVER)-debug/erpt.elf
cp stratosphere/jpegdec/jpegdec.elf atmosphere-$(AMSVER)-debug/jpegdec.elf
cp stratosphere/pgl/pgl.elf atmosphere-$(AMSVER)-debug/pgl.elf
cp troposphere/daybreak/daybreak.elf atmosphere-$(AMSVER)-debug/daybreak.elf cp troposphere/daybreak/daybreak.elf atmosphere-$(AMSVER)-debug/daybreak.elf
cd atmosphere-$(AMSVER)-debug; zip -r ../atmosphere-$(AMSVER)-debug.zip ./*; cd ../; cd atmosphere-$(AMSVER)-debug; zip -r ../atmosphere-$(AMSVER)-debug.zip ./*; cd ../;
rm -r atmosphere-$(AMSVER)-debug rm -r atmosphere-$(AMSVER)-debug

View File

@ -9,20 +9,40 @@ Building Atmosphère is a very straightforward process that relies almost exclus
## Instructions ## Instructions
1. Follow the guide located [here](https://devkitpro.org/wiki/Getting_Started) to install and configure all the tools necessary for the build process. 1. Follow the guide located [here](https://devkitpro.org/wiki/Getting_Started) to install and configure all the tools necessary for the build process.
1. `sudo apt-get install gdebi-core`
1. `wget https://github.com/devkitPro/pacman/releases/download/v1.0.2/devkitpro-pacman.amd64.deb`
1. `sudo gdebi devkitpro-pacman.amd64.deb -y`
2. Install the following packages via (dkp-)pacman: 1. Sure that `zip` is installed. Instead `sudo apt-get install zip -y`
1. Install the following packages via `sudo dkp-pacman -S` :
+ `switch-dev` + `switch-dev`
+ `switch-glm` + `switch-glm`
+ `switch-libjpeg-turbo` + `switch-libjpeg-turbo`
+ `devkitARM` + `devkitARM`
+ `devkitarm-rules` + `devkitarm-rules`
+ `switch-glm`
3. (Optional) In order to build [sept](components/sept.md) the pycryptodome PyPi package is required, which can be installed by running `pip install pycryptodome` under the installed Python environment of your choice or by installing the complete zip package to support the `make dist` recipe. This is an optional step included for advanced users who have the ability to provide the necessary encryption/signing keys themselves. 1. Build and install master branch of libnx and needed extensions
4. It is, instead, possible to build [sept](components/sept.md) by providing previously encrypted/signed binaries distributed by official Atmosphère release packages. In order to do so, export the following variables in your current environment: + `git clone https://github.com/switchbrew/libnx.git`
+ `cd libnx`
+ `make install`
+ Unpack maked tar in `libnx/nx` to `opt/devkitpro/libnx`
+ `sudo apt install python-pip`
+ `sudo apt install python3-pip`
+ `pip install pycryptodome`
+ `pip install lz4==0.10.0`
1. It is, instead, possible to build [sept](components/sept.md) by providing previously encrypted/signed binaries distributed by official Atmosphère release packages. In order to do so, export the following variables in your current environment (`sudo nano /etc/environment`):
+ `SEPT_00_ENC_PATH` (must point to the `sept-secondary_00.enc` file) + `SEPT_00_ENC_PATH` (must point to the `sept-secondary_00.enc` file)
+ `SEPT_01_ENC_PATH` (must point to the `sept-secondary_01.enc` file) + `SEPT_01_ENC_PATH` (must point to the `sept-secondary_01.enc` file)
+ `SEPT_DEV_00_ENC_PATH` (must point to the `sept-secondary_dev_00.enc` file) + `SEPT_DEV_00_ENC_PATH` (must point to the `sept-secondary_dev_00.enc` file)
+ `SEPT_DEV_01_ENC_PATH` (must point to the `sept-secondary_dev_01.enc` file) + `SEPT_DEV_01_ENC_PATH` (must point to the `sept-secondary_dev_01.enc` file)
5. Finally, clone the Atmosphère repository and run `make` under its root directory. + `export SEPT_00_ENC_PATH="~/sept/sept-secondary_00.enc"`
+ `export SEPT_01_ENC_PATH="~/sept/sept-secondary_01.enc"`
+ `export SEPT_DEV_00_ENC_PATH="~/sept/sept-secondary_dev_00.enc"`
+ `export SEPT_DEV_01_ENC_PATH="~/sept/sept-secondary_dev_01.enc"`
1. Finally, clone the Atmosphère repository and run `make` under its root directory.

18
docs/cheat_sheet.txt Normal file
View File

@ -0,0 +1,18 @@
export SEPT_01_ENC_PATH="~/sept/sept-secondary_01.enc"
export SEPT_00_ENC_PATH="~/sept/sept-secondary_00.enc"
export SEPT_DEV_00_ENC_PATH="~/sept/sept-secondary_dev_00.enc"
export SEPT_DEV_01_ENC_PATH="~/sept/sept-secondary_dev_01.enc"
git remote add atmo https://github.com/Atmosphere-NX/Atmosphere.git
git fetch atmo
git pull atmo master
git checkout tags/0.15.0 -b 0.15.0
git clean -xdf
git remote add fspusb https://github.com/XorTroll/Atmosphere.git
git fetch fspusb
git cherry-pick <commit>
sudo nano ~/.bashrc - export

View File

@ -6,7 +6,7 @@
[subrepo] [subrepo]
remote = https://github.com/Atmosphere-NX/Atmosphere-libs remote = https://github.com/Atmosphere-NX/Atmosphere-libs
branch = master branch = master
commit = 49c1ace8906a967f2c92d369a0c66779b9cd225b commit = 2c3ccef17e9b267a5d9d232f1aba689f2c591b95
parent = 2b93bbd9ee174863dbf5c611c0d9d159fe9e6e31 parent = d2f48d5e36cb2ba4e8cc014238457bd75df81797
method = merge method = merge
cmdver = 0.4.1 cmdver = 0.4.1

View File

@ -65,8 +65,8 @@ namespace ams::mitm {
FsFile g_emummc_file; FsFile g_emummc_file;
/* Maintain exclusive access to the fusee-secondary archive. */ /* Maintain exclusive access to the fusee-secondary archive. */
FsFile g_secondary_file; // FsFile g_secondary_file;
FsFile g_sept_payload_file; // FsFile g_sept_payload_file;
constexpr inline bool IsHexadecimal(const char *str) { constexpr inline bool IsHexadecimal(const char *str) {
while (*str) { while (*str) {
@ -134,14 +134,14 @@ namespace ams::mitm {
/* NOTE: g_bis_key_file is intentionally not closed here. This prevents any other process from opening it. */ /* NOTE: g_bis_key_file is intentionally not closed here. This prevents any other process from opening it. */
} }
/* Open a reference to the fusee-secondary archive. */ // /* Open a reference to the fusee-secondary archive. */
/* As upcoming/current atmosphere releases will contain more than one zip which users much choose between, */ // /* As upcoming/current atmosphere releases will contain more than one zip which users much choose between, */
/* maintaining an open reference prevents cleanly the issue of "automatic" updaters selecting the incorrect */ // /* maintaining an open reference prevents cleanly the issue of "automatic" updaters selecting the incorrect */
/* zip, and encourages good updating hygiene -- atmosphere should not be updated on SD while HOS is alive. */ // /* zip, and encourages good updating hygiene -- atmosphere should not be updated on SD while HOS is alive. */
{ // {
R_ABORT_UNLESS(mitm::fs::OpenSdFile(std::addressof(g_secondary_file), "/atmosphere/fusee-secondary.bin", ams::fs::OpenMode_Read)); // R_ABORT_UNLESS(mitm::fs::OpenSdFile(std::addressof(g_secondary_file), "/atmosphere/fusee-secondary.bin", ams::fs::OpenMode_ReadWrite));
R_ABORT_UNLESS(mitm::fs::OpenSdFile(std::addressof(g_sept_payload_file), "/sept/payload.bin", ams::fs::OpenMode_Read)); // R_ABORT_UNLESS(mitm::fs::OpenSdFile(std::addressof(g_sept_payload_file), "/sept/payload.bin", ams::fs::OpenMode_ReadWrite));
} // }
} }
/* Initialization implementation */ /* Initialization implementation */

View File

@ -24,6 +24,7 @@
#include "ns_mitm/nsmitm_module.hpp" #include "ns_mitm/nsmitm_module.hpp"
#include "hid_mitm/hidmitm_module.hpp" #include "hid_mitm/hidmitm_module.hpp"
#include "sysupdater/sysupdater_module.hpp" #include "sysupdater/sysupdater_module.hpp"
// #include "fsp_usb/fspusb_module.hpp"
namespace ams::mitm { namespace ams::mitm {
@ -37,7 +38,7 @@ namespace ams::mitm {
ModuleId_NsMitm, ModuleId_NsMitm,
ModuleId_HidMitm, ModuleId_HidMitm,
ModuleId_Sysupdater, ModuleId_Sysupdater,
// ModuleId_FspUsb,
ModuleId_Count, ModuleId_Count,
}; };
@ -70,6 +71,7 @@ namespace ams::mitm {
GetModuleDefinition<ns::MitmModule>(), GetModuleDefinition<ns::MitmModule>(),
GetModuleDefinition<hid::MitmModule>(), GetModuleDefinition<hid::MitmModule>(),
GetModuleDefinition<sysupdater::MitmModule>(), GetModuleDefinition<sysupdater::MitmModule>(),
// GetModuleDefinition<fspusb::MitmModule>(),
}; };
} }

View File

@ -28,6 +28,8 @@ namespace ams::mitm::settings {
settings::FirmwareVersion g_firmware_version; settings::FirmwareVersion g_firmware_version;
settings::FirmwareVersion g_ams_firmware_version; settings::FirmwareVersion g_ams_firmware_version;
int g_kfr_firmware_version = 0;
void CacheFirmwareVersion() { void CacheFirmwareVersion() {
std::scoped_lock lk(g_firmware_version_lock); std::scoped_lock lk(g_firmware_version_lock);
@ -35,6 +37,30 @@ namespace ams::mitm::settings {
return; return;
} }
{
/* Mount the SD card. */
if (R_SUCCEEDED(fs::MountSdCard("sdmc"))) {
ams::fs::FileHandle file;
if (R_SUCCEEDED(fs::OpenFile(std::addressof(file), "sdmc:/switch/kefirupdater/version", fs::OpenMode_Read))) {
ON_SCOPE_EXIT { ams::fs::CloseFile(file); };
/* Get file size. */
s64 file_size;
R_ABORT_UNLESS(fs::GetFileSize(std::addressof(file_size), file));
/* Allocate cheat txt buffer. */
char *kef_txt = static_cast<char *>(std::malloc(file_size + 1));
ON_SCOPE_EXIT { std::free(kef_txt); };
/* Read cheats into buffer. */
R_ABORT_UNLESS(fs::ReadFile(file, 0, kef_txt, file_size));
kef_txt[file_size] = '\x00';
g_kfr_firmware_version = strtol(kef_txt, NULL, 10);
}
}
}
/* Mount firmware version data archive. */ /* Mount firmware version data archive. */
{ {
R_ABORT_UNLESS(ams::fs::MountSystemData("sysver", ncm::SystemDataId::SystemVersion)); R_ABORT_UNLESS(ams::fs::MountSystemData("sysver", ncm::SystemDataId::SystemVersion));
@ -56,20 +82,20 @@ namespace ams::mitm::settings {
const auto api_info = exosphere::GetApiInfo(); const auto api_info = exosphere::GetApiInfo();
const char emummc_char = emummc::IsActive() ? 'E' : 'S'; const char emummc_char = emummc::IsActive() ? 'E' : 'S';
/* NOTE: While Mesosphere is in experimental/opt-in, we will display it as part of the firmware. */ /* GCC complains about the following snprintf possibly truncating, but this is not a problem and has been carefully accounted for. */
const char mesosphere_char = svc::IsKernelMesosphere() ? 'M' : '0'; #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-truncation"
/* TODO: Remove separate display for mesosphere vs not mesosphere in Atmosphere 1.0.0. */ {
AMS_ABORT_UNLESS(api_info.GetMajorVersion() == 0);
/* NOTE: We have carefully accounted for the size of the string we print. */
/* No truncation occurs assuming two-digits for all version number components. */
char display_version[sizeof(g_ams_firmware_version.display_version)]; char display_version[sizeof(g_ams_firmware_version.display_version)];
if ( g_kfr_firmware_version != 0 )
std::snprintf(display_version, sizeof(display_version), "%s|AMS %c.%u.%u|%c", g_ams_firmware_version.display_version, mesosphere_char, api_info.GetMinorVersion(), api_info.GetMicroVersion(), emummc_char); std::snprintf(display_version, sizeof(display_version), "%s|KEF%d-%u.%u.%u|%c", g_ams_firmware_version.display_version, g_kfr_firmware_version, api_info.GetMajorVersion(), api_info.GetMinorVersion(), api_info.GetMicroVersion(), emummc_char);
else
std::snprintf(display_version, sizeof(display_version), "%s|KEF-%u.%u.%u|%c", g_ams_firmware_version.display_version, api_info.GetMajorVersion(), api_info.GetMinorVersion(), api_info.GetMicroVersion(), emummc_char);
std::memcpy(g_ams_firmware_version.display_version, display_version, sizeof(display_version)); std::memcpy(g_ams_firmware_version.display_version, display_version, sizeof(display_version));
} }
#pragma GCC diagnostic pop
}
g_cached_firmware_version = true; g_cached_firmware_version = true;
} }

View File

@ -50,15 +50,15 @@ namespace ams::ldr {
} }
bool IsDevelopmentForAntiDowngradeCheck() { bool IsDevelopmentForAntiDowngradeCheck() {
return g_development_for_anti_downgrade_check; return true;
} }
bool IsDevelopmentForAcidSignatureCheck() { bool IsDevelopmentForAcidSignatureCheck() {
return g_development_for_acid_signature_check; return false;
} }
bool IsEnabledProgramVerification() { bool IsEnabledProgramVerification() {
return g_enabled_program_verification; return false;
} }
} }

View File

@ -132,7 +132,7 @@ namespace ams::ldr {
const bool is_signature_valid = crypto::VerifyRsa2048PssSha256(sig, sig_size, mod, mod_size, exp, exp_size, msg, msg_size); const bool is_signature_valid = crypto::VerifyRsa2048PssSha256(sig, sig_size, mod, mod_size, exp, exp_size, msg, msg_size);
R_UNLESS(is_signature_valid || !IsEnabledProgramVerification(), ResultInvalidAcidSignature()); R_UNLESS(is_signature_valid || !IsEnabledProgramVerification(), ResultInvalidAcidSignature());
meta->check_verification_data = is_signature_valid; meta->check_verification_data = false;
return ResultSuccess(); return ResultSuccess();
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -62,8 +62,8 @@ namespace dbk {
/* Update install state. */ /* Update install state. */
char g_update_path[FS_MAX_PATH]; char g_update_path[FS_MAX_PATH];
bool g_reset_to_factory = false; bool g_reset_to_factory = false;
bool g_exfat_supported = false; bool g_exfat_supported = true;
bool g_use_exfat = false; bool g_use_exfat = true;
constexpr u32 MaxTapMovement = 20; constexpr u32 MaxTapMovement = 20;
@ -881,7 +881,7 @@ namespace dbk {
/* Check if exfat is supported. */ /* Check if exfat is supported. */
g_exfat_supported = m_update_info.exfat_supported && R_SUCCEEDED(m_validation_info.exfat_result); g_exfat_supported = m_update_info.exfat_supported && R_SUCCEEDED(m_validation_info.exfat_result);
if (!g_exfat_supported) { if (!g_exfat_supported) {
g_use_exfat = false; g_use_exfat = true;
} }
/* Warn the user if they're updating with exFAT supposed to be supported but not present/corrupted. */ /* Warn the user if they're updating with exFAT supposed to be supported but not present/corrupted. */
@ -941,11 +941,8 @@ namespace dbk {
break; break;
} }
if (g_exfat_supported) {
ChangeMenu(std::make_shared<ChooseExfatMenu>(g_current_menu));
} else {
ChangeMenu(std::make_shared<WarningMenu>(g_current_menu, std::make_shared<InstallUpdateMenu>(g_current_menu), "Ready to begin update installation", "Are you sure you want to proceed?")); ChangeMenu(std::make_shared<WarningMenu>(g_current_menu, std::make_shared<InstallUpdateMenu>(g_current_menu), "Ready to begin update installation", "Are you sure you want to proceed?"));
}
} }
this->UpdateButtons(); this->UpdateButtons();
@ -997,7 +994,7 @@ namespace dbk {
if (const Button *activated_button = this->GetActivatedButton(); activated_button != nullptr) { if (const Button *activated_button = this->GetActivatedButton(); activated_button != nullptr) {
switch (activated_button->id) { switch (activated_button->id) {
case Fat32ButtonId: case Fat32ButtonId:
g_use_exfat = false; g_use_exfat = true;
break; break;
case ExFatButtonId: case ExFatButtonId:
g_use_exfat = true; g_use_exfat = true;