Added Vagrantfile to define a standardized Ubuntu 12.04 32-bit

development environment.

Added a script, install-prereqs-ubuntu.sh, that installs all packages
and software required for development on AVR and PX4 platforms.

pch: rebased pullreq 183
This commit is contained in:
John Wiseman 2013-04-04 10:52:39 -07:00 committed by Pat Hickey
parent 50ccaadbc4
commit 8eb097a53c
2 changed files with 80 additions and 0 deletions

View File

@ -0,0 +1,65 @@
#!/bin/bash
set -e
BASE_PKGS="gawk make git arduino-core curl"
SITL_PKGS="g++"
PX4_PKGS="python-serial python-argparse openocd flex bison libncurses5-dev \
autoconf texinfo build-essential libftdi-dev libtool zlib1g-dev \
genromfs"
ASSUME_YES=false
function maybe_prompt_user() {
if $ASSUME_YES; then
return 0
else
read -p "$1"
if [[ $REPLY =~ ^[Yy]$ ]]; then
return 0
else
return 1
fi
fi
}
OPTIND=1 # Reset in case getopts has been used previously in the shell.
while getopts "y" opt; do
case "$opt" in
\?)
exit 1
;;
y) ASSUME_YES=true
;;
esac
done
if $ASSUME_YES; then
APT_GET="sudo apt-get --assume-yes"
else
APT_GET="sudo apt-get"
fi
$APT_GET update
$APT_GET install $BASE_PKGS $SITL_PKGS $PX4_PKGS
if [ ! -d ~/PX4-Firmware ]; then
git clone git://github.com/PX4/Firmware.git ~/PX4-Firmware
fi
if [ ! -d ~/gcc-arm-none-eabi-4_6-2012q2 ]; then
ARM_TARBALL=gcc-arm-none-eabi-4_6-2012q2-20120614.tar.bz2
(
cd ~;
curl -OL "https://launchpad.net/gcc-arm-embedded/4.6/4.6-2012-q2-update/+download/$ARM_TARBALL";
tar xjf ${ARM_TARBALL};
rm ${ARM_TARBALL};
)
fi
exportline="export PATH=$HOME/gcc-arm-none-eabi-4_6-2012q2/bin:\$PATH";
if ! grep -Fxq "$exportline" ~/.profile ; then
if maybe_prompt_user "Add $HOME/gcc-arm-none-eabi-4_6-2012q2/bin to your PATH [Y/n]?" ; then
echo $exportline >> ~/.profile
else
echo "Skipping adding $HOME/gcc-arm-none-eabi-4_6-2012q2/bin to PATH."
fi
fi

15
Vagrantfile vendored Normal file
View File

@ -0,0 +1,15 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "ubuntu-12.04-32bit"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.share_folder("ardupilot", "~/ardupilot", ".")
# Allow symlinks
config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/cross-compiler", "1"]
# Otherwise the compile will go into swap, making things slow
config.vm.customize ["modifyvm", :id, "--memory", "2048"]
end