Skip to content

Commit

Permalink
Closes #27 Closes #35: Update VM to XUbuntu 18.04 64Bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ataffanel committed Nov 30, 2018
1 parent 58e61f1 commit 2a69e4b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"builders": [{
"type": "virtualbox-iso",
"vm_name": "{{user `vm-name`}}",
"guest_os_type": "Ubuntu",
"guest_os_type": "Ubuntu_64",
"format": "ova",
"guest_additions_mode": "disable",
"disk_size": "30000",
Expand All @@ -18,19 +18,18 @@
["storageattach", "{{.Name}}", "--storagectl", "SATA Controller", "--port", "0", "--nonrotational", "on", "--discard", "on"]
],

"iso_url": "xubuntu-14.04.4-desktop-i386.iso",
"iso_checksum": "2138d30d5978092b4c054ed623d54fdb",
"iso_url": "http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/mini.iso",
"iso_checksum": "8388f7232b400bdc80279668847f90da",
"iso_checksum_type": "md5",

"ssh_password": "{{user `password`}}",
"ssh_username": "{{user `user`}}",
"ssh_wait_timeout": "10000s",

"boot_command": [
"<enter><enter><esc><enter> <wait>",
"/casper/vmlinuz url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"hostname={{ .Name }} ",
"initrd=/casper/initrd.lz boot=casper automatic-ubiquity noprompt --<enter><wait>"
"<esc><wait>",
"install auto=true priority=critical url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
"<enter><wait>"
],
"boot_wait": "4s",
"http_directory": "http",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"password" : "crazyflie",
"vm-name": "BitcrazeVM",
"contentDir": "contentForVM",
"gccFile": "gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2",
"gccFile": "gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2",
"pycharmFile": "pycharm-community-2016.1.4.tar.gz",
"eclipseFile": "eclipse-cpp-mars-1-linux-gtk.tar.gz",
"eclipseFile": "eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz",
"eclipsePrj": "eclipse-project-files.tar.gz",
"openocd": "gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz"
},
Expand Down
25 changes: 6 additions & 19 deletions createBitcrazeVM.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#!/bin/bash
ISO_FILE="xubuntu-14.04.4-desktop-i386.iso"
ISO_URL="http://se.archive.ubuntu.com/mirror/cdimage.ubuntu.com/xubuntu/releases/14.04/release/$ISO_FILE"

PACKER_FILE="bitcrazeVM_xubuntu-14.04.4-desktop.json"
PACKER_URL="https://releases.hashicorp.com/packer/0.8.6/packer_0.8.6_linux_386.zip"

PACKER_FILE1=bitcrazeVM_xubuntu-14.04.4-desktop_createVM.json
PACKER_FILE2=bitcrazeVM_xubuntu-14.04.4-desktop_provisionVM.json
PACKER_FILE1=bitcrazeVM_createVM.json
PACKER_FILE2=bitcrazeVM_provisionVM.json

GCC_ARM_FILE="gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2"
GCC_ARM_URL="https://launchpad.net/gcc-arm-embedded/4.9/4.9-2014-q4-major/+download/$GCC_ARM_FILE"
GCC_ARM_FILE="gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2"
GCC_ARM_URL="https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/$GCC_ARM_FILE"

ECLIPSE_FILE="eclipse-cpp-mars-1-linux-gtk.tar.gz"
ECLIPSE_URL="http://saimei.acc.umu.se/mirror/eclipse.org/technology/epp/downloads/release/mars/1/$ECLIPSE_FILE"
ECLIPSE_FILE="eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz"
ECLIPSE_URL="http://ftp.halifax.rwth-aachen.de/eclipse//technology/epp/downloads/release/2018-09/R/$ECLIPSE_FILE"

ECLIPSE_GNU_ARM_PLUGIN_FILE="ilg.gnuarmeclipse.repository-2.12.1-201604190915.zip"
ECLIPSE_GNU_ARM_PLUGIN_URL="https://github.com/gnuarmeclipse/plug-ins/releases/download/v2.12.1-201604190915/$ECLIPSE_GNU_ARM_PLUGIN_FILE"
Expand Down Expand Up @@ -54,16 +51,6 @@ else
wget -P $CONTENT_DIR $GCC_ARM_URL
fi


#Download Pycharm (130MB) (only if it's not already downloaded)
if [ -f "$CONTENT_DIR$PYCHARM_FILE" ]
then
echo "$CONTENT_DIR$PYCHARM_FILE found. Continuing..."
else
echo "$CONTENT_DIR$PYCHARM_FILE not found. Starting download..."
wget -P $CONTENT_DIR $PYCHARM_URL
fi

#Download Eclipse (182MB) (only if it's not already downloaded)
if [ -f "$CONTENT_DIR$ECLIPSE_FILE" ]
then
Expand Down
6 changes: 3 additions & 3 deletions http/preseed.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ d-i user-setup/allow-password-weak boolean true
# Enable extras.ubuntu.com.
d-i apt-setup/extras boolean true
# Install the Ubuntu desktop.
tasksel tasksel/first multiselect ubuntu-desktop
tasksel tasksel/first multiselect xubuntu-core openssh-server

choose-mirror-bin mirror/http/proxy string

Expand All @@ -67,7 +67,7 @@ d-i pkgsel/upgrade select none
#d-i preseed/late_command string in-target apt-get install -y openssh-server
# ubiquity ubiquity/success_command string grep -wo url='[^[:space:]]*\.cfg' /proc/cmdline |sed 's,cfg$,sh,;s,url=,,' |xargs wget -qO- |sh
## The only method that works
ubiquity ubiquity/success_command string in-target apt-get install -y openssh-server
# ubiquity ubiquity/success_command string in-target apt-get install -y openssh-server

