split script into inner and outer chroot-script

fixes some bugfixes and typos