envkernel: Fix switching envkernel to different source path (!1733)

When there is already another kernel source path mounted then the old mount
should be removed. Otherwise the mount source will still be pointed at the
old kernel source.
This commit is contained in:
Robert Yang 2018-12-29 13:54:04 -05:00
parent 3e845e1edf
commit 70126570a4
1 changed files with 3 additions and 1 deletions

View File

@ -128,7 +128,9 @@ initialize_chroot() {
mount_kernel_source() {
[ -e "$chroot/mnt/linux/Kbuild" ] && return
if [ -e "$chroot/mnt/linux/Kbuild" ]; then
sudo umount "$chroot/mnt/linux"
fi
sudo mount --bind "$PWD" "$chroot/mnt/linux"
}