FEX-Emu statt Box64: hermetic in-image emulator (EMULATOR=fex|box64 build-arg)
- Base ubuntu:24.04 (fex-emu PPA has no Debian series) - setup-arm64: installs fex-emu(+thunks) from ppa:fex-emu/fex and bakes the Ubuntu 24.04 x86_64 RootFS (unsquashed to /opt/fex-emu-rootfs) into the image - bedrock-entry.sh: USE_FEX=true (default on FEX builds) execs FEXInterpreter; FEX_EMU_DIR for JIT caches stays volume-friendly; box64 path kept as fallback - amd64 builds untouched (native exec)
This commit is contained in:
1 parent
6cc16c40af
commit
fc2454d208
3 files changed
+60
-8
No files matched your search
+18
-1
@@ -577,8 +577,25 @@ if isTrue "${ENABLE_SSH}"; then
|
||||
fi
|
||||
|
||||
echo "Starting Bedrock server..."
|
||||
if [[ -f /usr/local/bin/box64 ]] && isTrue "${USE_BOX64}" ; then
|
||||
if [[ -f /usr/local/bin/box64 ]] && isTrue "${USE_BOX64:=false}" ; then
|
||||
exec mc-server-runner "${mcServerRunnerArgs[@]}" box64 ./"$SERVER"
|
||||
elif [[ -x /usr/bin/FEXInterpreter ]] && isTrue "${USE_FEX:=true}" ; then
|
||||
# FEX-Emu (x86_64 on arm64): RootFS and emulator are baked into the image.
|
||||
# FEX_EMU_DIR holds the JIT/AOT caches — keep it on a volume for warm starts.
|
||||
export FEX_ROOTFS="${FEX_ROOTFS:-/opt/fex-emu-rootfs/rootfs}"
|
||||
export FEX_EMU_DIR="${FEX_EMU_DIR:-$HOME/.fex-emu}"
|
||||
mkdir -p "$FEX_EMU_DIR"
|
||||
if [[ ! -f "$HOME/.config/fex-emu/Config.json" ]]; then
|
||||
mkdir -p "$HOME/.config/fex-emu"
|
||||
cat > "$HOME/.config/fex-emu/Config.json" << 'FEXCONF'
|
||||
{
|
||||
"Options": [
|
||||
{ "Key": "RootFS", "Value": "/opt/fex-emu-rootfs/rootfs" }
|
||||
]
|
||||
}
|
||||
FEXCONF
|
||||
fi
|
||||
exec mc-server-runner "${mcServerRunnerArgs[@]}" /usr/bin/FEXInterpreter ./"$SERVER"
|
||||
else
|
||||
exec mc-server-runner "${mcServerRunnerArgs[@]}" ./"$SERVER"
|
||||
fi
|
||||
Reference in new issue
Block a user