mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
OP-1844 - vagrant dev workstation: initial push
This commit is contained in:
parent
2571db4d96
commit
a80795b4dd
35
make/vagrant/vagrant_openpilot_dev/README
Normal file
35
make/vagrant/vagrant_openpilot_dev/README
Normal file
@ -0,0 +1,35 @@
|
||||
vagrant_openpilot_dev - provides a Vagrant box with everything needed to compile OpenPilot code base.
|
||||
|
||||
username: vagrant
|
||||
password: vagrant
|
||||
|
||||
For details of an OpenPilot development environment please refer to the Development Manual https://wiki.openpilot.org/display/WIKI/OpenPilot+Developer+Manual.
|
||||
|
||||
To enable Android Studio and Java, edit file install-tools.sh and set ANDROID_ENV=true. You might also want to adjust for the versions it downloads.
|
||||
|
||||
If you would like for VirtualBox window to open, this can be useful for running apps, set 'vb.gui = true' in Vagrantfile.
|
||||
|
||||
Starting
|
||||
|
||||
$ vagrant up
|
||||
|
||||
Once your machine has started up you can ssh into it or log into Xfce (assuing you set vb.gui = true). Any changes you make persist in the Vagrant VM, when you are done run 'vagrant halt', this will turn off the vm and persist your changes.
|
||||
|
||||
$ vagrant ssh
|
||||
|
||||
To begin with Openpilot base source is checked out into ~/workspace/openpilot/OpenPilot. Run the following command to get the rest of the tools in place (this will take a bit of time):
|
||||
|
||||
make all_sdk_install
|
||||
|
||||
You are now ready to browse the code.
|
||||
|
||||
If you wish to start all over:
|
||||
$ vagrant halt
|
||||
$ vagrant destroy
|
||||
|
||||
For more information about OpenPilot please visit the forums at http://forums.openpilot.org.
|
||||
|
||||
For more informatin about Vagrant please visit http://docs.vagrantup.com/.
|
||||
|
||||
Based off https://github.com/steveliles/vagrant-boxes/blob/master/debian-android-studio/install-tools.sh
|
||||
|
35
make/vagrant/vagrant_openpilot_dev/Vagrantfile
vendored
Normal file
35
make/vagrant/vagrant_openpilot_dev/Vagrantfile
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
VAGRANTFILE_API_VERSION = "2"
|
||||
|
||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||
|
||||
config.vm.box = "ubuntu/trusty64"
|
||||
#config.vm.box = "jhartman/xubuntu14.04.1"
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.gui = true
|
||||
vb.customize ["modifyvm", :id, "--memory", "4096"]
|
||||
end
|
||||
|
||||
#config.vm.synced_folder "../../projects", "/home/vagrant/projects"
|
||||
|
||||
config.vm.provision :shell, :path => "bootstrap.sh"
|
||||
|
||||
config.ssh.forward_x11=true
|
||||
|
||||
# update definitions
|
||||
config.vm.provision "shell", inline: "apt-get update"
|
||||
|
||||
# just the basic desktop environment. if you want the addons, you can install them later
|
||||
config.vm.provision "shell", inline: "apt-get install xubuntu-desktop --no-install-recommends --assume-yes"
|
||||
|
||||
# otherwise icons don't get loaded
|
||||
config.vm.provision "shell", inline: "apt-get install xubuntu-icon-theme --assume-yes"
|
||||
|
||||
#activate logon with gui and reboot
|
||||
config.vm.provision "shell", inline: "dpkg-reconfigure lightdm"
|
||||
config.vm.provision "shell", inline: "reboot"
|
||||
|
||||
end
|
19
make/vagrant/vagrant_openpilot_dev/bootstrap.sh
Normal file
19
make/vagrant/vagrant_openpilot_dev/bootstrap.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
apt-get update
|
||||
apt-get -y upgrade
|
||||
|
||||
# get ourselves some basic toys
|
||||
apt-get -y install git-core build-essential openssl libssl-dev subversion
|
||||
|
||||
# install some tools for the vagrant user only by executing
|
||||
# a script AS the vagrant user
|
||||
cp /vagrant/install-tools.sh /home/vagrant
|
||||
chown vagrant /home/vagrant/install-tools.sh
|
||||
chgrp vagrant /home/vagrant/install-tools.sh
|
||||
chmod ug+x /home/vagrant/install-tools.sh
|
||||
su -c "/home/vagrant/install-tools.sh" vagrant
|
||||
|
||||
# set up udev rules for known android device manufacturers
|
||||
cat /vagrant/51-android.rules > /etc/udev/rules.d/51-android.rules
|
||||
chmod a+r /etc/udev/rules.d/51-android.rules
|
74
make/vagrant/vagrant_openpilot_dev/install-tools.sh
Normal file
74
make/vagrant/vagrant_openpilot_dev/install-tools.sh
Normal file
@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ANDROID_ENV=true
|
||||
ANDROID_STUDIO_VERSION=1.1.0
|
||||
ANDROID_STUDIO_BUILD=135.1740770
|
||||
ANDROID_STUDIO_FILE=android-studio-ide-$ANDROID_STUDIO_BUILD-linux.zip
|
||||
|
||||
ANDROID_SDK_VERSION=r24.1.2
|
||||
ANDROID_SDK_FILE=android-sdk_$ANDROID_SDK_VERSION-linux.tgz
|
||||
ANDROID_SDK_URL=http://dl.google.com/android/${ANDROID_SDK_FILE}
|
||||
ANDROID_API_LEVELS=android-20,android-21,android-22
|
||||
ANDROID_BUILD_TOOLS_VERSION=21.1.2
|
||||
|
||||
sudo apt-get -y install curl build-essential gdb wget \
|
||||
debhelper p7zip-full unzip flex bison libsdl1.2-dev libudev-dev libusb-1.0-0-dev libc6-i386
|
||||
|
||||
|
||||
if [ "$ANDROID_ENV" = "true" ]; then
|
||||
|
||||
# install java7
|
||||
sudo echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/webupd8team-java.list
|
||||
sudo echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
|
||||
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
|
||||
sudo apt-get update
|
||||
# accept the license agreement
|
||||
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
|
||||
|
||||
sudo apt-get -y install oracle-java7-installer
|
||||
|
||||
# make a place to install development tools
|
||||
mkdir -p ~/workspace/tools
|
||||
cd ~/workspace/tools
|
||||
|
||||
# download and unpack android-studio
|
||||
wget https://dl.google.com/dl/android/studio/ide-zips/$ANDROID_STUDIO_VERSION/$ANDROID_STUDIO_FILE
|
||||
unzip $ANDROID_STUDIO_FILE
|
||||
rm $ANDROID_STUDIO_FILE
|
||||
|
||||
# create a launcher for android-studio
|
||||
mkdir /home/vagrant/Desktop/
|
||||
echo "[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=Android-Studio
|
||||
Comment=
|
||||
Exec=/home/vagrant/workspace/tools/android-studio/bin/studio.sh
|
||||
Icon=/home/vagrant/workspace/tools/android-studio/bin/idea.png
|
||||
Path=/home/vagrant/workspace/tools/android-studio
|
||||
Terminal=false
|
||||
StartupNotify=false
|
||||
GenericName=" >> "/home/vagrant/Desktop/Android-Studio.desktop"
|
||||
|
||||
chmod u+x /home/vagrant/Desktop/Android-Studio.desktop
|
||||
|
||||
# download android sdk
|
||||
wget http://dl.google.com/android/$ANDROID_SDK_FILE
|
||||
tar -zxf $ANDROID_SDK_FILE
|
||||
rm $ANDROID_SDK_FILE
|
||||
|
||||
# install android sdk extras to get google libs
|
||||
ANDROID=/home/vagrant/workspace/tools/android-sdk-linux/tools/android
|
||||
echo y | $ANDROID update sdk --no-ui --filter extra-android-support,extra-android-m2repository,extra-google-m2repository,tools,platform-tools,${ANDROID_API_LEVELS},build-tools-${ANDROID_BUILD_TOOLS_VERSION},build-tools-20.0.0
|
||||
|
||||
fi
|
||||
|
||||
|
||||
mkdir -p ~/workspace/openpilot
|
||||
cd ~/workspace/openpilot
|
||||
git clone git://git.openpilot.org/OpenPilot.git
|
||||
cd OpenPilot
|
||||
git checkout -b next origin/next
|
||||
git pull
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user