pull/373/merge
rpier1 2020-08-26 13:04:07 +02:00 committed by GitHub
commit 0fc2c876e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 33 additions and 4 deletions

View File

@ -3,11 +3,40 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BUILD_OPTS="$*" BUILD_OPTS="$*"
DOCKER="docker" SUDO=''
if [ $EUID != 0 ]; then
if ! ${DOCKER} ps >/dev/null 2>&1; then SUDO='sudo'
DOCKER="sudo docker"
fi fi
function install_binfmt_support {
local binfmtSupport="binfmt-support"
if ! dpkg -s $binfmtSupport &>/dev/null; then
echo "please install $binfmtSupport with this command: $SUDO apt-get install $binfmtSupport"
exit 1
fi
}
function load_kernelmodule {
local kernelMod="$1"
if ! $SUDO modinfo $kernelMod &>/dev/null; then
echo "missing this kernel modul: $kernelMod"
exit 1
else
if $SUDO modprobe -n --first-time $kernelMod &>/dev/null; then
echo "loading kernel module $kernelMod"
$SUDO modprobe $kernelMod
fi
fi
}
install_binfmt_support
load_kernelmodule loop
load_kernelmodule binfmt_misc
DOCKER="$SUDO docker"
if ! ${DOCKER} ps >/dev/null; then if ! ${DOCKER} ps >/dev/null; then
echo "error connecting to docker:" echo "error connecting to docker:"
${DOCKER} ps ${DOCKER} ps