Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c9836cff2c
Fetching contributors…

Cannot retrieve contributors at this time

executable file 51 lines (39 sloc) 1.203 kb
#!/bin/bash
#
# Copyright (c) 2009-2012 VMware, Inc.
srcdir=$(dirname $(readlink -nf $0))
basedir=$(dirname $(readlink -nf ${srcdir/..}))
libdir=$basedir/lib
skeleton=$basedir/skeleton
. ${libdir}/helpers.sh
if [ $# -ne 2 ]
then
echo "Usage: env `basename $0` [chroot_target] [lib_dir]"
exit 1
fi
if [ `id -u` -ne "0" ]
then
echo "Sorry, you need to be root"
exit 1
fi
target=$1
lib_dir=$2
if [ ! -d $lib_dir ]
then
echo "Instance directory $lib_dir doesn't exist or isn't a directory"
exit 1
fi
# Set up mounts
mount --bind /dev $target/dev
mount --bind /dev/pts $target/dev/pts
chroot $target mount -t proc proc /proc
add_on_exit "umount ${target}/proc $target/dev/pts $target/dev"
# Prevent daemons from starting
disable_daemon_startup $target $skeleton
add_on_exit "enable_daemon_startup $target"
# aws specific packages(grub is not actually installed, we just need /boot/grub/menu.lst for pv-grub)
export DEBIAN_FRONTEND=noninteractive
run_in_chroot $target "apt-get install -y --force-yes --no-install-recommends grub-pc grub-legacy-ec2"
mkdir -p $target/var/vcap/bosh/src
cp -r $lib_dir/aws $target/var/vcap/bosh/src/
chroot $target /var/vcap/bosh/src/aws/configure_aws.sh
Jump to Line
Something went wrong with that request. Please try again.