demodulized and split chroot segment into new script to run under chroot