X-Git-Url: http://git.grml.org/?a=blobdiff_plain;ds=sidebyside;f=usr_sbin%2Fgrml-chroot;fp=usr_sbin%2Fgrml-chroot;h=e9c1ae35e054d780f04af08171f5110bc1c1a703;hb=01e3fafa6cfa747d4fc8d21fc13df200e0ed137d;hp=b3d118487a399f0cc277229aed2fe91ae62460a7;hpb=b29ab244d97f03b7219a758b4b096df9aa0065f7;p=grml-scripts.git 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