Add Devbox and Static-linking #4

Closed
deftdawg wants to merge 2 commits from static-linking+devbox into main
deftdawg commented 2026-06-02 21:09:29 -05:00 (Migrated from github.com)
  • Devbox can be used to auto setup a build tool env (use "devbox shell" or "direnv allow" for load on "cd")
  • Add an option to build m2_init and ps5_control as statically linked binaries; i.e. don't depend on system libs

This is what a dev will see if they have direnv+devbox configured when entering the ps5-linux-tools directory:
image

- Devbox can be used to auto setup a build tool env (use "devbox shell" or "direnv allow" for load on "cd") - Add an option to build m2_init and ps5_control as statically linked binaries; i.e. don't depend on system libs This is what a dev will see if they have direnv+devbox configured when entering the ps5-linux-tools directory: <img width="75%" alt="image" src="https://github.com/user-attachments/assets/c755fab6-0ab9-4064-a002-0f7eba3640c7" />
deftdawg commented 2026-06-02 21:26:12 -05:00 (Migrated from github.com)

My setup is pretty scuffed, I have a very slow USB2 flash drive... Rather than try to have it install packages and build stuff, I elected to statically link m2_init on my NixOS desktop and scp it to the PS5 to do the m.2 install.

NixOS is a bit odd in that it keeps it's libs in isolated paths (allowing apps to install conflicting versions of the same lib), so dynamically linked binaries cannot locate their libs when shipped to new systems, not that that would be super reliable even with a "normal" distro.

ldd m2_init # dynamically linked on NixOS linux-vdso.so.1 (0x00007c98187fb000)

libz.so.1 => /nix/store/61a1nwx3w6rqyaisj5rn1sal1981apm7-zlib-1.3.2/lib/libz.so.1 (0x00007c9818715000)

libgcc_s.so.1 => /nix/store/chqq8mpmpyfi9kgsngya71akv5xicn03-gcc-15.2.0-lib/lib/libgcc_s.so.1 (0x00007c98186e8000)

libc.so.6 => /nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/libc.so.6 (0x00007c9818400000)

/nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/ld-linux-x86-64.so.2 => /nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib64/ld-linux-x86-64.so.2 (0x00007c98187fd000)

The magic line changes make the m2_*.sh scripts compatible with NixOS; I'm hoping to eventually port NixOS+Jovian to PS5 to replicate the Steam Deck experience I have on my AMD Desktop to the PS5.

My setup is pretty scuffed, I have a very slow USB2 flash drive... Rather than try to have it install packages and build stuff, I elected to statically link m2_init on my NixOS desktop and scp it to the PS5 to do the m.2 install. NixOS is a bit odd in that it keeps it's libs in isolated paths (allowing apps to install conflicting versions of the same lib), so dynamically linked binaries cannot locate their libs when shipped to new systems, not that that would be super reliable even with a "normal" distro. <details><summary> ldd m2_init # dynamically linked on NixOS</summary> linux-vdso.so.1 (0x00007c98187fb000) libz.so.1 => /nix/store/61a1nwx3w6rqyaisj5rn1sal1981apm7-zlib-1.3.2/lib/libz.so.1 (0x00007c9818715000) libgcc_s.so.1 => /nix/store/chqq8mpmpyfi9kgsngya71akv5xicn03-gcc-15.2.0-lib/lib/libgcc_s.so.1 (0x00007c98186e8000) libc.so.6 => /nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/libc.so.6 (0x00007c9818400000) /nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib/ld-linux-x86-64.so.2 => /nix/store/57iz36553175g3178pvxjij8z5rcsd4n-glibc-2.42-61/lib64/ld-linux-x86-64.so.2 (0x00007c98187fd000) </details> The magic line changes make the m2_*.sh scripts compatible with NixOS; I'm hoping to eventually port NixOS+[Jovian](https://github.com/Jovian-Experiments/Jovian-NixOS) to PS5 to replicate the Steam Deck experience I have on my AMD Desktop to the PS5.
TheOfficialFloW commented 2026-06-03 02:31:08 -05:00 (Migrated from github.com)

Just make it static, i dont want that devbox

Just make it static, i dont want that devbox

Pull request closed

Sign in to join this conversation.
No description provided.