goweiwen / Allium

A custom launcher for the Miyoo Mini and Miyoo Mini Plus handheld devices
GNU General Public License v3.0
135 stars 14 forks source link

Install DraStic directly into cores instead of requiring a migration script #67

Open josegonzalez opened 5 months ago

josegonzalez commented 5 months ago

Is there a way to upgrade emulators? I'd like to contribute an update of drastic and I see references to migrations and such, so its not super clear how to go about this...

goweiwen commented 5 months ago

The migration process is a bit obfuscated, but let me try to break it down:

Compile Time

  1. retroarch-config and retroarch-core-overrides contain config files that are stored in the repository as plaintext, but are zipped up when packaging Allium, and unzipped when migrations are being run.
  2. Running make migrations (or just make) will package the migrations. Each migration has to have its own task in the Makefile. For Drastic specifically, this is the task: https://github.com/goweiwen/Allium/blob/5f50d0c1cb44275b4b85119b00d6e8a36abd7e0f/Makefile#L69
  3. Drastic has its own migration task that downloads Drastic from steward's repository: https://github.com/goweiwen/Allium/blob/main/migrations/0002-drastic-1.7/package.sh
  4. Drastic then gets downloaded into dist/.allium/migrations/0002-drastic-1.7/drastric.zip, which gets packaged into the final zip during release.

Run Time

  1. On device boot, we try to run all the migrations that don't already have a .done file in the migrations directory ($ROOT/.allium/migrations/*). Migrations are run using the run.sh file in the migrations directory. https://github.com/goweiwen/Allium/blob/5f50d0c1cb44275b4b85119b00d6e8a36abd7e0f/static/.tmp_update/updater#L48
  2. Drastic's migration script unzips Drastic into .allium/cores, and patches the launch script to fix the audio (https://github.com/goweiwen/Allium/issues/48#issuecomment-1809203134)

The version of Drastic is included in the migration name as a hack so that when Drastic is updated, we can rename the migration and existing installations will re-run the migration. For updating Drastic, you can simply rename all references of drastic-1.7 to 1.8, update the download link, and test that the launch.sh patch still works.

josegonzalez commented 4 months ago

Should emulators be installed/updated via migrations? These seem fairly slow to run and kinda frustrating for a first-time user to perform.

goweiwen commented 4 months ago

You're right, maybe Drastic should be bundled.

josegonzalez commented 4 months ago

Ditto for the other migrations actually. I first booted it up and it started running them and seemed to stall but it wasn't clear where (the text output by the launch scripts isnt output anywhere).

goweiwen commented 4 months ago

8928bacf16e978f49da3f25b09368e41fff97fe4 updates DraStic to 1.8. I'll leave this issue open for moving DraStic into cores directly instead of through a migration.