X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_sbin%2Fgrml-chroot;h=e8ed430a61378f635c6c442fca91a74c3a34159b;hb=7bbfe5432568c69c9e4641466b52b9f6dcb6ee4e;hp=6e292d5129679f5f47383be520bb27623a226400;hpb=3559bd707848cb41e6e0de2432db793385a26edf;p=grml-scripts.git diff --git a/usr_sbin/grml-chroot b/usr_sbin/grml-chroot index 6e292d5..e8ed430 100755 --- a/usr_sbin/grml-chroot +++ b/usr_sbin/grml-chroot @@ -90,10 +90,21 @@ if [ ! -d "$DEST_" ]; then fi -mountit "proc" "proc" -mountit "sysfs" "sys" -mountit "/dev" "dev" "--bind" -mountit "devpts" "dev/pts" + +if [ -f "$DEST_"/proc/cmdline ] ; then + echo "Looks like $DEST_ already has filesystems mounted, skipping." +else + mountit "proc" "proc" + mountit "sysfs" "sys" + mountit "/dev" "dev" "--bind" + mountit "devpts" "dev/pts" + if [ -d /sys/firmware/efi/efivars ] ; then + mountit "efivarfs" "sys/firmware/efi/efivars" + fi + if [ -d "$DEST_"/run/udev ] && [ -d /run/udev ] ; then + mountit "/run/udev" "/run/udev" "--bind" + fi +fi WROTE_DEBIAN_CHROOT="" if [ ! -f "$DEST_"/etc/debian_chroot ]; then