Make chrootscript() more independent
authorMichael Prokop <mika@grml.org>
Mon, 16 Apr 2007 11:18:04 +0000 (13:18 +0200)
committerMichael Prokop <mika@grml.org>
Mon, 16 Apr 2007 11:18:04 +0000 (13:18 +0200)
grml-debootstrap

index f57b0c7..7a5c9f0 100644 (file)
@@ -232,9 +232,17 @@ preparechroot() {
 
 # execute chroot-script {{{
 chrootscript() {
 
 # execute chroot-script {{{
 chrootscript() {
-  einfo "Executing chroot-script now"
-  chroot "$MNTPOINT" /bin/chroot-script
-  eend $?
+  if ! [ -r "$MNTPOINT/bin/chroot-script" ] ; then
+     mount_target
+  fi
+  if [ -x "$MNTPOINT/bin/chroot-script" ] ; then
+     einfo "Executing chroot-script now"
+     chroot "$MNTPOINT" /bin/chroot-script
+     eend $?
+  else
+     eerror "Fatal: $MNTPOINT/bin/chroot-script could not be found."
+     eend 1
+  fi
 }
 # }}}
 
 }
 # }}}