Skip to content

Fix/bepinex mod for valheim install#4938

Open
yourfate wants to merge 2 commits into
GameServerManagers:masterfrom
yourfate:fix/bepinex-valheim-install
Open

Fix/bepinex mod for valheim install#4938
yourfate wants to merge 2 commits into
GameServerManagers:masterfrom
yourfate:fix/bepinex-valheim-install

Conversation

@yourfate

@yourfate yourfate commented Jul 16, 2026

Copy link
Copy Markdown

Description

The Bepinex mod for valheim changed the directory structure in the downloaded zip, which meant the files were now in the wrong position inside serverfiles.

This required a change to the extraction logic for mods, I used the previously unused modsubdirs variable. It was meant to just be the depth of subfolder the mod was in, but that is kind of useless once there are several folders in parallel. Now it is just a prefix you can set, from which the files inside the zip are taken. You can also use multiple folders here like some/dir/in/mod/folder to get to an arbitrary depth. IMHO this improves over the planned functionally of just having a number of dirs there.

If you prefer, I can move it to a new variable in the unzip command, that would then require changing all other mod installers tho.

This is currently an undocumented feature, so no changes to the dev documentation are required. I did update the comment.

Also the preload env vars in the fix_vh.sh script were outdated.

Lastly, the check permissions script caused errors when it checked files inside a wine prefix, which steamCMD ships with some (all?) game servers on linux.

Fixes #[4491]

The fix was created with the help of claude. I have manually written this PR, manually reviewed / edited the changes, and manually tested the fix on two installs.

Type of change

  • Bug fix (a change which fixes an issue).
  • New feature (a change which adds functionality).
  • New Server (new server added).
  • Refactor (restructures existing code).
  • Comment update (typo, spelling, explanation, examples, etc).

Testing

Please list the exact validation you performed and the outcome.

  • Commands/tests run:
    • I tested the valheim install with bepinex on a fresh debian machine, and also on my previously broken server.
  • Result:
    • works now.
  • Environment used (distro/version):
    • debian 13 LXC on proxmox

Risk and rollback

  • Risk level: low
    • no impact on non-modded servers
    • does not mess up previously broken servers further, users have to reinstall the bepinex mod to benefit from the fix.
  • Rollback plan:
    • Users with a broken bepinex install can fix it by removing it first using mods-remove, that should clean it up nicely.
    • For the rest of this PR no rollback plan is required I think?

Breaking changes

  • No breaking changes.
  • Breaking changes included (describe below).

Documentation impact

  • No documentation update required.
  • User documentation update required.
  • Developer documentation update required.

Checklist

PR will not be merged until all steps are complete.

  • This pull request links to an issue.
  • This pull request uses the develop branch as its base.
  • This pull request subject follows the Conventional Commits standard.
  • This code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have provided a detailed enough description of this PR.

Documentation

If documentation does need updating either update it by creating a PR (preferred) or request a documentation update.

Thank you for your Pull Request!

yourfate and others added 2 commits July 16, 2026 20:35
- mods_list: set modsubdirs="BepInExPack_Valheim" so only the pack
  contents (not loose Thunderstore metadata) are installed to serverfiles
- mods_core: implement modsubdirs subfolder isolation in fn_mod_install_files;
  when modsubdirs is not "0", the named subfolder becomes the extract root
- fix_vh: update BepInEx env vars to match current start_server_bepinex.sh
  (DOORSTOP_ENABLED/DOORSTOP_TARGET_ASSEMBLY replacing old names,
  remove defunct DOORSTOP_CORLIB_OVERRIDE_PATH)
- mods_list: update modsubdirs field comment to reflect its actual semantics

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SteamCMD creates a Wine prefix at serverfiles/steamapps/compatdata/
containing a z: symlink pointing to /. Without excluding this path,
`find "${serverfiles}"` traverses the entire filesystem, causing
check_permissions.sh to hang indefinitely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

[Bug]: Valheim bepinex: ERROR: ld.so: object 'libdoorstop_x64.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored

1 participant