box64/docs/BUNDLE-X86-LIBS.md
Luke Short 8aab7296b8
Bundle more libs (#2419)
* [DOCS] Arch Linux does have an archive

* [BUNDLE] Simplify unsupported package message

* [BUNDLE] Archive Void Linux XBPS packages

This was an oversight to not include these but not XBPS packages
are used (yet).

* [DOCS] Fedora dependencies

List Fedora dependencies for the 'box64-bundle-x86-libs.sh' script.

* [DOCS] Fedora 34 hints

Use Fedora 34 to find missing 32-bit packages that are compatible
with Enterprise Linux 9.

* [DOCS] Add better 'dnf provides' hint

Use wildcards. This works on all versions of DNF.

* [BUNDLE] Add common libraries

as reported by various GitHub Issues.

Resolves #2390

* [DOCS] Mention essential libraries

and libraries with large dependencies. These should not be bundled.

* [BUNDLE] Remove essential libraries

and libraries with large dependencies.
2025-03-13 09:21:26 +01:00

4.2 KiB

Bundling x86 Libraries

The script box64-bundle-x86-libs.sh is provided to download, extract, and re-bundle x86_64 and x86 libraries for use with Box64/Box32 and Box86. These libraries improve Box emulation. This bundle provides a much smaller size compared to using a full root file system of an operating system.

Usage

Administrator

Install required dependencies for the bundle script.

  • Debian
    sudo apt-get update
    sudo apt-get install coreutils curl binutils rpm2cpio tar zstd
    
  • Fedora
    sudo dnf install coreutils curl binutils tar zstd
    

Run box64-bundle-x86-libs.sh. This will create two archives:

  • box64-bundle-x86-libs.tar.gz = All of the extracted library files in the directory structure of usr/lib/box64-i386-linux-gnu and usr/lib/box64-x86_64-linux-gnu.
  • box64-bundle-x86-pkgs.tar.gz = All of the Linux distribution packages used to extract the library files. This is only created for preservation purposes and is otherwise unused.

Extract the library archive. Box will automatically search these paths for library files to emulate.

sudo tar --extract --file box64-bundle-x86-libs.tar.gz --directory /

Developer

Add new packages to the box64-bundle-x86-libs.csv file in the format of <PACKAGE_URL>,<SHA256_CHECKSUM>.

Supported packages:

  • DEB (Debian)
  • EOPKG (Solus)
  • RPM (Fedora)
  • XBPS (Void Linux)

Preference of operating system packages that provide a library:

  1. RPMs from AlmaLinux 9 provide 10 years of updates.
  2. DEBs from Debian 11 provide 5 years of updates.
  3. EOPKG from Solus provide old variants of obscure 32-bit libraries.
  4. XBPS from Void Linux provide updated variants of obscure 32-bit libraries.
  5. Other (whereever a library is packaged)

Some essential library files will never be emulated (only wrapped) and should not be bundled. This includes glibc, OpenGL, Vulkan, and X11/Xorg libraries. The full list can be found here. Other libraries with lots of dependencies, such as GTK, require all dependencies to be installed for emulation to work. This becomes dependency hell and should be avoided.

For finding package names that contian a specific library file, use the pkgs.org website. Otherwise, use one of these package manager commands on a x86_64 Linux distribution:

  • DEB
    • apt-file <LIBRARY_FILE>
  • EOPKG
    • Does not support file search. Use pkgs.org instead.
  • RPM
    • dnf provides "*/<LIBRARY_FILE>*"
  • XBPS
    • xbps-query --repository --ownedby <LIBRARY_FILE>

Once the package name is found, find the exact URL for downloading it.

  • DEB = Explore "main" and "contrib". Search for packages with the name "deb11" in it. Use the "amd64.deb" and "i386.deb" packages.
  • EOPKG = Use the "<VERSION>-<RELEASE>-x86_64.eopkg" and "32bit-<VERSION>-<RELEASE>-x86_64.eopkg" packages.
  • RPM = Navigate to the "<MAJOR>.<MINOR>" version directory first. Then explore "AppStream" and "BaseOS". Use the "x86_64.rpm" and "i686.rpm" packages.
  • XBPS = There are too many files in the repository to display on a web browser. Use pkgs.org instead to find the exact URL for downloading it.

Download the package and then find the checksum with the sha256sum command.

Major Linux distributions such as AlmaLinux and Debian provide archives of packages. Rolling distributions such as Solus and Void Linux do not. In those cases, use the Internet Archive to archive any rolling release package used by Box by using the "Save Page Now" feature. If the error "Save Page Now browser crashed" appears, it can be safely ignored. The archive will still have been saved.