From 99705356e6c4894ef1c7cf3b37fa1ffea2ae9cf9 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Sun, 5 Mar 2023 11:12:48 -0500 Subject: [PATCH] Optimizing box86 and box64. --- packages/compat/box64/config/box64.box64rc | 72 ++++++++++++++ packages/compat/box64/config/box64.conf | 2 + packages/compat/box64/package.mk | 6 +- packages/compat/box86/config/box86.box86rc | 99 +++++++++++++++++++ packages/compat/box86/config/box86.conf | 2 + packages/compat/box86/package.mk | 6 +- packages/sysutils/busybox/package.mk | 2 + .../system.d/proc-sys-fs-binfmt_misc.mount | 24 +++++ packages/sysutils/systemd/package.mk | 4 +- 9 files changed, 207 insertions(+), 10 deletions(-) create mode 100644 packages/compat/box64/config/box64.box64rc create mode 100644 packages/compat/box64/config/box64.conf create mode 100644 packages/compat/box86/config/box86.box86rc create mode 100644 packages/compat/box86/config/box86.conf create mode 100644 packages/sysutils/busybox/system.d/proc-sys-fs-binfmt_misc.mount diff --git a/packages/compat/box64/config/box64.box64rc b/packages/compat/box64/config/box64.box64rc new file mode 100644 index 000000000..19dc6a793 --- /dev/null +++ b/packages/compat/box64/config/box64.box64rc @@ -0,0 +1,72 @@ +# System-wide .box64rc + +# Note that process name are case insensitive! + +# +# Linux process +# + +BOX64_PREFER_EMULATED=1 +BOX64_LD_LIBRARY_PATH="/usr/share/box64/lib" +BOX64_BASH="/usr/bin/bash-x64" + +[3dSen.x86_64] +BOX64_DYNAREC_BLEEDING_EDGE=0 # avoid the use of STRONGMEM for much better performances +BOX64_DYNAREC_HOTPAGE=0 # disabling hotpage seems to give better performances here + +[7z] +# Those are safe to use on 7z and give a bit of a boost +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_BIGBLOCK=2 +BOX64_DYNAREC_CALLRET=1 + +[dav1d] +# Speed hacks (those 3 gives ~10% speedup) +BOX64_DYNAREC_SAFEFLAGS=0 +BOX64_DYNAREC_BIGBLOCK=2 +BOX64_DYNAREC_CALLRET=1 + +[deadcells] +BOX64_PREFER_EMULATED=1 + +[dontstarve] +# use emulated sdl2 +BOX64_EMULATED_LIBS=libSDL2-2.0.so.0 + +[dontstarve_steam_x64] +BOX64_EMULATED_LIBS=libSDL2-2.0.so.0 + +[dota2] +BOX64_CRASHHANDLER=1 +BOX64_DYNAREC_STRONGMEM=1 + +[heroic] +BOX64_NOSANDBOX=1 + +[pressure-vessel-wrap] +BOX64_NOGTK=1 + +[steam] +BOX64_CRASHHANDLER=1 +BOX64_EMULATED_LIBS=libudev.so.0 + +[streaming_client] +BOX64_EMULATED_LIBS=libSDL2-2.0.so.0:libSDL2_ttf-2.0.so.0 + +[steamwebhelper] +BOX64_NOSANDBOX=1 +BOX64_EXIT=1 + +[steam-runtime-check-requirements] +BOX64_EXIT=1 + +# +# Wine process +# + +[DOOMx64.exe] +BOX64_DYNAREC_SAFEFLAGS=0 + +[DOOMx64vk.exe] +BOX64_DYNAREC_SAFEFLAGS=0 + diff --git a/packages/compat/box64/config/box64.conf b/packages/compat/box64/config/box64.conf new file mode 100644 index 000000000..73af4ed50 --- /dev/null +++ b/packages/compat/box64/config/box64.conf @@ -0,0 +1,2 @@ +# /etc/binfmt.d/box64.conf +:x86_64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/box64: diff --git a/packages/compat/box64/package.mk b/packages/compat/box64/package.mk index d93cc63db..948a2a1af 100644 --- a/packages/compat/box64/package.mk +++ b/packages/compat/box64/package.mk @@ -22,8 +22,6 @@ makeinstall_target() { cp ${PKG_BUILD}/tests/bash ${INSTALL}/usr/bin/bash-x64 mkdir -p ${INSTALL}/etc/binfmt.d - ln -fs /storage/.config/box64.conf ${INSTALL}/etc/binfmt.d/box64.conf - - mkdir ${INSTALL}/usr/config - touch ${INSTALL}/usr/config/box64.conf + cp -f ${PKG_DIR}/config/box64.conf ${INSTALL}/etc/binfmt.d/box64.conf + cp -f ${PKG_DIR}/config/box64.box64rc ${INSTALL}/etc/box64.box64rc } diff --git a/packages/compat/box86/config/box86.box86rc b/packages/compat/box86/config/box86.box86rc new file mode 100644 index 000000000..4b0a3a6e5 --- /dev/null +++ b/packages/compat/box86/config/box86.box86rc @@ -0,0 +1,99 @@ +# System-wide .box86rc + +# Note that process name are case insensitive! + +# +# Linux process +# + + +BOX86_PREFER_EMULATED=1 +BOX86_LD_LIBRARY_PATH="/usr/share/box86/lib" +BOX86_BASH="/usr/bin/bash-x86" + +[7z] +# Those are safe to use on 7z and give a bit of a boost +BOX86_DYNAREC_SAFEFLAGS=0 +BOX86_DYNAREC_BIGBLOCK=2 + +[A_Golden_Wake.bin.x86] +BOX86_PREFER_EMULATED=1 + +[dontstarve] +# use emulated sdl2 +BOX86_EMULATED_LIBS=libSDL2-2.0.so.0 + +[dontstarve_steam] +BOX86_EMULATED_LIBS=libSDL2-2.0.so.0 + +[GeminiRue.bin.x86] +BOX86_PREFER_EMULATED=1 + +[LittleInferno.bin.x86] +# Little Inferno use an old libvorbis +BOX86_EMULATED_LIBS=libvorbis.so.0 + +[hl_linux] +BOX86_PREFER_EMULATED=1 + +[hl2_linux] +#it seems emulated SDL2 have mouse issue for now. That might be a problem with box86 +#BOX86_PREFER_EMULATED=1 + +[retrocityrampage] +BOX86_DYNAREC_SAFEFLAGS=0 +BOX86_DYNAREC_BIGBLOCK=2 + +[sof-bin] +BOX86_LD_PRELOAD=libX11.so.6 + +[steam] +BOX86_EMULATED_LIBS=libudev.so.0:libSDL2-2.0.so.0 +BOX86_NOGTK=1 +BOX86_DYNAREC_STRONGMEM=1 +BOX86_X11COLOR16=1 + +[streaming_client] +BOX86_EMULATED_LIBS=libSDL2-2.0.so.0:libSDL2_ttf-2.0.so.0 + +[UnrealLinux.bin] +BOX86_DYNAREC_SAFEFLAGS=0 +BOX86_DYNAREC_BIGBLOCK=2 + +[WorldOfGoo.bin.x86] +# This is the newer 1.53 version +BOX86_DYNAREC_SAFEFLAGS=0 +BOX86_DYNAREC_BIGBLOCK=2 + +[WorldOfGoo.bin32] +# This is the old version of the game +BOX86_DYNAREC_SAFEFLAGS=0 +BOX86_DYNAREC_BIGBLOCK=2 + +[X3R_main] +# X3Reunion needs emulated libjpeg +BOX86_EMULATED_LIBS=libjpeg.so.62 + +[zsnes] +BOX86_DYNAREC_SAFEFLAGS=0 +BOX86_DYNAREC_BIGBLOCK=2 + + +# +# Wine process +# + +[Crysis.exe] +#Crysis needs this or you get some strange physics behaviour +BOX86_DYNAREC_X87DOUBLE=1 +BOX86_DYNAREC_SAFEFLAGS=0 # this will help perf a bit +BOX86_DYNAREC_BIGBLOCK=3 # Wine app will need 3 for bigblock to do anything + +[VARA.exe] +BOX86_DYNAREC_SAFEFLAGS=2 + +[VARAFM.exe] +BOX86_DYNAREC_SAFEFLAGS=2 + +[VARASAT.exe] +BOX86_DYNAREC_SAFEFLAGS=2 diff --git a/packages/compat/box86/config/box86.conf b/packages/compat/box86/config/box86.conf new file mode 100644 index 000000000..8692bca59 --- /dev/null +++ b/packages/compat/box86/config/box86.conf @@ -0,0 +1,2 @@ +# /etc/binfmt.d/box86.conf +:x86:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/box86: diff --git a/packages/compat/box86/package.mk b/packages/compat/box86/package.mk index e3b336a6f..3067beac8 100644 --- a/packages/compat/box86/package.mk +++ b/packages/compat/box86/package.mk @@ -43,8 +43,6 @@ makeinstall_target() { esac mkdir -p ${INSTALL}/etc/binfmt.d - ln -fs /storage/.config/box86.conf ${INSTALL}/etc/binfmt.d/box86.conf - - mkdir ${INSTALL}/usr/config - touch ${INSTALL}/usr/config/box86.conf + cp -f ${PKG_DIR}/config/box86.conf ${INSTALL}/etc/binfmt.d/box86.conf + cp ${PKG_DIR}/config/box86.box86rc ${INSTALL}/etc/box86.box86rc } diff --git a/packages/sysutils/busybox/package.mk b/packages/sysutils/busybox/package.mk index 12eb46a0b..63728e760 100644 --- a/packages/sysutils/busybox/package.mk +++ b/packages/sysutils/busybox/package.mk @@ -191,6 +191,8 @@ post_install() { enable_service shell.service enable_service show-version.service enable_service var.mount + enable_service proc-sys-fs-binfmt_misc.mount + listcontains "${FIRMWARE}" "rpi-eeprom" && enable_service rpi-flash-firmware.service # cron support diff --git a/packages/sysutils/busybox/system.d/proc-sys-fs-binfmt_misc.mount b/packages/sysutils/busybox/system.d/proc-sys-fs-binfmt_misc.mount new file mode 100644 index 000000000..df885ad38 --- /dev/null +++ b/packages/sysutils/busybox/system.d/proc-sys-fs-binfmt_misc.mount @@ -0,0 +1,24 @@ + +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Arbitrary Executable File Formats File System +Documentation=https://docs.kernel.org/admin-guide/binfmt-misc.html +Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems +DefaultDependencies=no + +[Mount] +What=binfmt_misc +Where=/proc/sys/fs/binfmt_misc +Type=binfmt_misc +Options=nosuid,nodev,noexec + +[Install] +WantedBy=local-fs.target diff --git a/packages/sysutils/systemd/package.mk b/packages/sysutils/systemd/package.mk index f25e50996..efd2f23d2 100644 --- a/packages/sysutils/systemd/package.mk +++ b/packages/sysutils/systemd/package.mk @@ -7,7 +7,7 @@ PKG_VERSION="252.5" PKG_LICENSE="LGPL2.1+" PKG_SITE="http://www.freedesktop.org/wiki/Software/systemd" PKG_URL="https://github.com/systemd/systemd-stable/archive/v${PKG_VERSION}.tar.gz" -PKG_DEPENDS_TARGET="toolchain libcap kmod util-linux libidn2 wait-time-sync Python3:host jinja2:host" +PKG_DEPENDS_TARGET="toolchain libcap kmod util-linux libidn2 wait-time-sync Python3:host jinja2:host pcre2" PKG_LONGDESC="A system and session manager for Linux, compatible with SysV and LSB init scripts." PKG_MESON_OPTS_TARGET="--libdir=/usr/lib \ @@ -45,7 +45,7 @@ PKG_MESON_OPTS_TARGET="--libdir=/usr/lib \ -Dxz=false \ -Dlz4=false \ -Dxkbcommon=false \ - -Dpcre2=false \ + -Dpcre2=true \ -Dglib=false \ -Ddbus=false \ -Ddefault-dnssec=no \