Skip to content

Commit b1ffed5

Browse files
update mounter
1 parent 493c642 commit b1ffed5

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

plugins/functions

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,21 @@ do_mount() {
3131
local chroot_dir=$1
3232
points="$chroot_dir/dev $chroot_dir/sys $chroot_dir/proc"
3333
see_for_directory "$points"
34-
for mount_point in $points; do
35-
if is_mounted "$mount_point" >>/dev/null; then
36-
(
37-
$SUDO mount --rbind /dev "$chroot_dir"/dev
38-
$SUDO mount -t sysfs /sys "$chroot_dir"/sys
39-
$SUDO mount -t proc /proc "$chroot_dir"/proc
40-
) || die "Couldn't mount..."
34+
35+
if ! is_mounted "$chroot_dir/dev" >>/dev/null; then
36+
shout "mounting: $chroot_dir/dev"
37+
$SUDO mount --rbind /dev "$chroot_dir"/dev
38+
fi
39+
40+
if ! is_mounted "$chroot_dir"/proc >>/dev/null; then
41+
shout "mounting: $chroot_dir/proc"
42+
$SUDO mount -t proc /proc $chroot_dir/proc
43+
fi
44+
45+
if ! is_mounted "$chroot_dir"/sys >>/dev/null; then
46+
shout "mounting: $chroot_dir/sys"
47+
$SUDO mount -t sysfs /sys "$chroot_dir"/sys
4148
fi
42-
done
4349
}
4450

4551
is_mounted() {

0 commit comments

Comments
 (0)