projects
/
grml-scripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b29ab24
)
grml-chroot: write /etc/debian_chroot [Closes: issue953]
author
Christian Hofstaedtler
<ch@grml.org>
Mon, 7 Nov 2011 11:56:24 +0000
(12:56 +0100)
committer
Christian Hofstaedtler
<ch@grml.org>
Mon, 7 Nov 2011 11:56:48 +0000
(12:56 +0100)
usr_sbin/grml-chroot
patch
|
blob
|
history
diff --git
a/usr_sbin/grml-chroot
b/usr_sbin/grml-chroot
index
b3d1184
..
e9c1ae3
100755
(executable)
--- a/
usr_sbin/grml-chroot
+++ b/
usr_sbin/grml-chroot
@@
-88,6
+88,14
@@
fi
mountit "proc" "proc"
mountit "sysfs" "sys"
mountit "/dev" "dev" "--bind"
+
+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=$?
@@
-97,4
+105,8
@@
else
fi
umount_all
+if [ ! -z "$WROTE_DEBIAN_CHROOT" ]; then
+ rm "$DEST_"/etc/debian_chroot
+fi
+
exit $RC