From 118bca3fa5209558d1f42b849a066e04b2b8b5d6 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sun, 31 Jan 2021 15:33:31 -0500 Subject: [PATCH] Add Back sg/pkexec Code --- README.md | 13 ++++--------- debian/client/common/usr/bin/minecraft-pi | 7 ++++++- scripts/package.sh | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 212cd7c34..6eecf7aaa 100644 --- a/README.md +++ b/README.md @@ -39,15 +39,10 @@ Minecraft: Pi Edition Modding Project Game logs are located in ``/tmp/minecraft-pi``. ### ``Couldn't connect to Docker daemon at http+docker://localhost - is it running?`` -- Make Sure Your User Is In The ``docker`` Group - ```sh - sudo usermod -aG docker "$(id -un)" - ``` - Then Log Out And Log Back In -- Make Sure Docker Is Running - ```sh - sudo service docker start - ``` +Make Sure Docker Is Running: +```sh +sudo service docker start +``` ### ``Error response from daemon: error gathering device information while adding custom device "/dev/dri": no such file or directory`` Make sure you are using the correct GPU drivers for your system. If you are using a Raspberry Pi, make sure your GPU driver is set to ``Full KMS`` or ``Fake KMS`` in ``raspi-config``. diff --git a/debian/client/common/usr/bin/minecraft-pi b/debian/client/common/usr/bin/minecraft-pi index 721287c94..e4c69984e 100755 --- a/debian/client/common/usr/bin/minecraft-pi +++ b/debian/client/common/usr/bin/minecraft-pi @@ -2,6 +2,11 @@ set -e +# Esnure User Is In docker Group +if ! id -nGz | grep -qzxF 'docker'; then + pkexec /usr/sbin/usermod -aG docker "$(id -un)" +fi + # All Feature Flags export AVAILABLE_FEATURES="$(tr '\n' ' ' < /usr/share/minecraft-pi/client/features)" @@ -34,7 +39,7 @@ export USER_UID="$(id -u)" # Run set +e -/usr/lib/minecraft-pi/pre-launch.sh +sg docker /usr/lib/minecraft-pi/pre-launch.sh RET=$? set -e diff --git a/scripts/package.sh b/scripts/package.sh index c4e8b71e0..63ab41f51 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -6,8 +6,8 @@ DEB_VERSION='1.0.0' # Dependencies REQUIRED_DOCKER_VERSION='19.03' COMMON_DEPENDENCIES="docker.io (>=${REQUIRED_DOCKER_VERSION}) | docker-ce (>=${REQUIRED_DOCKER_VERSION}), libseccomp2 (>=2.4.2), docker-compose, binfmt-support" -CLIENT_DEPENDENCIES="zenity, x11-xserver-utils" -RECOMMENDED_DEPENDENCIES="qemu-user-static" +CLIENT_DEPENDENCIES='zenity, x11-xserver-utils, login, policykit-1, passwd' +RECOMMENDED_DEPENDENCIES='qemu-user-static' set -e