Skip to content

Conversation

mrvictory1
Copy link

This PR adds support for Linux systems where /usr is read only by utilizing /usr/local which is writable on Universal Blue based distributions. The PR has been tested on Bazzite. List of changes:

  • cli/CMakeLists.txt: C++ standard has been upgraded from C++ 11 to C++ 17. This is necessary to use std::filesystem.
  • cli/src/main.cc: new logic has been added to check if /usr/bin/steam is modifiable. If it is not, an attempt is made to create a copy at /usr/local/bin. If it is successful, patching is performed in /usr/local/bin/steam. If it fails, millennium exits.
  • scripts/install.sh: Script checks if /usr/bin is writable, if not it /usr/local/bin is checked. If that also fails, script exits.
  • scripts/posix/start.sh: .so file is searched in both /usr/local/bin and /usr/bin. Lack of file in either directory is harmless.
  • src/sys/env.cc: If /usr/local/bin/millennium exists, /usr/ is changed to /usr/local (done 3 times)

Todo / Caveats:

  • /usr/local is not writable on some distributions ie bootc based CentOS. I did not know this when starting working on this. ~/.local/bin can be used instead.
  • check_patch_status() in millennium cli does not check for /usr/local.
  • Bazzite uses a custom script /usr/bin/bazzite-steam to launch Steam on desktop. This needs to be changed to /usr/bin/local/steam or simply steam which is not prevented by read only /usr.

@shdwmtr
Copy link
Member

shdwmtr commented Sep 21, 2025

We probably shouldn't use filesystem in the CLI. its a huge dependency and likely brings significant overhead onto the stack which would increase the binary size.

Pretty sure copy_file_range or sendfile would work just as well!

@timelord1102
Copy link

Cant seem to reproduce an install on Bazzite. Files are placed properly by install.sh, but start.sh does not actually apply millennium, instead opening steam with no millennium options.

@mrvictory1
Copy link
Author

@timelord1102 exit steam fully then start steam from the terminal with /usr/local/bin/steam or just steam. See point

Bazzite uses a custom script /usr/bin/bazzite-steam to launch Steam on desktop. This needs to be changed to /usr/bin/local/steam or simply steam which is not prevented by read only /usr.

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