Browse Source

updated vbuilder.sh.in: added -o _netdev in mnt_opts (mount-chroot-mount())

git-svn-id: http://trac.vinelinux.org/repos/projects/vbootstrap/trunk@2654 ec354946-7b23-47d6-9f5a-488ba84defc7
munepi 11 years ago
parent
commit
611e7d01a2
2 changed files with 29 additions and 24 deletions
  1. 5 5
      libvbuilder.sh.in
  2. 24 19
      vbuilder.sh.in

+ 5 - 5
libvbuilder.sh.in

@@ -209,7 +209,7 @@ apt-get-update(){
 
 ## mount-chroot {|--umount} [file system|name]
 ## support file systems: /home /tmp /sys /proc /dev/shm /dev/pts /dev
-## support name: vfs archives_dir
+## support names: vfs archives_dir
 ## NOTE: /tmp needs for applications which use X
 ##       vfs is virtual file systems
 ##       archives_dir uses to mount ${EXTERNAL_ARCHIVES_DIR} to ${ARCHIVES_DIR}
@@ -232,7 +232,7 @@ mount-chroot-umount(){
 	    [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] || \
     		umount ${BUILD_ROOT}${fs}
 	    if [ ! -z "$(mount | grep ${BUILD_ROOT}${fs})" ]; then
-		echo $"Retry lazy unmount ... "
+		echo $"Retry lazy unmount ${BUILD_ROOT}${fs} ... "
 		umount -l ${BUILD_ROOT}${fs}
 		echo $"done."
 	    fi
@@ -255,7 +255,7 @@ mount-chroot-umount(){
 	    [ -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ] || \
 		umount ${BUILD_ROOT}
 	    if [ ! -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ]; then
-		echo $"Retry lazy unmount ... "
+		echo $"Retry lazy unmount ${BUILD_ROOT} ... "
 		umount -l ${BUILD_ROOT}
 		echo $"done."
 	    fi
@@ -275,10 +275,10 @@ mount-chroot-mount(){
 
     case $fs in
 	/home)
-	    mnt_opts="-o rbind"
+	    mnt_opts="-o _netdev,rbind"
 	    ;;
 	*)
-	    mnt_opts="--bind"
+	    mnt_opts="--bind -o _netdev"
 	    ;;
     esac
 

+ 24 - 19
vbuilder.sh.in

@@ -313,7 +313,7 @@ apt-get-update(){
 
 ## mount-chroot {|--umount} [file system|name]
 ## support file systems: /home /tmp /sys /proc /dev/shm /dev/pts /dev
-## support name: vfs archives_dir
+## support names: vfs archives_dir
 ## NOTE: /tmp needs for applications which use X
 ##       vfs is virtual file systems
 ##       archives_dir uses to mount ${EXTERNAL_ARCHIVES_DIR} to ${ARCHIVES_DIR}
@@ -335,14 +335,19 @@ mount-chroot-umount(){
 	    [ -d ${BUILD_ROOT}${fs} ] || return 1
 	    [ -z "$(mount | grep ${BUILD_ROOT}${fs})" ] || \
     		umount ${BUILD_ROOT}${fs}
+	    if [ ! -z "$(mount | grep ${BUILD_ROOT}${fs})" ]; then
+		echo $"Retry lazy unmount ${BUILD_ROOT}${fs} ... "
+		umount -l ${BUILD_ROOT}${fs}
+		echo $"done."
+	    fi
 	    ;;
 	vfs)
-	    # for dir in /sys /proc /dev/shm /dev/pts /dev; do
-	    # 	mount-chroot-umount ${dir} || return 1
-	    # done
-	    [ -d ${BUILD_ROOT}/proc ] || return 1
-	    [ -z "$(mount | grep ${BUILD_ROOT}/proc)" ] || \
-		umount ${BUILD_ROOT}/proc
+	    for dir in /sys /proc /dev/shm /dev/pts /dev; do
+	    	mount-chroot-umount ${dir} || return 1
+	    done
+	    # [ -d ${BUILD_ROOT}/proc ] || return 1
+	    # [ -z "$(mount | grep ${BUILD_ROOT}/proc)" ] || \
+	    # 	umount ${BUILD_ROOT}/proc
 	    ;;
 	archives_dir)
 	    [ -d ${ARCHIVES_DIR} ] || return 1
@@ -354,7 +359,7 @@ mount-chroot-umount(){
 	    [ -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ] || \
 		umount ${BUILD_ROOT}
 	    if [ ! -z "$(mount | grep ${BUILD_ROOT} | grep unionfs)" ]; then
-		echo $"Retry lazy unmount ... "
+		echo $"Retry lazy unmount ${BUILD_ROOT} ... "
 		umount -l ${BUILD_ROOT}
 		echo $"done."
 	    fi
@@ -374,10 +379,10 @@ mount-chroot-mount(){
 
     case $fs in
 	/home)
-	    mnt_opts="-o rbind"
+	    mnt_opts="-o _netdev,rbind"
 	    ;;
 	*)
-	    mnt_opts="--bind"
+	    mnt_opts="--bind -o _netdev"
 	    ;;
     esac
 
@@ -388,10 +393,10 @@ mount-chroot-mount(){
 		mount ${mnt_opts} ${fs} ${BUILD_ROOT}${fs}
 	    ;;
 	vfs)
-	    # for dir in /dev /dev/pts /dev/shm /proc /sys; do
-	    # 	mount-chroot-mount ${dir} || return 1
-	    # done
-	    mount-chroot-mount /proc || return 1
+	    for dir in /dev /dev/pts /dev/shm /proc /sys; do
+	    	mount-chroot-mount ${dir} || return 1
+	    done
+	    # mount-chroot-mount /proc || return 1
 	    ;;
 	archives_dir)
 	    [ -d ${EXTERNAL_ARCHIVES_DIR} ] || mkdir -p ${EXTERNAL_ARCHIVES_DIR}
@@ -549,11 +554,11 @@ Build(){
 
     $__chroot_sh 'apt-get -qq -y install etcskel shadow-utils'
 
-    $__chroot_sh 'cd /dev && /sbin/MAKEDEV console'
-    $__chroot_sh 'cd /dev && /sbin/MAKEDEV null'
-    $__chroot_sh 'cd /dev && /sbin/MAKEDEV zero'
-    $__chroot_sh 'cd /dev && /sbin/MAKEDEV random'
-    $__chroot_sh 'cd /dev && /sbin/MAKEDEV urandom'
+    #$__chroot_sh 'cd /dev && /sbin/MAKEDEV console'
+    #$__chroot_sh 'cd /dev && /sbin/MAKEDEV null'
+    #$__chroot_sh 'cd /dev && /sbin/MAKEDEV zero'
+    #$__chroot_sh 'cd /dev && /sbin/MAKEDEV random'
+    #$__chroot_sh 'cd /dev && /sbin/MAKEDEV urandom'
 
     $__chroot_sh '/usr/sbin/pwconv'
     $__chroot_sh "/usr/sbin/useradd ${BUILD_USER}"