diff --git a/Launcher/steam-frame-install.sh b/Launcher/steam-frame-install.sh index fd33ace..eddaa7f 100755 --- a/Launcher/steam-frame-install.sh +++ b/Launcher/steam-frame-install.sh @@ -160,6 +160,22 @@ fi [[ "$jobs" =~ ^[1-9][0-9]*$ ]] || fail "--jobs must be a positive number" note "$jobs parallel compiles" +# Room for the build. A first one (the toolchain, Dawn's source and build, the game's build) takes +# about 20 GB; later ones reuse Dawn. Extracting a disc image takes about 5 GB more, plus the +# archive's size while one is unpacked. Running out halfway is worse than stopping here. +need_gb=20 +[[ -f "$work_dir/dawn/package/aurora-dawn.json" ]] && need_gb=5 +if [[ -n "$disc" && -f "$disc" && ! -f "$work_dir/disc/sys/main.dol" ]]; then + need_gb=$(( need_gb + 5 + $(du -k "$disc" | cut -f1) / 1024 / 1024 )) +fi +free_gb=$(( $(df -Pk "$work_dir" | awk 'NR == 2 { print $4 }') / 1024 / 1024 )) +if (( free_gb < need_gb )); then + fail "$work_dir has $free_gb GB free; this run needs about $need_gb GB. Free some space, or put + the work folder on a bigger drive with --work-dir (on the Frame, a mounted card such as + --work-dir /run/media/${USER:-$(id -un)}//wiicompiled-frame)." +fi +note "$free_gb GB free in $work_dir" + # --------------------------------------------------------------------------------------------- # The source: the tree this script is in, an explicit --source, or a release kept in the work dir. if [[ -z "$source_dir" && -z "$release" && -n "$script_dir" && -f "$script_dir/../runtime/CMakeLists.txt" ]]; then @@ -474,11 +490,20 @@ EOF ) if [[ "$has_disc" != yes ]]; then [[ -n "$disc_dir" ]] || fail "the Frame has no disc at $frame_disc yet: pass --disc" - on_frame "$frame_disc_path" <<'EOF' || fail "cannot write $frame_disc on the Frame. SteamOS's system is read-only: - pick a folder in the home folder (the default, wiicompiled/disc) or on a mounted card." + # The folder must be writable, and have room for the disc (prints its free space in KB). + frame_free_kb=$(on_frame "$frame_disc_path" <<'EOF' [[ "$1" = /* ]] && d=$1 || d="$HOME/$1" -mkdir -p "$(dirname "$d")" 2>/dev/null && [[ -w "$(dirname "$d")" ]] && rm -rf "$d.partial" +mkdir -p "$(dirname "$d")" 2>/dev/null && [[ -w "$(dirname "$d")" ]] && rm -rf "$d.partial" && + df -Pk "$(dirname "$d")" | awk 'NR == 2 { print $4 }' EOF + ) || fail "cannot write $frame_disc on the Frame. SteamOS's system is read-only: pick a folder in + the home folder (the default, wiicompiled/disc) or on a mounted card." + disc_kb=$(du -sk "$disc_dir" | cut -f1) + if (( frame_free_kb < disc_kb + 1024 * 1024 )); then + fail "the Frame has $(( frame_free_kb / 1024 / 1024 )) GB free where the disc goes and the disc + needs $(( disc_kb / 1024 / 1024 + 1 )) GB. Free some space, or put it on a mounted card with + --frame-disc /run/media///wiicompiled-disc." + fi note "copying the extracted disc to $frame_disc (a few GB)" copy_to_frame "$disc_dir" "$frame_disc_path.partial" on_frame "$frame_disc_path" <<'EOF' diff --git a/README.md b/README.md index bf4e309..4f7bd49 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,8 @@ curl -fsSL https://raw.githubusercontent.com/mitch030504/Wiicompiled_VR_Frame/op [Frame Control](https://github.com/saphid/frame-control), pass `--frame frame` instead: its SSH key answers to that name. - Everything it builds lives in `~/wiicompiled-frame` (`--work-dir` to change that): the toolchain, - Dawn, the source, the extracted disc and the build log, `build.log`. + Dawn, the source, the extracted disc and the build log, `build.log`. A first build needs about + 20 GB there, and the script checks for it before starting. - It runs as many compiles at once as fit in memory (a quarter of your memory in GB). If the machine still freezes, run it again with a lower `--jobs`, such as `--jobs 2`. - If it stops for any reason, the same command picks up where it left off. @@ -100,7 +101,7 @@ Everything it puts on the Frame is in your home folder, where it survives SteamO | Where | What | | --- | --- | | `~/devkit-game/WiiCompiled/` | the game | -| `~/wiicompiled/disc/` | your extracted disc (`--frame-disc` puts it elsewhere in your home folder or on a mounted card) | +| `~/wiicompiled/disc/` | your extracted disc, about 4.5 GB (`--frame-disc` puts it elsewhere in your home folder or on the SD card, `/run/media/steamos//...`) | | `~/.local/share/WiiCompiled/` | `Config.toml`, saves and logs, written by the game itself | | Steam's library | the **WiiCompiled** shortcut, made through Valve's devkit tools in `~/devkit-utils` | @@ -312,21 +313,26 @@ is open. ## Other ways to build -**On the Frame itself.** This needs podman, which has to come with SteamOS: its system is read-only, -and anything installed into it with `pacman` (after switching the read-only mode off) is gone at the -next update, so don't. The script checks and says so if it is missing; then build on a PC as above. -If it is there, run the script over SSH (`ssh steamos@`) or in a Desktop Mode terminal: +**On the Frame itself.** SteamOS on the Frame (0.4.3, September 2026) comes with podman 5.5, set +up for rootless containers with its storage in the home folder, so the install script runs there +natively, with no emulation and nothing installed into the read-only system. Don't add tools to +SteamOS with `pacman`: that means switching the read-only mode off, and the next update undoes it. +The script checks for podman and stops with a pointer to building on a PC if an image lacks it. + +The first build needs about 20 GB in its work folder, and podman's storage +(`~/.local/share/containers`) grows by about 1.5 GB for the build container. If the home folder is +short of that (the script checks), put the work folder on the SD card, which SteamOS mounts under +`/run/media//` (on the Frame the user is `steamos`). Over SSH +(`ssh steamos@`) or in a Desktop Mode terminal: ```bash curl -fsSL https://raw.githubusercontent.com/mitch030504/Wiicompiled_VR_Frame/openxr-work/Launcher/steam-frame-install.sh \ - | bash -s -- --disc "/path/to/Mario Kart Wii.wbfs" --frame local + | bash -s -- --disc "/path/to/Mario Kart Wii.wbfs" --frame local --work-dir /run/media/steamos//wiicompiled-frame ``` -It is native ARM64, so no emulation, but the Frame has less memory and cooling than a PC; keep it -on its charger. Everything stays in your home folder: the container image and its packages in -podman's storage (`~/.local/share/containers`), the toolchain, Dawn and the build in -`~/wiicompiled-frame` (about 20 GB), and the game reads the disc straight from -`~/wiicompiled-frame/disc`. By hand, the +Leave out `--work-dir` to keep it in `~/wiicompiled-frame`. With 15 GB of memory the Frame runs three +compiles at once; it has less cooling than a PC, so keep it on its charger. The game then reads the +disc straight from the work folder's `disc`. By hand, the steps under [Building by hand](#building-by-hand) work the same in a container started without `--platform linux/arm64`, with `nodtool-linux-aarch64` in place of `nodtool-linux-x86_64`.