Chroot in shell scripts: Ensuring that subsequent commands execute within the chroot
I currently am writing a shell script to install and configure a full system without Ubiquity and have run into a roadblock: When the script gets to the chroot (that being "sudo chroot <install drive mount point>, inside the chroot nothing happens. It just leaves me with the main prompt. Any ideas on how to fix this?
|
The manual page says 'chroot NEWROOT [COMMAND...]' as in 'sudo chroot echo "Hello World!";'? meaning you can either run a command directly or drop a shell script in the chroot and execute that.
|
sry for being slow with this.
just to clarify, so where one might normally add /bin/bash, one can replace it with a script? like in my case the line: Code:
chroot /mnt/$DISTRONAME /bin/bash Code:
chroot /mnt/$DISTRONAME witchroot does that seem right? or would the ~ no, i'll simply ask that^ before i get any more confused. ...also... i wonder if there's a way (~sorry, perhaps veering somewhat off-topic with this~) to pass variables to the chrooted environment too. is there? |
All times are GMT -5. The time now is 01:51 PM. |