Skip to content

Commit 3fef2d3

Browse files
committed
fix typo
1 parent 4c1dca8 commit 3fef2d3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

chroot.shell.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
[ -f "$ROOTFS_LOCK" ] || mount_rootfs_all
66

7+
copy_etc_files
8+
79
do_chroot /bin/sh
810

911
quit

lib.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,16 @@ mount_rootfs_all(){
7575
done
7676
}
7777

78+
copy_etc_files(){
79+
[ -f "$ROOTFS_LOCK" ] || fail "rootfs is not mounted."
80+
cp /etc/hostname /etc/hostname /etc/hosts /etc/resolv.conf "$ROOTFS_DIR/etc"
81+
}
82+
7883
umount_rootfs_all(){
7984
[ -f "$ROOTFS_LOCK" ] || fail "rootfs is not mounted."
8085
for d in /dev/pts /dev /proc /sys /tmp; do
8186
umount "$ROOTFS_DIR/$d" 2>/dev/null
8287
done
83-
cp /etc/hostname /etc/hosts /etc/resolv.conf "$ROOTFS_DIR/etc"
8488
umount "$ROOTFS_DIR" || fail "cannot unmount rootfs."
8589
rm "$ROOTFS_LOCK" || fail
8690
}

0 commit comments

Comments
 (0)