fix unmount problem

master
Marc Wäckerlin 8 years ago
parent 9f1c8760ab
commit 69906556c6
  1. 14
      scripts/bootstrap-to-docker.sh

@ -143,13 +143,13 @@ for ((i=0; i<${#distros[@]}; ++i)); do
fi
echo " ---- mount filesystems in ${tmpdir}/${distro}-${arch}" 1>&2
for x in proc sys dev; do
if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x/; then
umount -flr "${tmpdir}/${distro}-${arch}"/$x/
if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x; then
sudo umount -flr "${tmpdir}/${distro}-${arch}"/$x
fi
done
sudo mount -t proc proc "${tmpdir}/${distro}-${arch}"/proc/
sudo mount -t sysfs sys "${tmpdir}/${distro}-${arch}"/sys/
sudo mount -o bind /dev "${tmpdir}/${distro}-${arch}"/dev/
sudo mount -t proc proc "${tmpdir}/${distro}-${arch}"/proc
sudo mount -t sysfs sys "${tmpdir}/${distro}-${arch}"/sys
sudo mount -o bind /dev "${tmpdir}/${distro}-${arch}"/dev
echo " ---- preconfigure debian packages in ${tmpdir}/${distro}-${arch}" 1>&2
sudo chroot "${tmpdir}/${distro}-${arch}" debconf-set-selections <<EOF
console-setup console-setup/fontsize-fb47 select 8x16
@ -196,8 +196,8 @@ EOF1
sudo chroot "${tmpdir}/${distro}-${arch}" apt-get -o Acquire::ForceIPv4=true install -y ${instpkgs}
echo " ---- unmount filesystems in ${tmpdir}/${distro}-${arch}" 1>&2
for x in proc sys dev; do
if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x/; then
umount -flr "${tmpdir}/${distro}-${arch}"/$x/
if mount | grep -q "${tmpdir}/${distro}-${arch}"/$x; then
sudo umount -flr "${tmpdir}/${distro}-${arch}"/$x
fi
done
echo " ---- import ${tmpdir}/${distro}-${arch} to ${docker_user}/${type}:${distro}-${arch}" 1>&2

Loading…
Cancel
Save