Skip to content

Commit

Permalink
Add safe option to mount and unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
hung3a8 committed Jan 20, 2024
1 parent 0583a30 commit 093b2f1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ error() {
fi

log "Unmounting /dev and /run from chroot"
umount $CHROOT/dev
umount $CHROOT/run
umount -l $CHROOT/dev
umount -l $CHROOT/run
log "Done"

exit "${code}"
Expand All @@ -42,8 +42,8 @@ fi

if $(findmnt -rno SOURCE,TARGET "$CHROOT/dev" > /dev/null); then
log "Unmounting /dev and /run from chroot"
umount $CHROOT/dev
umount $CHROOT/run
umount -l $CHROOT/dev
umount -l $CHROOT/run
log "Done"
fi

Expand Down Expand Up @@ -126,8 +126,8 @@ icpc_build() {
log "Done"

log "Mount /dev and /run to chroot"
mount --bind /dev $CHROOT/dev
mount --bind /run $CHROOT/run
mount --make-rslave --bind /dev $CHROOT/dev
mount --make-rslave --bind /run $CHROOT/run
log "Done"

log "Copy scripts and config to chroot"
Expand All @@ -153,8 +153,8 @@ icpc_build() {
log "Done"

log "Unmounting /dev and /run from chroot"
umount $CHROOT/dev
umount $CHROOT/run
umount -l $CHROOT/dev
umount -l $CHROOT/run
log "Done"

rm -rf $ICPC_ISO_FILENAME
Expand Down

0 comments on commit 093b2f1

Please sign in to comment.