Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
mountpoint: always try to unmount
Browse files Browse the repository at this point in the history
Previously, the previous mountpoints were all visible from the new one,
which caused exponential growth of the mountpoint table (size = count ^ 2 - 1)

Signed-off-by: Victor "multun" Collod <[email protected]>
  • Loading branch information
multun committed Jul 6, 2019
1 parent 67c706b commit 108fe5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch-creator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,14 @@ squashfs() {
# directory must be already mounted before chrooting in
mount_bind() {
step "Mounting ROOTFS"
mount --bind ${ROOTFS_DIR} ${ROOTFS_DIR}
mount --bind "${ROOTFS_DIR}" "${ROOTFS_DIR}"
trap umount_bind EXIT
unstep
}

umount_bind() {
step "Unmounting ROOTFS"
umount ${ROOTFS_DIR}
umount "${ROOTFS_DIR}"
unstep
}

Expand Down Expand Up @@ -276,7 +277,6 @@ clean() {

step "Cleaning ${IMAGE_NAME}"

umount_bind
run rm -rf `dirname "${ROOTFS_DIR}"`
run rm -rf "${IMAGES_DIR}/${IMAGE_NAME}.squashfs"
run rm -rf "${IMAGES_DIR}/${IMAGE_NAME}_*"
Expand Down

0 comments on commit 108fe5b

Please sign in to comment.