File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff 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
6977umount_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-
107106do_chroot (){
108107 [ -f " $ROOTFS_LOCK " ] || fail " rootfs is not mounted."
109108 HOME=/root chroot " $ROOTFS_DIR " " $@ "
You can’t perform that action at this time.
0 commit comments