I hope this is in the right place.
What I've been doing is creating a customized live cd for my place of work. The guide that I have been using is found
here. I've had to make quite a few revisions to the cd and each time I have to go through the entire thing over again so I decided to try my hand at writing a script for it. (Note: Was a total linux virgin till 2 months ago).
The problem is that it runs until I get to a chroot command and then it seems to just exit out back to the terminal. Here is my script around that area :
sudo cp /etc/resolv.conf edit/etc/
sudo cp /etc/hosts edit/etc/
sudo mount --bind /dev/ edit/dev
sudo chroot edit
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devpts none /dev/pts
I put the -x option up near bash so I could see where it was breaking and this is the terminal output:
+ text=
+ breakmenu=
+ mkdir /home/ubuntu/live
mkdir: cannot create directory `/home/ubuntu/live': File exists
+ echo -n 'Path to the .iso > '
Path to the .iso > + read text
/home/ubuntu/Desktop/Releases/####.iso
+ cp /home/ubuntu/Desktop/Releases/####.iso /home/ubuntu/live
+ cd /home/ubuntu/live
+ mkdir mnt
+ sudo mount -o loop /home/ubuntu/Desktop/Releases/####.iso mnt
+ mkdir extract-cd
+ rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd
+ sudo unsquashfs mnt/casper/filesystem.squashfs
created 72746 files
created 10163 directories
created 11453 symlinks
created 95 devices
created 2 fifos
+ sudo mv squashfs-root edit
+ sudo cp /etc/resolv.conf edit/etc/
+ sudo cp /etc/hosts edit/etc/
+ sudo mount --bind /dev/ edit/dev
+ sudo chroot edit
root@ubuntu-desktop:/#
Can anyone help with this? I'm not entirely sure what to do with it to get it to not kick out. If it just is going to kick out regardless then I can always write another script to run, however I would rather keep it down to just one.
Thanks!