From: Michael Prokop Date: Wed, 10 May 2017 13:53:35 +0000 (+0200) Subject: grml-chroot: mount /dev/pts as devpts inside chroot X-Git-Tag: v2.7.1~1 X-Git-Url: https://git.grml.org/?a=commitdiff_plain;h=f29c425ad79cbe31fca61397cbd3d97347f32cd7;p=grml-scripts.git grml-chroot: mount /dev/pts as devpts inside chroot Fixes: | E: Can not write log (Is /dev/pts mounted?) - posix_openpt (2: No such file or directory) Thanks: AndrĂ¡s Korn for proposing the --rbind/--recursive approach --- diff --git a/usr_sbin/grml-chroot b/usr_sbin/grml-chroot index e9c1ae3..17f3d3c 100755 --- a/usr_sbin/grml-chroot +++ b/usr_sbin/grml-chroot @@ -45,8 +45,8 @@ function mountit local all_options_="" - if [[ $options_ == "--bind" ]]; then - all_options_="--bind $type_" + if [[ $options_ == "--rbind" ]]; then + all_options_="--rbind $type_" else all_options_="-t $type_ none" fi @@ -56,7 +56,7 @@ function mountit function umount_all { for i in $MOUNTED_; do - umount "${DEST_}/$i" + umount --recursive "${DEST_}/$i" done } @@ -87,7 +87,7 @@ fi mountit "proc" "proc" mountit "sysfs" "sys" -mountit "/dev" "dev" "--bind" +mountit "/dev" "dev" "--rbind" WROTE_DEBIAN_CHROOT="" if [ ! -f "$DEST_"/etc/debian_chroot ]; then