diff --git a/reform2-imx8mq/mkimage.sh b/reform2-imx8mq/mkimage.sh
index e68e143f2160a80d3220fa4173f7f68bb8b12780..7cb90160ba694d4f89c1507ee299d6ad6c7ecf7a 100755
--- a/reform2-imx8mq/mkimage.sh
+++ b/reform2-imx8mq/mkimage.sh
@@ -3,7 +3,8 @@
 set -x
 set -e
 
-sudo apt install parted multistrap udisks2 gcc-aarch64-linux-gnu make device-tree-compiler qemu-user-static binfmt-support
+# make sure build tools are installes
+sudo apt-get -y install parted multistrap udisks2 gcc-aarch64-linux-gnu make device-tree-compiler qemu-user-static binfmt-support
 
 # build the linux kernel
 ./mkkernel.sh
diff --git a/reform2-imx8mq/mkuserland.sh b/reform2-imx8mq/mkuserland.sh
index f41177e119eee971ba59b79583e386448adcb851..74b8908638ab0d84a876f424a414aaa382bb355c 100755
--- a/reform2-imx8mq/mkuserland.sh
+++ b/reform2-imx8mq/mkuserland.sh
@@ -5,6 +5,23 @@
 ETC=./template-etc
 SKEL=./template-skel
 
+mbind() {
+	for d in dev proc sys
+	do
+		mount /$d target-userland/$d -o bind || echo "Bind-mounting /$d failed"
+	done
+}
+
+munbind() {
+	for d in dev proc sys
+	do
+		umount -f target-userland/$d || echo "Umounting $d failed"
+	done
+}
+
+# Make sure there are no bind-mounts before attempting to delete the target
+munbind
+
 rm -rf ./target-userland
 mkdir ./target-userland
 
@@ -62,8 +79,10 @@ cp $ETC/eth.network target-userland/etc/systemd/network/
 mkdir -p target-userland/var/lib/alsa
 cp $ETC/asound.state target-userland/var/lib/alsa/
 
-mknod target-userland/dev/random c 1 8
-mknod target-userland/dev/urandom c 1 9
+mbind
+
+#mknod target-userland/dev/random c 1 8
+#mknod target-userland/dev/urandom c 1 9
 
 chown root:root -R target-userland/*
 chown root:shadow target-userland/etc/shadow
@@ -90,3 +109,5 @@ EOF
 mkdir -p target-userland/etc/pulseaudio
 cp $ETC/daemon.conf target-userland/etc/pulse/
 
+munbind
+