attempt to fix path issues

This commit is contained in:
Jesse Andrews 2011-10-31 11:59:55 -07:00
parent 97c84744ce
commit 04156dbe86

View file

@ -10,6 +10,10 @@ FORMAT=${FORMAT:-qcow2}
ROOTSIZE=${ROOTSIZE:-2000} ROOTSIZE=${ROOTSIZE:-2000}
MIN_PKGS=${MIN_PKGS:-"apt-utils gpgv openssh-server"} MIN_PKGS=${MIN_PKGS:-"apt-utils gpgv openssh-server"}
# Keep track of the current directory
TOOLS_DIR=$(cd $(dirname "$0") && pwd)
TOP_DIR=`cd $TOOLS_DIR/..; pwd`
usage() { usage() {
echo "Usage: $0 - Prepare Ubuntu images" echo "Usage: $0 - Prepare Ubuntu images"
echo "" echo ""
@ -31,7 +35,7 @@ while getopts f:hmr: c; do
m) MINIMAL=1 m) MINIMAL=1
;; ;;
r) ROOTSIZE=$OPTARG r) ROOTSIZE=$OPTARG
if $(( ROOTSIZE < 2000 )); then if [[ $ROOTSIZE < 2000 ]]; then
echo "root size must be greater than 2000MB" echo "root size must be greater than 2000MB"
exit 1 exit 1
fi fi
@ -108,7 +112,7 @@ if [ ! -e $CACHEDIR/$UEC_NAME-disk1.img ]; then
mount -t ext4 ${NBD}p1 $MNTDIR mount -t ext4 ${NBD}p1 $MNTDIR
# Install our required packages # Install our required packages
cp -p files/sources.list $MNTDIR/etc/apt/sources.list cp -p $TOP_DIR/files/sources.list $MNTDIR/etc/apt/sources.list
sed -e "s,%DIST%,$DIST_NAME,g" -i $MNTDIR/etc/apt/sources.list sed -e "s,%DIST%,$DIST_NAME,g" -i $MNTDIR/etc/apt/sources.list
cp -p /etc/resolv.conf $MNTDIR/etc/resolv.conf cp -p /etc/resolv.conf $MNTDIR/etc/resolv.conf
chroot $MNTDIR apt-get update chroot $MNTDIR apt-get update