From: Christian Hofstaedtler Date: Mon, 7 Nov 2011 11:56:24 +0000 (+0100) Subject: grml-chroot: write /etc/debian_chroot [Closes: issue953] X-Git-Tag: v2.0.2~5 X-Git-Url: http://git.grml.org/?p=grml-scripts.git;a=commitdiff_plain;h=01e3fafa6cfa747d4fc8d21fc13df200e0ed137d grml-chroot: write /etc/debian_chroot [Closes: issue953] --- diff --git a/usr_sbin/grml-chroot b/usr_sbin/grml-chroot index b3d1184..e9c1ae3 100755 --- 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