Prefer using systemd-nspawn, as it will do everything this script does and more.
Eliminates the need to manually perform mundane tasks when chrooting.
- Mounts /dev, /sys, /proc , /run and /sys/firmware/efi/efivars (if exists)
- Unmounts on exit.
- Sources the chroot's /etc/profile.