[xen-tools-discuss] Roles and many chroot commands

Bubba Sour bubbasour at gmail.com
Fri Sep 7 00:05:40 CEST 2012


Hi,

Many of my commands have to be in the chrooted environment for the dest
host, e.g.: chroot $prefix cmd arg1

If I have many of these chrooted commands it quickly become tedious to
prepend each with chroot prefix, so there are probably better ways of doing
this?

I have tried this, but it doesn't work, and the installation process seem
to hang:

#!/bin/sh
if [ -e /usr/lib/xen-tools/common.sh ]; then
    . /usr/lib/xen-tools/common.sh
else
    echo "Installation problem"
fi
chroot ${prefix} /usr/bin/apt-get update

chroot ${prefix} /bin/bash -e -x

command 1
command 2
...

exit


Are there any better way of executing several chrooted commands?

Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://xen-tools.org/pipermail/xen-tools-discuss/attachments/20120907/1620ed13/attachment.html>


More information about the xen-tools-discuss mailing list