projects
/
grml-scripts.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release new version 2.7.1
[grml-scripts.git]
/
usr_sbin
/
grml-chroot
diff --git
a/usr_sbin/grml-chroot
b/usr_sbin/grml-chroot
index
b3d1184
..
17f3d3c
100755
(executable)
--- a/
usr_sbin/grml-chroot
+++ b/
usr_sbin/grml-chroot
@@
-45,8
+45,8
@@
function mountit
local all_options_=""
local all_options_=""
- if [[ $options_ == "--bind" ]]; then
- all_options_="--bind $type_"
+ if [[ $options_ == "--
r
bind" ]]; then
+ all_options_="--
r
bind $type_"
else
all_options_="-t $type_ none"
fi
else
all_options_="-t $type_ none"
fi
@@
-56,7
+56,7
@@
function mountit
function umount_all
{
for i in $MOUNTED_; do
function umount_all
{
for i in $MOUNTED_; do
- umount "${DEST_}/$i"
+ umount
--recursive
"${DEST_}/$i"
done
}
done
}
@@
-87,7
+87,15
@@
fi
mountit "proc" "proc"
mountit "sysfs" "sys"
mountit "proc" "proc"
mountit "sysfs" "sys"
-mountit "/dev" "dev" "--bind"
+mountit "/dev" "dev" "--rbind"
+
+WROTE_DEBIAN_CHROOT=""
+if [ ! -f "$DEST_"/etc/debian_chroot ]; then
+ WROTE_DEBIAN_CHROOT="yes"
+ echo "Writing /etc/debian_chroot ..."
+ cat "$DEST_"/etc/hostname > "$DEST_"/etc/debian_chroot
+fi
+
if (( $# < 1 )); then
chroot "$DEST_"
RC=$?
if (( $# < 1 )); then
chroot "$DEST_"
RC=$?
@@
-97,4
+105,8
@@
else
fi
umount_all
fi
umount_all
+if [ ! -z "$WROTE_DEBIAN_CHROOT" ]; then
+ rm "$DEST_"/etc/debian_chroot
+fi
+
exit $RC
exit $RC