Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lindbergh: squashfs support #13714

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

udance4ever
Copy link
Contributor

@udance4ever udance4ever commented Mar 12, 2025

great work on Lindbergh Loader! 🤯

got .squashfs support working for lindbergh by implementing an overlay with write access.

  1. 94GB for 19 roms compress down to 36GB freeing up 58GB (hummerxt goes from 20GB+ to 754MB - over 96%!)
  2. speeds up updating gamelists as it prevents ES from recursively going down thousands of files in roms/lindbergh/*/*/

Tested on:

  1. 19 Lindbergh roms
  2. 7 other systems that support .squashfs: 3ds, scummvm, daphne, ps3, singe, snes-msu1, xbox

@Tovarichtch
Copy link
Collaborator

Tovarichtch commented Mar 12, 2025

I don't think an overlay is the right solution. However, Sega Lindbergh ROMs really need some level of compression to avoid long gamelist loading and overall management.

@Darknior
Copy link

Ah yes really an excellent idea :)
I love Squashfs format, it same time and hard drive space :)

@udance4ever
Copy link
Contributor Author

I don't think an overlay is the right solution.

ok fair enough, it is why I filed a request lindbergh loader execute outside the rom directory - perhaps by specifying a path to the rom on the command line as other emulators do.

However we need to consider the primary goal of the Lindbergh project is to keep existing Lindbergh Arcade cabinets running so we can't expect this to be implemented short-term.

It was a relatively simple change to conditionally create an overlay in /var/run/squashfs without getting too much in the way of existing code.

Are there other issues you see I am not aware of?

@@ -44,7 +44,8 @@
def main(args: argparse.Namespace, maxnbplayers: int) -> int:
# squashfs roms if squashed
if args.rom.suffix == ".squashfs":
with squashfs_rom(args.rom) as rom:
writable_rom = (args.system == "lindbergh")
with squashfs_rom(args.rom, overlay=writable_rom) as rom:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may need to be refactored as part of Generator (and a refactor of when the generator is created) because it's rare for decisions to be made on the system/emulator/core outside of Generator and its subclasses.

Before talking about this, we need to figure out if an overlay is even the right option.

@udance4ever udance4ever force-pushed the enh/lindbergh-squashfs branch from 64c241d to 80a1a80 Compare March 12, 2025 20:26
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why use overlay?
using the /var/run/squashfs/ as rw is not an ideal location for preservation of any rom updates. why here?

Copy link
Contributor Author

@udance4ever udance4ever Mar 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to other ideas & saw this was the most straightforward to implement and get working.

The bottleneck is lindbergh doesn't run outside (eg. /usr/bin/lindbergh and it's shared .so libraries) and the config file in system/configs/lindbergh is only a template so it requires the rom directory to be writeable so the generator can copy all these files into it at runtime.

The solution squashfs already provides is the use of an overlay - this is what it was designed for as far as I can tell.

The changes are only temporary to allow the rom to boot. All changes can be safely discarded after the game exits because the config file is generated every time.

I also noticed the code can be reused as other squashfs mounts like daphne and singe want to write a .dat file into the directory if you don't remember to generate it before mksquashfs. Use of the overlay logic allows the title to boot instead of crapping out because it doesn't have write access as the .dat file can be regenerated (until the rom is upgraded to include it). This is a separate discussion but thought I'd add additional rationale.

@udance4ever udance4ever force-pushed the enh/lindbergh-squashfs branch from 80a1a80 to 382b631 Compare March 23, 2025 09:30
@udance4ever udance4ever force-pushed the enh/lindbergh-squashfs branch from 382b631 to 7126b27 Compare March 23, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants