File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 44
55[ -f " $ROOTFS_LOCK " ] || mount_rootfs_all
66
7+ copy_etc_files
8+
79do_chroot /bin/sh
810
911quit
Original file line number Diff line number Diff 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+
7883umount_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}
You can’t perform that action at this time.
0 commit comments