Be less agressive on arm cleanup

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
This commit is contained in:
Itxaka
2023-06-02 15:29:49 +02:00
parent 1101a59c9e
commit 3c419594b4

View File

@@ -75,13 +75,11 @@ cleanup() {
if [ "$disable_lvm" == "false" ]; then
lvremove --yes KairosVG
fi
for LOOPS in $(losetup -a | awk -F':' {'print $1'} | awk -F'/' {'print $3'}); do
for LOOPPART in $(ls /dev/mapper/${LOOPS}*| awk -F'/' {'print $4'}); do
dmsetup remove "${LOOPPART}" || true;
done;
losetup -d /dev/"${LOOPS}" || true;
done
MAPPER_LOOP=$(basename "$LOOP")
for LOOPPART in $(ls /dev/mapper/"${MAPPER_LOOP}"*| awk -F'/' {'print $4'}); do
dmsetup remove "${LOOPPART}" || true;
done;
losetup -d "${LOOP}" || true;
}
ensure_dir_structure() {