ktwrd / beans-rs

Open-Source Installer for Sourcemods
GNU General Public License v3.0
7 stars 1 forks source link

Download game package onto same drive as sourcemods directory #25

Closed Jan200101 closed 4 months ago

Jan200101 commented 4 months ago

If the game install or update is downloaded onto the same drive as the sourcemod it would ensure that

  1. we won't run out of space because /var/tmp is too small or /tmp runs out of ram
  2. moving the files into place can be done atomic since they are already on the drive and just need a rename
ktwrd commented 4 months ago
  1. /var/tmp is not too small, since on the majority of linux distros it's on the root mountpoint. And /tmp is never used by beans (which was changed last month).
  2. No. Downloading should always be done to a proper temporary directory which can be cleaned up with the clean subcommand.

Closing this issue and it's associated PR.

Jan200101 commented 4 months ago

I disagree with this.

  1. This is wrong /var/tmp is not required to be on on the root drive and many immutable distros (such as Fedora Silverblue, CoreOS, SteamOS) use a separate mutable partition for /var.

Here is the example partition layout on my Steam Deck

(deck@steamdeck ~)$ df -h
Filesystem      Size  Used Avail Use% Mounted on
dev             7.3G     0  7.3G   0% /dev
run             7.3G  1.9M  7.3G   1% /run
efivarfs        148K   21K  123K  15% /sys/firmware/efi/efivars
/dev/nvme0n1p4  5.0G  3.0G  1.4G  69% /
/dev/nvme0n1p6  230M   13M  201M   7% /var
overlay         230M   13M  201M   7% /etc
tmpfs           7.3G  316M  7.0G   5% /dev/shm
/dev/nvme0n1p8  917G  916G  1.2G 100% /home
tmpfs           7.3G  4.7M  7.3G   1% /tmp
tmpfs           1.5G   60K  1.5G   1% /run/user/1000

/var is barely 200MB large, not big enough for the game and the reason why a SteamOS workaround is implemented. One could argue that /tmp is actually better here since it has more space and higher bandwidth due to being entirely within ram.

With immutable distros becoming more and more popular this is going to affect a non 0 amount of users.

  1. I partially agree things like butler which are only required at runtime are sane to be put into a temporary directory that beans or the OS can clean up

Put downloading the game archive into /var/tmp or /tmp is counterproductive, needlessly degrades hardware and takes longer than it needs to.

Downloading the game into a temporary folder near the sourcemods directory would be a lot more efficient

ktwrd commented 4 months ago

~/.tmp is used instead of /var/tmp on SteamOS. /tmp would not be viable since the .zstd and decompressed .tar file would take up all 8GB of space.

If you wish to define your own temporary directory, you can do so with the ADASTRAL_TMPDIR environment variable. If the user does not agree with the default locations, then they can just define it themself. This issue will stay closed.

Also, SteamOS is the only immutable distro that beans-rs has come in contact with that has such a small mountpoint for /var/tmp