diff --git a/reform2-imx8mq/mkimage.sh b/reform2-imx8mq/mkimage.sh
index c078b5191b7472f0b7d60417d1ea1c8d4fc1c40c..07bbf837a920754d29445b760d524477093563cc 100755
--- a/reform2-imx8mq/mkimage.sh
+++ b/reform2-imx8mq/mkimage.sh
@@ -4,8 +4,22 @@ set -x
 set -e
 
 # make sure build tools are installed
-# FIXME: replace this by a check that everything is installed
-#sudo apt-get -y install parted multistrap udisks2 gcc-aarch64-linux-gnu make device-tree-compiler qemu-user-static binfmt-support build-essential bison flex libssl-dev mmdebstrap
+DEPS="mmdebstrap genext2fs e2fsprogs binfmt-support git mount arch-test qemu-user-static parted"
+if [ "$(dpkg-query --showformat '${db:Status-Status}\n' --show $DEPS | sort -u)" != "installed" ]; then
+	echo "Not all dependencies of this script are installed."
+	echo "Run the following command to install them:"
+	echo
+	echo "    sudo apt install $DEPS"
+	exit 1
+fi
+if dpkg --compare-versions "$(dpkg-query --showformat='${Version}\n' --show mmdebstrap)" lt "0.8.4-1"; then
+	echo "mmdebstrap version must be >= 0.8.4-1"
+	exit 1
+fi
+if dpkg --compare-versions "$(dpkg-query --showformat='${Version}\n' --show genext2fs)" lt "1.5.0-2"; then
+	echo "genext2fs version must be >= 1.5.0-2"
+	exit 1
+fi
 
 # if we are in a git repository and if SOURCE_DATE_EPOCH is not set, use the
 # timestamp of the latest git commit