Skip to content

Play your Steam library's Windows games on a jailbroken PS5.

C++

Ship the data layout with 0.6.0 and document it

Leonardo Lobato2ee3540f0116
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6a6ebb3..dce07eb 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -22,7 +22,7 @@ This guide covers setup, builds, tests, running on a console, and how to change
1. Check the [compatibility list](COMPATIBILITY.md). If the game is there, report only what is new.
2. Play the game from Playden or from its tile on the Home screen.
3. If the game did not work, start Playden once more. When it starts, Playden copies the game's newest log to
- `logs/title-<TITLE>.log`.
+ `/data/playden/logs/title-<TITLE>.log`.
4. Collect the logs on your computer (Python 3, no packages needed). The PS5 must run an FTP server on port 2120,
such as zftpd:
@@ -165,7 +165,9 @@ documented end to end yet.
### Logs
-Playden writes its logs to `/data/homebrew/FAKE77031/logs/` (`runtime.log`, `launch.log`, `cloud.log` and others).
+Playden writes its logs to `/data/playden/logs/` (`runtime.log`, `launch.log`, `cloud.log` and others). The first
+startup lines (`native-startup.log`), written before the root grant, stay in the app's own `logs/` folder. User data
+is in `/data/playden/user/` and games are in `/data/playden-games/`.
Game bottles are private to their titles. When Playden starts, it copies the newest game session report to
`logs/title-<TITLE>.log`.
diff --git a/README.md b/README.md
index a4a2a98..7ea5509 100644
--- a/README.md
+++ b/README.md
@@ -121,11 +121,20 @@ the `playden-ps5-<version>` folder, which holds `tools/`.
python3 tools/console_title_deploy.py --host <PS5 IP> deploy --install FAKE77031 --backup backups/<name>
```
- Copying the `FAKE77031` folder by hand with an FTP client or the web file manager also works, but then make
- `/data/homebrew`, the `FAKE77031` folder and its `logs` and `playden-data` folders writable by everyone
- (`chmod 777`). Playden writes there as the app's own user, and a folder created over FTP is usually 755: Playden
- then stays on its splash screen and writes no logs, can't install games ("cannot create install folder"), or can't
- finish preparing one ("package staging and destination must support one atomic rename").
+ Copying the `FAKE77031` folder by hand with an FTP client or the web file manager also works. You do not need to
+ `chmod` any folder: Playden checks the folders it writes to and fixes their permissions itself before it writes.
+ If it can't fix one, it names that folder.
+
+ From 0.6.0, Playden keeps its data outside the app folder and moves it there once, at startup:
+
+ - Your sign-in, settings and other user data: `/data/playden/user/`.
+ - Logs: `/data/playden/logs/`. The first startup lines, written before Playden gets its root access,
+ stay in `logs/` in the app folder.
+ - Downloaded games: `/data/playden-games/`. Each game's Windows folder, with its saves, stays under
+ `/data/playden/games/` (see [Saves and game configs over FTP](#saves-and-game-configs-over-ftp)).
+
+ The app folder keeps empty `playden-data` and `logs` folders, and a `MOVED.txt` in each old place says where
+ the data went.
2. Wait about 10 seconds. ShadowMountPlus adds the Playden tile to the Home screen.
3. Install the runtime kit (next section).
4. Start Playden and sign in to Steam.
@@ -271,7 +280,7 @@ Every test helps, including games that work. To report one:
```
It lists the games that have a log, the most recently run first, and asks which one to collect. The script
- reads only Playden's logs, never your Steam sign-in. It hides your Steam account name and
+ reads only Playden's logs (`/data/playden/logs`), never your Steam sign-in. It hides your Steam account name and
SteamIDs, and writes a zip with a summary of your firmware and kit versions.
3. [Open a game test report](../../issues/new?template=test-report.yml) and attach the zip. See a
[sample report](docs/sample-test-report.md) for what to fill in.
diff --git a/docs/community-recipes.md b/docs/community-recipes.md
index 43f8cc5..3fdc8dc 100644
--- a/docs/community-recipes.md
+++ b/docs/community-recipes.md
@@ -12,7 +12,7 @@ that say who tested it, where and how well. Playden reads the recipe part with
overrides, other rows).
2. Set the game's rating and note under **Compatibility and note**.
3. In **Game settings > Advanced**, choose **Export as recipe**. Playden writes
- `recipe-<app id>.json` next to its logs (`/app0/logs` on the console, `logs/`
+ `recipe-<app id>.json` next to its logs (`/data/playden/logs` on the console, `logs/`
in the data folder on a Mac).
4. Fill in `community.author`, check the file, and send it as a pull request to
Playden's repository.
diff --git a/src/homebrew/controller.cpp b/src/homebrew/controller.cpp
index 8224f74..cfb5fdd 100644
--- a/src/homebrew/controller.cpp
+++ b/src/homebrew/controller.cpp
@@ -1062,7 +1062,7 @@ void Controller::TickRuntime() {
play_queued_.empty() && !sync_before_play_.count(id);
if (const auto note = play_notes_.find(id); note != play_notes_.end() && !launching) game.play_detail = note->second;
if (sync_before_play_.count(id)) game.play_status = "Checking saves…";
- // Play's own work before the launch (a game moved in 0.5 is republished first).
+ // Play's own work before the launch (a game moved in 0.6 is republished first).
if (const auto progress = snapshot.play_progress.find(id); progress != snapshot.play_progress.end()) {
game.play_status = progress->second; game.can_play = false; game.can_prepare = false;
}
diff --git a/src/homebrew/ps5.cpp b/src/homebrew/ps5.cpp
index 4dfd71f..bc9132b 100644
--- a/src/homebrew/ps5.cpp
+++ b/src/homebrew/ps5.cpp
@@ -188,7 +188,7 @@ int main() {
}
const auto& paths = native_access.paths;
title_root = paths.title_root;
- // After the grant, user data, logs and games live outside the app folder (0.5 layout).
+ // After the grant, user data, logs and games live outside the app folder (0.6 layout).
log_root = playden::ps5::EffectiveLogRoot(paths);
const std::string user_root = playden::ps5::EffectiveUserRoot(paths);
// Startup checkpoints: a launch that never shows its first frame can be told
@@ -344,7 +344,7 @@ int main() {
update_config.kits_root = "/data/playden/kits";
update_config.appmeta_root = std::string("/user/appmeta/") + PLAYDEN_PS5_TITLE_ID;
update_config.registered_app_root = std::string("/user/app/") + PLAYDEN_PS5_TITLE_ID;
- update_config.layout_journal = "/data/playden/runtime-state/layout-0.5.json";
+ update_config.layout_journal = "/data/playden/runtime-state/layout-0.6.json";
update_config.current = playden::update::CurrentVersion();
update_config.fetch = [&update_http](const playden::steam::HttpRequest& request, const std::atomic<bool>& cancel) {
return update_http.Perform(request, cancel);
diff --git a/src/homebrew/runtime_host.cpp b/src/homebrew/runtime_host.cpp
index a55b632..cae1012 100644
--- a/src/homebrew/runtime_host.cpp
+++ b/src/homebrew/runtime_host.cpp
@@ -316,7 +316,7 @@ struct RuntimeHost::Composition {
std::unique_ptr<rt::LaunchService> launch;
// Last worker preflight per install, with its time, for Handoff.
std::map<std::string, std::pair<rt::LaunchPreflight, std::int64_t>> preflights;
- // The old and new games root while the 0.5 games move is unfinished.
+ // The old and new games root while the 0.6 games move is unfinished.
std::optional<std::pair<std::string, std::string>> games_move;
};
@@ -1406,17 +1406,17 @@ void RuntimeHost::RunPlay(Composition& c, std::uint32_t app_id) {
}
std::string settings;
if (!record->moved_from.empty()) {
- // Its folder moved in 0.5: the title starts only once its publication names the new one.
+ // Its folder moved in 0.6: the title starts only once its publication names the new one.
if (!idle) {
auto busy = MaintenanceRefusal(c, *record);
- settings = "This game needs an update for Playden 0.5 first: " + (busy.empty() ? "Close the game first." : busy);
+ settings = "This game needs an update for Playden 0.6 first: " + (busy.empty() ? "Close the game first." : busy);
} else {
Publish([&](RuntimeSnapshot& s) { s.play_progress[app_id] = kPlayUpdatingForLayout; });
bool again = false;
settings = RepublishSettings(c, *record, nullptr, true, &again);
Publish([&](RuntimeSnapshot& s) { s.play_progress.erase(app_id); });
if (!settings.empty())
- settings = "This game could not be updated for Playden 0.5: " + settings + (again ? kRecreateHint : "");
+ settings = "This game could not be updated for Playden 0.6: " + settings + (again ? kRecreateHint : "");
Log("play moved app=" + std::to_string(app_id) + " " + (settings.empty() ? "republished" : settings));
}
} else if (idle) {
@@ -1897,7 +1897,7 @@ std::string RuntimeHost::RunPrepare(Composition& c, const RuntimePrepareRequest&
if (refreshed.state != rt::PackageActionState::kComplete) return refreshed.message;
changed = true;
}
- // A game whose folder moved in 0.5 is published again for the new folder first, and an
+ // A game whose folder moved in 0.6 is published again for the new folder first, and an
// owned publication again as unowned. A moved game whose publication can't be redone
// (settings older than its title, a recipe Playden no longer has) stays as it is: the way
// out is the player's confirmed choice.
@@ -2876,7 +2876,7 @@ void RuntimeHost::Run() {
Log("startup bottle profiles settled=" + std::to_string(settled) + " ms=" +
std::to_string(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - began).count()));
}
- // Games whose folder moved with the games root (0.5) start from Home only once their
+ // Games whose folder moved with the games root (0.6) start from Home only once their
// publication names the new folder: republished now, busy titles wait for Play.
// So are games published owned while the kit admits unowned folders (folders opened for
// mods). The Steam account is not known yet, so the emulator's files wait for Play.
@@ -3103,7 +3103,7 @@ void RuntimeHost::Run() {
s.refusals.erase(request.app_id);
});
refusal = RunPrepare(*composition, request, &awaiting);
- // A resumed publication of a moved game may have been the last the 0.5 move waited for.
+ // A resumed publication of a moved game may have been the last the 0.6 move waited for.
FinishGamesMove(*composition);
// A game prepared again gets back the saves it kept when it was uninstalled,
// before it can first be started (from Home, while it waits for registration).
diff --git a/src/homebrew/runtime_host.hpp b/src/homebrew/runtime_host.hpp
index e3bc643..dc6588c 100644
--- a/src/homebrew/runtime_host.hpp
+++ b/src/homebrew/runtime_host.hpp
@@ -121,7 +121,7 @@ struct RuntimeHostConfig {
std::function<std::int64_t()> now_ms;
// How long a started title may take to report its session before Play gives up.
std::int64_t launch_evidence_wait_ms = 60000;
- // The 0.5 layout's games move (runtime/layout_migration.h), finished on the worker.
+ // The 0.6 layout's games move (runtime/layout_migration.h), finished on the worker.
// moved_games_root: the old and new games root (console paths) while the journal is at
// "games-moved"; nothing otherwise. finish_games_move: called once every moved Ready game is
// republished; false keeps the move pending for the next start. Empty: LoadLayoutJournal and
@@ -262,11 +262,11 @@ struct RuntimeSnapshot {
// Bytes in each game's Windows user folders (installed and kept), from the latest MeasureSaves.
std::map<std::uint32_t, std::uint64_t> save_bytes;
// What Play does before the launch is requested, per Steam app, while it runs: a game whose
- // folder moved in Playden 0.5 is republished first (kPlayUpdatingForLayout).
+ // folder moved in Playden 0.6 is republished first (kPlayUpdatingForLayout).
std::map<std::uint32_t, std::string> play_progress;
};
-inline constexpr const char* kPlayUpdatingForLayout = "Updating this game for Playden 0.5…";
+inline constexpr const char* kPlayUpdatingForLayout = "Updating this game for Playden 0.6…";
// A downloaded game to prepare. The game files stay at install_path.
struct RuntimePrepareRequest {
@@ -363,10 +363,10 @@ class RuntimeHost {
// RepublishSettings without the upgrade's fallback.
std::string PublishSavedSettings(Composition& composition, const runtime::RuntimeInstall& record,
bool* published, bool steam_account_known, bool* prepare_again);
- // A Ready game published owned (schema 2, before 0.5 or by a kit before 0.10) while the kit
+ // A Ready game published owned (schema 2, before 0.6 or by a kit before 0.10) while the kit
// admits unowned game folders: published again as unowned, so folders the player opened pass.
bool NeedsUnownedPublication(const Composition& composition, const runtime::RuntimeInstall& record);
- // The 0.5 games move: rewrites the records and Cloud indexes under the old games root at startup,
+ // The 0.6 games move: rewrites the records and Cloud indexes under the old games root at startup,
// and marks the move done once no moved Ready game is left to republish.
void MoveGameRecords(Composition& composition);
void FinishGamesMove(Composition& composition);
diff --git a/src/platform/ps5/native_access.cpp b/src/platform/ps5/native_access.cpp
index e59bafc..ec2c7f2 100644
--- a/src/platform/ps5/native_access.cpp
+++ b/src/platform/ps5/native_access.cpp
@@ -27,7 +27,7 @@ NativePaths PathsAt(const std::string& root) {
}
// Where Playden will keep its state: the stubs must be writable (or creatable).
-// Granted starts keep it outside the app folder (0.5 layout), so there the stubs
+// Granted starts keep it outside the app folder (0.6 layout), so there the stubs
// only need to be readable folders: over FTP they are root's and 0755.
enum class StubState { kWritable, kReadable };
diff --git a/src/platform/ps5/native_access.h b/src/platform/ps5/native_access.h
index 3c11822..e9432c7 100644
--- a/src/platform/ps5/native_access.h
+++ b/src/platform/ps5/native_access.h
@@ -53,7 +53,7 @@ struct NativeAccessOptions {
// playden-data/logs folders. Granted starts need the stubs only as readable
// folders; a launcher without the grant keeps its state there, so they must be
// writable. After the grant, the
-// 0.5 layout move fills user_root, user_log_root and games_root (each at the
+// 0.6 layout move fills user_root, user_log_root and games_root (each at the
// new place once its step has moved, else the old in-app one). Not granted:
// they stay empty and the package paths are used.
struct NativePaths {
diff --git a/src/platform/ps5/native_startup.cpp b/src/platform/ps5/native_startup.cpp
index f13a704..80f0dbe 100644
--- a/src/platform/ps5/native_startup.cpp
+++ b/src/platform/ps5/native_startup.cpp
@@ -153,7 +153,7 @@ NativeAccessResult PrepareNativeStartup(const std::string& title_id) {
auto result = bootstrap.Prepare();
if (!result.runtime_ready && !context.grant_diagnostic.empty())
result.error += "; " + context.grant_diagnostic;
- // The 0.5 layout: user data, logs and games leave the app folder once. Still
+ // The 0.6 layout: user data, logs and games leave the app folder once. Still
// single-threaded here, so the short root raises (the games rename, renames out of
// root-owned stub folders, creating /data/playden-games) affect no other thread.
std::vector<std::string> layout_lines;
diff --git a/src/runtime/game_install.h b/src/runtime/game_install.h
index 18406d0..300331c 100644
--- a/src/runtime/game_install.h
+++ b/src/runtime/game_install.h
@@ -75,7 +75,7 @@ struct RuntimeInstall {
std::vector<RuntimeArtifactIdentity> artifacts;
std::optional<RuntimeFailure> last_failure;
std::optional<PreparationJournal> journal;
- // Set when the game folder moved with the games root (the 0.5 layout): its earlier
+ // Set when the game folder moved with the games root (the 0.6 layout): its earlier
// install_path, which the committed publication still names. The game needs a
// republication against install_path; a committed publication clears it. Stored only
// when set, so older readers (which ignore unknown keys) are unaffected.
diff --git a/src/runtime/layout_migration.cpp b/src/runtime/layout_migration.cpp
index f0dd438..0ac8392 100644
--- a/src/runtime/layout_migration.cpp
+++ b/src/runtime/layout_migration.cpp
@@ -260,7 +260,7 @@ bool MoveEntries(const LayoutOps& ops, const fs::path& from, const fs::path& to,
}
std::string MovedText(const fs::path& to) {
- return "Playden 0.5 moved this folder's contents to " + to.string() + "\n";
+ return "Playden 0.6 moved this folder's contents to " + to.string() + "\n";
}
} // namespace
diff --git a/src/runtime/layout_migration.h b/src/runtime/layout_migration.h
index 4dbec63..39b0b29 100644
--- a/src/runtime/layout_migration.h
+++ b/src/runtime/layout_migration.h
@@ -1,5 +1,5 @@
#pragma once
-// layout_migration.h - The 0.5.0 one-time move of user data, logs and games out of the app folder.
+// layout_migration.h - The 0.6.0 one-time move of user data, logs and games out of the app folder.
// Copyright (c) 2026 Playden contributors
// SPDX-License-Identifier: MIT
#include <filesystem>
@@ -31,7 +31,7 @@ struct LayoutOps {
std::function<std::optional<bool>(const std::string& title_id)> title_running;
};
-inline constexpr const char* kLayoutJournal = "layout-0.5.json";
+inline constexpr const char* kLayoutJournal = "layout-0.6.json";
// Pending-journal postponements of the games step before the user is told.
inline constexpr int kLayoutPostponeNoticeAfter = 3;
@@ -72,7 +72,7 @@ struct RevertResult {
std::string error;
};
-// The reverse move, for a restore below 0.5.0. Entries that would replace an
+// The reverse move, for a restore below 0.6.0. Entries that would replace an
// existing one stay in the new place, and the journal is kept so it can be retried.
RevertResult RevertLayout(const LayoutPaths& paths, const LayoutOps& ops);
diff --git a/src/runtime/settings_publication.h b/src/runtime/settings_publication.h
index f71611d..9eccb0e 100644
--- a/src/runtime/settings_publication.h
+++ b/src/runtime/settings_publication.h
@@ -26,7 +26,7 @@ inline void FillProfilePublication(const SettingsLaunchPlan& plan, ProfilePublic
}
}
-// A game folder that moved as a whole (the 0.5 layout, RuntimeInstall::moved_from): its
+// A game folder that moved as a whole (the 0.6 layout, RuntimeInstall::moved_from): its
// committed publication names `from`, the install record names `to`. The publication that
// replaces it checks the old one with the game folder at `to`.
struct GameRootMove {
diff --git a/src/steam/install_volumes.h b/src/steam/install_volumes.h
index 76499c5..6f0fffc 100644
--- a/src/steam/install_volumes.h
+++ b/src/steam/install_volumes.h
@@ -35,7 +35,7 @@ std::vector<InstallVolume> DiscoverInstallVolumes(const std::vector<VolumeCandid
const AsRoot& as_root = {});
// Candidate drives for the PS5 title: console storage, then extended storage and
-// USB drives. Console storage is games_root (after the grant, the 0.5 layout's
+// USB drives. Console storage is games_root (after the grant, the 0.6 layout's
// /data/playden-games), or title_root/games when it is empty.
std::vector<VolumeCandidate> ConsoleVolumeCandidates(const std::string& title_root = "/app0",
const std::string& games_root = {});
diff --git a/src/update/update_service.cpp b/src/update/update_service.cpp
index 7a2656a..542a3cc 100644
--- a/src/update/update_service.cpp
+++ b/src/update/update_service.cpp
@@ -289,18 +289,18 @@ std::optional<UpdateService::Backup> UpdateService::LatestBackup() const {
}
namespace {
-// 0.5.0 moved user data, logs and games out of the app folder; an older version finds none of it.
-constexpr Version kLayoutBoundary{0, 5, 0};
+// 0.6.0 moved user data, logs and games out of the app folder; an older version finds none of it.
+constexpr Version kLayoutBoundary{0, 6, 0};
} // namespace
std::string UpdateService::LayoutRefusal(const Version& to) const {
if (!(to < kLayoutBoundary)) return {};
- if (!(config_.current < kLayoutBoundary)) return "this version uses the 0.5 data layout";
+ if (!(config_.current < kLayoutBoundary)) return "this version uses the 0.6 data layout";
if (config_.layout_journal.empty()) return {};
// Moved (or being moved) when the move record is there; unknown counts as moved.
struct stat info{};
- if (::lstat(config_.layout_journal.c_str(), &info) == 0) return "the 0.5 layout move record exists";
- if (errno != ENOENT) return "the 0.5 layout move record can't be checked (errno=" + std::to_string(errno) + ")";
+ if (::lstat(config_.layout_journal.c_str(), &info) == 0) return "the 0.6 layout move record exists";
+ if (errno != ENOENT) return "the 0.6 layout move record can't be checked (errno=" + std::to_string(errno) + ")";
return {};
}
@@ -309,7 +309,7 @@ void UpdateService::FindPrevious() {
if (backup) {
const auto refusal = LayoutRefusal(backup->version);
if (!refusal.empty()) {
- Log("go back to " + backup->version.ToString() + " not offered: it can't read the 0.5 data layout (" +
+ Log("go back to " + backup->version.ToString() + " not offered: it can't read the 0.6 data layout (" +
refusal + ")");
backup.reset();
}
@@ -756,7 +756,7 @@ bool UpdateService::RollBackAtQuit() {
const auto backup = LatestBackup();
if (!backup) return false;
if (const auto refusal = LayoutRefusal(backup->version); !refusal.empty()) {
- Log("going back refused: " + backup->version.ToString() + " can't read the 0.5 data layout (" + refusal + ")");
+ Log("going back refused: " + backup->version.ToString() + " can't read the 0.6 data layout (" + refusal + ")");
return false;
}
const std::string stamp = std::to_string(config_.now());
diff --git a/src/update/update_service.h b/src/update/update_service.h
index 8f2c41e..315ac19 100644
--- a/src/update/update_service.h
+++ b/src/update/update_service.h
@@ -26,8 +26,8 @@ struct UpdateConfig {
std::string kits_root; // /data/playden/kits; the kit lives at <kits_root>/<kit_id>
std::string appmeta_root; // /user/appmeta/FAKE77031
std::string registered_app_root; // /user/app/FAKE77031
- // The 0.5 layout move's record (/data/playden/runtime-state/layout-0.5.json). While it exists,
- // going back below 0.5.0 is refused whatever the current version. Empty: the version rule only.
+ // The 0.6 layout move's record (/data/playden/runtime-state/layout-0.6.json). While it exists,
+ // going back below 0.6.0 is refused whatever the current version. Empty: the version rule only.
std::string layout_journal;
Version current;
Fetch fetch;
@@ -132,7 +132,7 @@ class UpdateService {
void DoInstall();
void ConfirmApplied(const std::string& state);
bool RollBackAtQuit();
- // Why going back to `to` is refused (it can't read the 0.5 data layout), or empty.
+ // Why going back to `to` is refused (it can't read the 0.6 data layout), or empty.
std::string LayoutRefusal(const Version& to) const;
void FindPrevious();
void LoadCurrentNotes();
diff --git a/tests/homebrew_runtime_host_test.cpp b/tests/homebrew_runtime_host_test.cpp
index c02b544..11797f5 100644
--- a/tests/homebrew_runtime_host_test.cpp
+++ b/tests/homebrew_runtime_host_test.cpp
@@ -2538,7 +2538,7 @@ void ShippedRecipeRequirementsFollowTheKit(bool template_audio_ps5) {
host.Shutdown();
}
-// The 0.5 layout moves /data/homebrew/FAKE77031/games to /data/playden-games in one rename at
+// The 0.6 layout moves /data/homebrew/FAKE77031/games to /data/playden-games in one rename at
// startup. The runtime host then rewrites the records and republishes each moved Ready game, so
// its descriptor, profile and dxvk.conf name the new folder and it starts from Home again.
struct GamesMove {
@@ -2854,7 +2854,7 @@ void PlayBeforeRepublishRepublishesFirst() {
// While it runs, Play says why it can't update the game.
host.Play(220);
const auto refused = WaitFor(host, [](const RuntimeSnapshot& s) { return s.play_refusals.count(220) != 0; });
- CHECK(refused.play_refusals.at(220) == "This game needs an update for Playden 0.5 first: Close the game first.");
+ CHECK(refused.play_refusals.at(220) == "This game needs an update for Playden 0.6 first: Close the game first.");
fixture.activity->store(static_cast<int>(NativeActivity::kStopped));
host.Play(220);
const auto played = WaitFor(host, [](const RuntimeSnapshot& s) { return s.handoff_ready; }, 30);
@@ -2969,7 +2969,7 @@ void RestartDuringRepublishResumes() {
CHECK(move.Done() == 0);
host.Play(220);
const auto refused = WaitFor(host, [](const RuntimeSnapshot& s) { return s.play_refusals.count(220) != 0; });
- CHECK(refused.play_refusals.at(220).rfind("This game needs an update for Playden 0.5 first: ", 0) == 0);
+ CHECK(refused.play_refusals.at(220).rfind("This game needs an update for Playden 0.6 first: ", 0) == 0);
host.Prepare({220, "/data/playden-games/220", "internal", "Half-Life \"2\""});
const auto resumed = WaitFor(host, [](const RuntimeSnapshot& s) {
return !s.preparing_app && s.prepares_handled > 0 && !s.installs.empty() && !s.installs[0].recovery_pending;
diff --git a/tests/layout_migration_test.cpp b/tests/layout_migration_test.cpp
index 647b304..309a696 100644
--- a/tests/layout_migration_test.cpp
+++ b/tests/layout_migration_test.cpp
@@ -377,7 +377,7 @@ void RevertsTheMove() {
// Never moved: nothing to do.
CHECK(RevertLayout(f->paths, f->ops).complete);
CHECK(MigrateLayout(f->paths, f->ops).games_moved);
- Write(f->paths.log_root / "runtime-0.5.log", "new\n");
+ Write(f->paths.log_root / "runtime-0.6.log", "new\n");
Write(f->paths.app_root / "logs" / "native-startup.log", "next start\n");
const auto calls = f->root_calls;
const auto reverted = RevertLayout(f->paths, f->ops);
@@ -387,13 +387,13 @@ void RevertsTheMove() {
CHECK(Read(app / "playden-data" / "session.v1") == "credentials" && Mode(app / "playden-data" / "session.v1") == 0600);
CHECK(Mode(app / "playden-data" / "game-settings-private") == 0700);
CHECK(fs::exists(app / "games" / "220" / "game.exe") && !fs::exists(f->paths.games_root));
- CHECK(fs::exists(app / "logs" / "runtime-0.5.log"));
+ CHECK(fs::exists(app / "logs" / "runtime-0.6.log"));
CHECK(Read(app / "logs" / "native-startup.log") == "next start\n");
CHECK(Read(app / "logs" / "native-startup.log.moved") == "pre-grant\n");
CHECK(!fs::exists(app / "playden-data" / "MOVED.txt") && !fs::exists(app / "logs" / "MOVED.txt") &&
!fs::exists(app / "games-MOVED.txt"));
CHECK(!LoadLayoutJournal(f->paths.state_root));
- // A later 0.5 start moves everything again.
+ // A later 0.6 start moves everything again.
const auto again = MigrateLayout(f->paths, f->ops);
CHECK(again.games_moved && again.notice.empty() && Moved(f->paths));
}
@@ -406,7 +406,7 @@ void RevertKeepsConflictsAndJournal() {
CHECK(!reverted.complete && reverted.error.find("session.v1") != std::string::npos);
CHECK(Read(f->paths.user_root / "session.v1") == "credentials");
CHECK(LoadLayoutJournal(f->paths.state_root)->step == "revert-user");
- // A 0.5 start after the failed revert merges both places back.
+ // A 0.6 start after the failed revert merges both places back.
fs::remove(f->paths.app_root / "playden-data" / "session.v1");
const auto resumed = MigrateLayout(f->paths, f->ops);
CHECK(resumed.games_moved && resumed.notice.empty() && Moved(f->paths));
diff --git a/tests/runtime_game_install_test.cpp b/tests/runtime_game_install_test.cpp
index 26bbcf5..1943693 100644
--- a/tests/runtime_game_install_test.cpp
+++ b/tests/runtime_game_install_test.cpp
@@ -486,7 +486,7 @@ void RegistryRejectsSymlinksAndDoesNotTouchOldTemporaryFiles() {
} // namespace
-// The 0.5 games move: records under the old root are rewritten together, keep the old path as
+// The 0.6 games move: records under the old root are rewritten together, keep the old path as
// their mark (written only when set), and an invalid one leaves every record as it was.
void MovedRecordsRewriteTogetherAndKeepTheirMark() {
CHECK(RebaseInstallPath("/data/homebrew/FAKE77031/games/220", "/data/homebrew/FAKE77031/games", "/data/playden-games") ==
diff --git a/tests/self_update_service_test.cpp b/tests/self_update_service_test.cpp
index d9aa64d..d073229 100644
--- a/tests/self_update_service_test.cpp
+++ b/tests/self_update_service_test.cpp
@@ -538,29 +538,29 @@ int main() {
CHECK(!service.Snapshot().rollback_requested && !service.ApplyAtQuit());
RemoveTree(fixture.root);
}
- // Going back never crosses 0.5.0: older versions can't read the data it moved out of the app.
+ // Going back never crosses 0.6.0: older versions can't read the data it moved out of the app.
{
Fixture fixture;
fixture.root = zip_fixture::TempFolder("service-layout");
Installed(fixture.root);
- Put(fixture.root + "/playden/self-update/backup/0.4.2-900/eboot.bin", "eboot 0.4.2");
- UpdateService service(fixture.Config({0, 5, 0}));
+ Put(fixture.root + "/playden/self-update/backup/0.5.0-900/eboot.bin", "eboot 0.5.0");
+ UpdateService service(fixture.Config({0, 6, 0}));
service.Start();
CHECK(service.Snapshot().previous.empty());
service.RequestRollback();
CHECK(!service.Snapshot().rollback_requested && !service.ApplyAtQuit());
- CHECK(Exists(fixture.root + "/playden/self-update/backup/0.4.2-900/eboot.bin"));
+ CHECK(Exists(fixture.root + "/playden/self-update/backup/0.5.0-900/eboot.bin"));
RemoveTree(fixture.root);
}
- // This branch may still report a version below 0.5.0: the move record alone refuses going back.
+ // This branch may still report a version below 0.6.0: the move record alone refuses going back.
{
Fixture fixture;
fixture.root = zip_fixture::TempFolder("service-journal");
Installed(fixture.root);
Put(fixture.root + "/playden/self-update/backup/0.4.2-900/eboot.bin", "eboot 0.4.2");
- const std::string journal = fixture.root + "/playden/runtime-state/layout-0.5.json";
+ const std::string journal = fixture.root + "/playden/runtime-state/layout-0.6.json";
Put(journal, "{\"step\":\"done\"}");
- auto config = fixture.Config({0, 4, 0});
+ auto config = fixture.Config({0, 5, 0});
config.layout_journal = journal;
UpdateService refused(config);
refused.Start();
diff --git a/tools/collect_logs.py b/tools/collect_logs.py
index 4a4e968..e3889b2 100644
--- a/tools/collect_logs.py
+++ b/tools/collect_logs.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""Collect Playden's logs from a PS5 over FTP into a zip for a test report.
-Reads only /data/homebrew/FAKE77031/logs and the active kit's manifest. It never reads
+Reads only /data/playden/logs (or the app's logs folder on 0.4.x and older) and the active kit's manifest. It never reads
playden-data, which holds the Steam sign-in. The Steam account name and SteamIDs are
replaced in every file unless --no-redact is given.
@@ -22,7 +22,8 @@ import re
import sys
import zipfile
-LOGS = "/data/homebrew/FAKE77031/logs"
+LOGS = "/data/playden/logs"
+OLD_LOGS = "/data/homebrew/FAKE77031/logs" # before 0.6.0
IDENTITY = "/data/homebrew/FAKE77031/playden-package.identity"
KITS = "/data/playden/kits"
TITLE_LOG = re.compile(r"^title-(FAKE\d{5})\.log$")
@@ -46,6 +47,18 @@ def listing(ftp, directory):
return entries
+def pick_logs(ftp):
+ """The logs folder to read and its files: the 0.6.0 one, else the app's old one."""
+ for directory in (LOGS, OLD_LOGS):
+ try:
+ entries = listing(ftp, directory)
+ except ftplib.Error:
+ continue
+ if entries:
+ return directory, entries
+ return LOGS, {}
+
+
def folders(ftp, directory):
lines = []
ftp.retrlines("LIST " + directory, lines.append)
@@ -193,18 +206,18 @@ def main():
sys.exit(f"could not connect to FTP at {args.host}:{args.port}: {error}\n"
"Is an FTP server (zftpd) running on the PS5?")
- entries = listing(ftp, LOGS)
+ logs_dir, entries = pick_logs(ftp)
title_logs, playden_logs = {}, {}
for name in entries:
if name.endswith(SKIP_SUFFIXES):
continue
match = TITLE_LOG.match(name)
if match:
- title_logs[match.group(1)] = fetch(ftp, f"{LOGS}/{name}").decode("utf-8", "replace")
+ title_logs[match.group(1)] = fetch(ftp, f"{logs_dir}/{name}").decode("utf-8", "replace")
elif name.startswith("title-"):
continue # per-title extras such as registry dumps; taken with their title below
else:
- playden_logs[name] = fetch(ftp, f"{LOGS}/{name}").decode("utf-8", "replace")
+ playden_logs[name] = fetch(ftp, f"{logs_dir}/{name}").decode("utf-8", "replace")
if args.list or not (args.all_titles or args.app is not None or args.title):
rows = games(title_logs, {title: title_name(ftp, title) for title in title_logs})
@@ -233,7 +246,7 @@ def main():
files[f"title-{title}.log"] = title_logs[title]
for name in entries:
if name.startswith(f"title-{title}.") and name != f"title-{title}.log":
- files[name] = fetch(ftp, f"{LOGS}/{name}").decode("utf-8", "replace")
+ files[name] = fetch(ftp, f"{logs_dir}/{name}").decode("utf-8", "replace")
info = {"collected": datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M UTC")}
try:
diff --git a/tools/console_title_deploy.py b/tools/console_title_deploy.py
index 345ca59..b069a0d 100644
--- a/tools/console_title_deploy.py
+++ b/tools/console_title_deploy.py
@@ -23,9 +23,9 @@ import sys
TITLE = "/data/homebrew/FAKE77031"
SKIP = {".packaged"}
SKIP_DIRS = {"logs"}
-# Playden runs as the app's own user (its root grant restores that user afterwards). It
-# writes its startup log and session in these, and creates games/, dev/ and other data in
-# the package folder itself, so all three must be writable by others.
+# Playden writes its early startup log (before its root grant) and keeps stub folders for
+# the data it moves out at startup in these, and creates dev/ in the package folder itself,
+# so all three must be writable by others.
WRITABLE_DIRS = ("logs", "playden-data")
@@ -173,6 +173,8 @@ def main():
replace(ftp, f"{TITLE}/{relative}", data, mode)
print(f"deployed {relative} {hashlib.sha256(data).hexdigest()[:12]} {mode}")
print(f"{len(changes)} files changed; backup in {args.backup}")
+ print("From 0.6.0, Playden moves its data at startup: user data to /data/playden/user, "
+ "logs to /data/playden/logs, games to /data/playden-games.")
ftp.quit()
return 0
diff --git a/tools/download_speed_report.py b/tools/download_speed_report.py
index 904c200..d9a91a0 100644
--- a/tools/download_speed_report.py
+++ b/tools/download_speed_report.py
@@ -21,7 +21,8 @@ from pathlib import Path
import re
import sys
-LOGS = "/data/homebrew/FAKE77031/logs"
+LOGS = "/data/playden/logs"
+OLD_LOGS = "/data/homebrew/FAKE77031/logs" # before 0.6.0
LINE = re.compile(r"^(\S+) app=(\d+) step=(\S+) result=(\S+) detail=(.*)$")
METRIC = re.compile(r"\b([a-z_]+)=(\d+)\b")
STAGES = ("fetch", "proc", "create", "write", "jrnl", "back")
@@ -104,7 +105,15 @@ def fetch_logs(host, port):
ftp.login()
# List first: zftpd answers 451, rather than 550, for an absent rotated log.
listing = []
- ftp.retrlines("LIST " + LOGS, listing.append)
+ logs = LOGS
+ for logs in (LOGS, OLD_LOGS):
+ listing = []
+ try:
+ ftp.retrlines("LIST " + logs, listing.append)
+ except ftplib.Error:
+ continue
+ if any(line.startswith("-") for line in listing):
+ break
names = {line.split(None, 8)[8] for line in listing
if line.startswith("-") and len(line.split(None, 8)) == 9}
for name in ("install.log.1", "install.log"):
@@ -112,7 +121,7 @@ def fetch_logs(host, port):
continue
buffer = io.BytesIO()
try:
- ftp.retrbinary("RETR " + LOGS + "/" + name, buffer.write, 1 << 20)
+ ftp.retrbinary("RETR " + logs + "/" + name, buffer.write, 1 << 20)
except ftplib.error_perm as error:
if str(error).startswith("550"):
continue