### Bootloader
d-i grub-installer/only_debian boolean true
Expand All @@ -76,4 +76,4 @@ d-i grub-installer/with_other_os boolean true
### Reboot after preseeding
d-i finish-install/reboot_in_progress note
ubiquity ubiquity/reboot boolean true
#ubiquity ubiquity/poweroff boolean true
#ubiquity ubiquity/poweroff boolean true
60 changes: 12 additions & 48 deletions provision.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
#!/bin/bash -x
sh -c 'echo deb http://luke.campagnola.me/debian dev/ > /etc/apt/sources.list.d/pyqtgraph.list'
# Add KiCad stable PPA
add-apt-repository --yes ppa:js-reynaud/kicad-4
add-apt-repository --yes ppa:js-reynaud/kicad-5

# Update keys and repos
apt-key update
apt-get update

#apt-get -y upgrade
apt-get -y install build-essential git gitg sdcc python2.7 python-pip python-usb python-qt4 python3-pyqt5 python3-numpy qt4-designer kicad libsdl2-dev openjdk-7-jdk meld leafpad dfu-util || { echo 'apt-get install failed' ; exit 1; }
#apt-get python-pyqtgraph #The following packages cannot be authenticated!
pip -y install pysdl2
apt-get -y install build-essential git gitg sdcc firefox python3-dev python3-pip python3-zmq python3-usb python3-pyqt5 python3-numpy qt4-designer kicad libsdl2-dev openjdk-11-jdk meld leafpad dfu-util openocd || { echo 'apt-get install failed' ; exit 1; }

# Works only on Ubuntu 15.04+
apt-get -y install python3 python3-usb python3-pyqt4 python3-pyqtgraph python3-zmq

# Necessary on Ubuntu 14.04
apt-get -y install python3 python3-pip python3-pyqt4 python3-zmq || { echo 'apt-get install failed' ; exit 1; }
pip3 install pyusb==1.0.0b2
pip3 install pyqtgraph
# To run 32bit programs
apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1

# Installing VirtualBox GuestAdditions
VBOX_ISO=VBoxGuestAdditions.iso
Expand All @@ -28,17 +20,6 @@ sh /tmp/isomount/VBoxLinuxAdditions.run
umount /tmp/isomount
rm -rf isomount ~/$VBOX_ISO

if [ $ENABLE_ROS -eq 1 ]; then
# Install ROS
echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list
apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 0xB01FA116
apt-get update
apt-get -y install ros-indigo-desktop-full libusb-1.0-0-dev
rosdep init
rosdep update
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
fi

# Adding udev rules for Crazyradio and Crazyflie
usermod -a -G plugdev $USER
sh -c 'echo SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"1915\", ATTRS{idProduct}==\"7777\", MODE=\"0664\", GROUP=\"plugdev\" > /etc/udev/rules.d/99-crazyradio.rules'
Expand All @@ -63,23 +44,6 @@ cd ~/
chown bitcraze:bitcraze -R projects
ln -s ~/projects ~/Desktop/projects

if [ $ENABLE_ROS -eq 1 ]; then
# Create a ROS workspace with the Loco Positioning projects
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
git clone git://github.com/bitcraze/lps-ros.git
git clone git://github.com/whoenig/crazyflie_ros
cd ~/catkin_ws
catkin_make
cd ~/
chown bitcraze:bitcraze -R ~/catkin_ws
chown -R bitcraze:bitcraze ~/.ros
ln -s ~/catkin_ws ~/Desktop/catkin_ws
echo 'echo -e "Setting up \e[1m\e[32m~/catkin_ws\e[0m ROS workspace."' >> ~/.bashrc
echo 'source $HOME/catkin_ws/devel/setup.sh' >> ~/.bashrc
fi

# Setup gcc-arm-none-eabi toolchain
tar --strip-components=1 -xjf gcc-arm-none-eabi-*.tar.bz2
mkdir -p ~/bin/gcc-arm-none-eabi
Expand All @@ -88,19 +52,19 @@ echo "\nPATH=\$PATH:$HOME/bin/gcc-arm-none-eabi/bin" >> ~/.profile
rm gcc-arm-none-eabi-*.tar.bz2

# Extract Eclipse
tar xf eclipse-cpp-mars-1-linux-gtk.tar.gz -C /opt
tar xf eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz -C /opt
echo "\nPATH=\$PATH:/opt/eclipse" >> ~/.profile
rm eclipse-cpp-mars-1-linux-gtk.tar.gz
rm eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz

# Extract OpenOCD and copy udev rules
mkdir -p /opt/gnuarmeclipse
tar xf gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz -C /opt/gnuarmeclipse
echo "\nPATH=\$PATH:/opt/gnuarmeclipse/openocd/0.9.0-201505190955/bin" >> ~/.profile
rm gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz
cp /opt/gnuarmeclipse/openocd/0.9.0-201505190955/contrib/99-openocd.rules /etc/udev/rules.d/
# mkdir -p /opt/gnuarmeclipse
# tar xf gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz -C /opt/gnuarmeclipse
# echo "\nPATH=\$PATH:/opt/gnuarmeclipse/openocd/0.9.0-201505190955/bin" >> ~/.profile
# rm gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz
# cp /opt/gnuarmeclipse/openocd/0.9.0-201505190955/contrib/99-openocd.rules /etc/udev/rules.d/

# Link scripts from openocd to config directory
ln -s /opt/gnuarmeclipse/openocd/0.9.0-201505190955/scripts ~/.openocd
# ln -s /opt/gnuarmeclipse/openocd/0.9.0-201505190955/scripts ~/.openocd

#Extract eclipse project folders
tar xf eclipse-project-files.tar.gz -C ~/
Expand Down

0 comments on commit 2a69e4b

Please sign in to comment.