chroot rewritten (not tested)