Skip to content

Commit 3f7488f

Browse files
committed
.
1 parent 38f8c68 commit 3f7488f

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ mount_rootfs_base(){
6565
mkdir -p "$ROOTFS_DIR" || fail
6666
mount -o loop "$ROOTFS_IMG" "$ROOTFS_DIR" || fail "cannot mount rootfs."
6767
}
68+
mount_rootfs_all(){
69+
mount_rootfs_base
70+
mkdir -p "$INNER_TMP" || fail
71+
mount -o bind "$INNER_TMP" "$ROOTFS_DIR/tmp" || fail "cannot bind /tmp."
72+
for d in /dev /dev/pts /proc /sys; do
73+
mount -o bind "/$d" "$ROOTFS_DIR/$d" || fail "cannot bind $d"
74+
done
75+
}
6876

6977
umount_rootfs_all(){
7078
[ -f "$ROOTFS_LOCK" ] || fail "rootfs is not mounted."
@@ -95,15 +103,6 @@ install_rootfs(){
95103
umount_rootfs_all
96104
}
97105

98-
mount_rootfs_all(){
99-
mount_rootfs_base
100-
mkdir -p "$INNER_TMP" || fail
101-
mount -o bind "$INNER_TMP" "$ROOTFS_DIR/tmp" || fail "cannot bind /tmp."
102-
for d in /dev /dev/pts /proc /sys; do
103-
mount -o bind "/$d" "$ROOTFS_DIR/$d" || fail "cannot bind $d"
104-
done
105-
}
106-
107106
do_chroot(){
108107
[ -f "$ROOTFS_LOCK" ] || fail "rootfs is not mounted."
109108
HOME=/root chroot "$ROOTFS_DIR" "$@"

0 commit comments

Comments
 (0)