umountall only if /install is a mountpoint

This commit is contained in:
Tobias Powalowski 2022-04-13 20:54:20 +02:00
parent ad04161c55
commit 806068dcb8

View file

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