umountall only if /install is a mountpoint

This commit is contained in:
Tobias Powalowski 2022-04-13 20:21:45 +02:00
parent 4f528a51dd
commit 8525832416

View file

@ -396,7 +396,7 @@ _getavailpartitions()
# the destination root partition last!
_umountall()
{
if [[ "${DESTDIR}" == "/install" && $(mountpoint -q ${DESTDIR}) ]]; then
if [[ "${DESTDIR}" == "/install" && mountpoint -q "${DESTDIR}" ]]; then
swapoff -a >/dev/null 2>&1
for i in $(findmnt --list --submounts "${DESTDIR}" -o TARGET -n | tac); do
umount "$i"