Skip to content

Commit

Permalink
[ubu-chroot] Ensure all mount points are unmounted upon exit. JB#61615
Browse files Browse the repository at this point in the history
Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
  • Loading branch information
Thaodan committed Mar 14, 2024
1 parent 43b1c93 commit 0d36bba
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mer-android-chroot
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ prepare_mountpoints() {
mount --rbind / ${uburoot}/parentroot/
fi

mkdir -p ${uburoot}/lib/modules/`uname -r`
mount_bind /lib/modules/`uname -r`
mkdir -p ${uburoot}/lib/modules/$(uname -r)
mount_bind /lib/modules/$(uname -r)

}
umount_spare() {
Expand All @@ -226,6 +226,15 @@ umount_spare() {
umount ${uburoot}/dev/pts || :
umount ${uburoot}/dev/shm ${uburoot}/run/shm || :
umount ${uburoot}/var/run/dbus || :
umount ${uburoot}/sys || :
umount ${uburoot}/dev || :
umount ${uburoot}/proc || :

if [[ $bind_mount_home == yes ]] ; then
if mountpoint -q ${uburoot}/$HOMEDIR ; then
umount ${uburoot}/$HOMEDIR
fi
fi
}

prepare_user() {
Expand Down

0 comments on commit 0d36bba

Please sign in to comment.