From d602764f3807ad4cc688129f8e47501a4cc0cf65 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Fri, 16 Oct 2020 15:45:00 -0400 Subject: [PATCH] Mount DRI In Native Mode --- debian/client/common/DEBIAN/postinst | 2 +- debian/client/native/usr/lib/minecraft-pi/run.sh | 3 --- .../share/minecraft-pi/client/docker-compose.yml | 15 +++++++++++++++ debian/client/virgl/usr/lib/minecraft-pi/run.sh | 3 --- .../share/minecraft-pi/client/docker-compose.yml | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 debian/client/native/usr/share/minecraft-pi/client/docker-compose.yml rename debian/client/{common => virgl}/usr/share/minecraft-pi/client/docker-compose.yml (91%) diff --git a/debian/client/common/DEBIAN/postinst b/debian/client/common/DEBIAN/postinst index 9e615293..7d4c2c68 100755 --- a/debian/client/common/DEBIAN/postinst +++ b/debian/client/common/DEBIAN/postinst @@ -2,4 +2,4 @@ set -e -MCPI_MODE='' MCPI_FEATURES='' MCPI_USERNAME='' docker-compose -f /usr/share/minecraft-pi/client/docker-compose.yml pull +MCPI_FEATURES='' MCPI_USERNAME='' docker-compose -f /usr/share/minecraft-pi/client/docker-compose.yml pull diff --git a/debian/client/native/usr/lib/minecraft-pi/run.sh b/debian/client/native/usr/lib/minecraft-pi/run.sh index 84375ea3..c637a631 100644 --- a/debian/client/native/usr/lib/minecraft-pi/run.sh +++ b/debian/client/native/usr/lib/minecraft-pi/run.sh @@ -2,8 +2,5 @@ set -e -# Enable VirGL -export MCPI_MODE=native - # Launch Minecraft ${DOCKER_COMPOSE} run --rm minecraft-pi \ No newline at end of file diff --git a/debian/client/native/usr/share/minecraft-pi/client/docker-compose.yml b/debian/client/native/usr/share/minecraft-pi/client/docker-compose.yml new file mode 100644 index 00000000..91616104 --- /dev/null +++ b/debian/client/native/usr/share/minecraft-pi/client/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3.7' +services: + minecraft-pi: + image: 'thebrokenrail/minecraft-pi:client' + network_mode: 'host' + volumes: + - '/tmp/.X11-unix:/tmp/.X11-unix' + - '~/.minecraft-pi:/root/.minecraft' + devices: + - '/dev/dri:/dev/dri' + environment: + - 'DISPLAY=unix${DISPLAY}' + - 'MCPI_FEATURES=${MCPI_FEATURES}' + - 'MCPI_USERNAME=${MCPI_USERNAME}' + - 'MCPI_MODE=native' diff --git a/debian/client/virgl/usr/lib/minecraft-pi/run.sh b/debian/client/virgl/usr/lib/minecraft-pi/run.sh index e800768b..d40a6851 100644 --- a/debian/client/virgl/usr/lib/minecraft-pi/run.sh +++ b/debian/client/virgl/usr/lib/minecraft-pi/run.sh @@ -2,9 +2,6 @@ set -e -# Enable VirGL -export MCPI_MODE=virgl - # Start VirGL virgl_test_server & VIRGL_PID="$!" diff --git a/debian/client/common/usr/share/minecraft-pi/client/docker-compose.yml b/debian/client/virgl/usr/share/minecraft-pi/client/docker-compose.yml similarity index 91% rename from debian/client/common/usr/share/minecraft-pi/client/docker-compose.yml rename to debian/client/virgl/usr/share/minecraft-pi/client/docker-compose.yml index dea4c8be..3295d712 100644 --- a/debian/client/common/usr/share/minecraft-pi/client/docker-compose.yml +++ b/debian/client/virgl/usr/share/minecraft-pi/client/docker-compose.yml @@ -11,4 +11,4 @@ services: - 'DISPLAY=unix${DISPLAY}' - 'MCPI_FEATURES=${MCPI_FEATURES}' - 'MCPI_USERNAME=${MCPI_USERNAME}' - - 'MCPI_MODE=${MCPI_MODE}' + - 'MCPI_MODE=virgl'