From 5e9ede09a19361c06c323e24a9843cd67424e71e Mon Sep 17 00:00:00 2001 From: niklascfw Date: Tue, 14 Jul 2026 23:03:52 +0200 Subject: [PATCH] Switch Atmosphere clone to Atmosphere-Pro and add exosphere-only build script. Use the boot-storage branch required for Horizon OC exosphere patches, and provide build-exosphere.sh for compiling just exosphere.bin without a full project build. --- build-exosphere.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++ build.sh | 15 ++++--------- 2 files changed, 56 insertions(+), 11 deletions(-) create mode 100755 build-exosphere.sh mode change 100644 => 100755 build.sh diff --git a/build-exosphere.sh b/build-exosphere.sh new file mode 100755 index 00000000..1a2f557d --- /dev/null +++ b/build-exosphere.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +ROOT_DIR="$(cd "$(dirname "$0")" && pwd)" +DIST_DIR="$ROOT_DIR/dist" + +ATMOSPHERE_DIR="$ROOT_DIR/build/atmosphere" +ATMOSPHERE_URL="https://github.com/NaGaa95/Atmosphere-Pro.git" +ATMOSPHERE_BRANCH="boot-storage" + +EXO_SRC="$ROOT_DIR/Source/Atmosphere-Patches" +EXO_DEST="$ATMOSPHERE_DIR/exosphere/program/source/smc" +LIBEXO_DEST="$ATMOSPHERE_DIR/libraries/libexosphere/include/exosphere/secmon" +EXO_OUT="$ATMOSPHERE_DIR/exosphere/out/nintendo_nx_arm64_armv8a/release/exosphere.bin" + +if command -v nproc >/dev/null 2>&1; then + CORES="$(nproc --all)" +else + CORES="$(sysctl -n hw.ncpu)" +fi + +echo "CORES: $CORES" + +mkdir -p "$ROOT_DIR/build" + +if [ ! -d "$ATMOSPHERE_DIR" ]; then + echo + echo "*** Cloning Atmosphere-Pro ***" + git clone --depth=1 --single-branch -b "$ATMOSPHERE_BRANCH" "$ATMOSPHERE_URL" "$ATMOSPHERE_DIR" +fi + +echo +echo "*** Patching exosphere ***" +cp -v "$EXO_SRC/secmon_emc_access_table_data.inc" "$EXO_DEST/" +cp -v "$EXO_SRC/secmon_define_emc_access_table.inc" "$EXO_DEST/" +cp -v "$EXO_SRC/secmon_rtc_pmc_access_table_data.inc" "$EXO_DEST/" +cp -v "$EXO_SRC/secmon_define_rtc_pmc_access_table.inc" "$EXO_DEST/" +cp -v "$EXO_SRC/secmon_smc_register_access.cpp" "$EXO_DEST/" +cp -v "$EXO_SRC/secmon_smc_handler.cpp" "$EXO_DEST/" +cp -v "$EXO_SRC/secmon_memory_layout.hpp" "$LIBEXO_DEST/" + +echo +echo "*** Compiling exosphere ***" +cd "$ATMOSPHERE_DIR/exosphere" || exit 1 +make -j"$CORES" +cd "$ROOT_DIR" || exit 1 + +mkdir -p "$DIST_DIR/atmosphere" +cp -v "$EXO_OUT" "$DIST_DIR/atmosphere/exosphere.bin" + +echo +echo "*** Done: $EXO_OUT ***" +echo "*** Copied to: $DIST_DIR/atmosphere/exosphere.bin ***" diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index e17249ab..c53b5ab8 --- a/build.sh +++ b/build.sh @@ -45,20 +45,13 @@ SRC="Source/Atmosphere/stratosphere/loader/" mkdir -p "build" ATMOSPHERE_DIR="build/atmosphere" -ATMOSPHERE_URL="https://github.com/Atmosphere-NX/Atmosphere.git" +ATMOSPHERE_URL="https://github.com/NaGaa95/Atmosphere-Pro.git" +ATMOSPHERE_BRANCH="boot-storage" if [ ! -d "$ATMOSPHERE_DIR" ]; then echo - echo "*** Cloning atmosphere ***" - git clone "$ATMOSPHERE_URL" "$ATMOSPHERE_DIR" - - cd "$ATMOSPHERE_DIR" - - git fetch --tags --quiet - LATEST_TAG=$(git tag --sort=-version:refname | head -n1) - git checkout -q -b build "$LATEST_TAG" - - cd "$ROOT_DIR" + echo "*** Cloning Atmosphere-Pro ***" + git clone --depth=1 --single-branch -b "$ATMOSPHERE_BRANCH" "$ATMOSPHERE_URL" "$ATMOSPHERE_DIR" fi DEST="build/atmosphere/stratosphere/loader/"