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

steamdeck: Enable automount #413

Merged
merged 11 commits into from
Oct 6, 2024

Conversation

hotburger
Copy link
Contributor

I put it in steamdeck because it depends on jupiter-hw-support.

@hotburger hotburger marked this pull request as draft September 28, 2024 19:13
@puffnfresh
Copy link

Fantastic, I'll test this out!

@hotburger hotburger marked this pull request as ready for review September 29, 2024 01:30
@samueldr
Copy link
Member

Observations:

(With a non-steam-flavoured FAT32 formatted SD card, to test the "new user" scenario.)

Without this PR, inserting a "non-steam-flavoured" SD card into a test Steam Deck results in the SD card icon showing up at the top bar. The icon does nothing when activated. Additionally I can't find options to format the SD card [which is fine].

With this PR, inserting a "non-steam-flavoured" SD card into a test Steam Deck results in the SD card icon showing up at the top bar. When activating the icon, it brings me to the System panel of the settings interface.

From there, the Format SD card option can be activated... But!

Format Error

We encountered an error while formatting your microSD card (2). Please try again or contact Steam support.

Which uh...

.../channels/jovian-nixos 130 $ sudo result/lib/hwsupport/format-sdcard.sh 
[sudo] password for samuel: 
Sorry, try again.
[sudo] password for samuel: 
/nix/store/fnq94lw19pnwdl9p8zhfrad4jmlgxlbr-findutils-4.10.0/bin/find: ‘/run/media’: No such file or directory

image

[... fixing some stuff, brb ...]

@samueldr
Copy link
Member

samueldr commented Sep 29, 2024

[...] After fixing some stuff (to be worked into this change set):

  • Automounting works...
  • (On the current beta channel) Steam does not seem to add a library
  • If a library already exists, it'll be picked-up by Steam.

Formatting still doesn't work from the interface, the script does work though. (brb, changing channel) Even on stable.

Same observation for the library.

I do have a library already, to move the steam folder elsewhere in the FS. I wonder if that's weird interaction where if a library already exists anywhere, it won't try to make one.

@hotburger
Copy link
Contributor Author

One thing I've noticed: the library will linger in the steam ui after the sd card is unplugged. All the games on the unplugged sd card still have a green play button and the ghost of the sd card will remain in the "Storage" tab in settings.

@samueldr
Copy link
Member

One thing I've noticed: the library will linger in the steam ui

YMMV, and I wonder if it's also related to the automated library creation issues.

With my quite synthetic test, when the library had been added via the mounting/unmounting automation, it was cleaned up on removal of the SD card, but I also had one time where the library stuck, which was when I had added the library via the "add library" steam url.

@samueldr
Copy link
Member

Surely this won't be a problem...

jovian.steam.environment = {
# We don't support adopting a drive, yet.
STEAM_ALLOW_DRIVE_ADOPT = mkDefault "0";
# Ejecting doesn't work, either.
STEAM_ALLOW_DRIVE_UNMOUNT = mkDefault "0";
};

@samueldr
Copy link
Member

samueldr commented Oct 1, 2024

Playing with formatting support, here's a follow-up with the weirdness around Library creation / adoption.

  • It seems that only formatting via the storage tab, not via the system tab adds a Steam Library to the SD card, with our setup
  • If a library was added by any other means, it may / will be picked-up by Steam (this may need more testing for weirder setups).

So, I'm willing to say that this implementation is sufficient, and that the library creation issues are unrelated to automounting, though a surprising behaviour.


TODO

  • Add STEAM_ALLOW_DRIVE_UNMOUNT to this PR, and verify it does allow unmounting.

@samueldr
Copy link
Member

samueldr commented Oct 4, 2024

I've been cleaning and testing more thoroughly the mounting part with the added changes from the formatting branch.

The force push is a freshly-rebased-on-development equivalent to this branch + the mounting bits from my WIP.

TODO

  •  Make this an hardware-agnostic option.

I will merge this not before tomorrow unless further changes are requested.


The SD cards were formatted with the formatting branch. I do not know if adding a library otherwisely to the SD card would be picked up like it is here.

The SD cards have this structure:

$ ls -l "$( lsblk -no mountpoint /dev/mmcblk0p1 )"
drwx------ 2 root   root  16384 Sep 30 02:06 lost+found
-rwxr-xr-x 1 samuel users    76 Sep 30 02:07 libraryfolder.vdf
drwxr-xr-x 5 samuel users  4096 Sep 30 02:57 steamapps

Tested on:

  • Steam Client Beta
  • Steam Client Stable

Updated to whatever is fresh now.

Observations

  • Inserting an SD card mounts it
  • The libraries get picked up
  • The games show correctly that they need to be installed if they are not in a mounted library
  • The games change to "Play" the moment the library is mounted
  • Ejecting the SD card works

NOT tested: any formatting feature

Comment on lines +28 to +29
# Remove `deck` username assumption
./0001-Jovian-Ensure-automounting-works-for-any-UID-1000-us.patch
Copy link
Member

Choose a reason for hiding this comment

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

(note) this one was previously within ./jovian.patch too.

@samueldr samueldr merged commit 751641e into Jovian-Experiments:development Oct 6, 2024
33 checks passed
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.

3 participants