August 18, 2013

in-chroot script

This is one of those “use it so much I forget it’s there” scripts. I do a fair amount of system image and package building work. Both of these inevitably involve using chroot, and I can never remember the precise combination of remounts and copies you have to do to make the chroot work “properly”. Here’s the script I wrote to take care of it for me. It will sudo at the right points, and simply execs its arguments in the chroot (defaulting to /bin/bash if you don’t pass it anything). Read more