Merge submodule contents for solo-builder/master

This commit is contained in:
Matt 2019-01-05 11:58:56 -05:00
commit 8ca0b95f8d
19 changed files with 974 additions and 0 deletions

17
solo-builder/.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
ssh/
# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
instance.json
inventory
id_rsa*
solo-builder.pem
staging/
.vagrant/
vagrant_ansible_inventory_default
accessorykit
packages/
upload/

View File

@ -0,0 +1,21 @@
Copyright 2015-2016 3D Robotics
Licensed under the Apache License, Version 2.0 (the "License");
you may not use these files except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
~~~~
Contributors prior to public release:
* Tim Ryan
* Liam Staskawicz
* Allan Matthew

36
solo-builder/Dockerfile Normal file
View File

@ -0,0 +1,36 @@
# Latest Ubuntu 14.04LTS
FROM ubuntu:trusty
RUN \
apt-get update && \
apt-get install --no-install-recommends -y software-properties-common && \
apt-add-repository ppa:ansible/ansible && \
apt-get update && \
apt-get install -y ansible
RUN echo '[local]\nlocalhost\n' > /etc/ansible/hosts
RUN \
adduser --disabled-password --gecos '' ubuntu && \
adduser ubuntu sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
COPY playbook.yml /provision/
COPY ansible.cfg /provision/
COPY ansible.gitconfig /provision/
COPY builder.sh /provision/
RUN chown -R ubuntu /provision/
COPY id_rsa /home/ubuntu/.ssh/
COPY solo-builder.pem /home/ubuntu/.ssh/
RUN chown -R ubuntu /home/ubuntu && chmod 0400 /home/ubuntu/.ssh/*
RUN \
su -l ubuntu -c "\
export HOME=/home/ubuntu && \
cd /provision && \
eval \`ssh-agent\` && \
ssh-add ~/.ssh/id_rsa && \
ssh-add ~/.ssh/solo-builder.pem && \
ansible-playbook -i "localhost," -c local playbook.yml"

202
solo-builder/LICENSE-APACHE Normal file
View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

88
solo-builder/README.md Normal file
View File

@ -0,0 +1,88 @@
WARNING - WORK IN PROGRESS
```
This code is known to be high risk , but also early-adopter friendly.
We will remove this warning from the repository when it is no longer required.
```
# solo-builder
## Quick start guide
You may find the following "quick start" guide useful. You can find the [Open Solo Quick Start Guide](http://ardupilot.org/dev/docs/solo-opensolo-quickstart.html) on ardupilot.org.
## Using vagrant
Works in [vagrant](http://vagrantup.com), typically useful for local builds.
First install this plugin:
```
$ vagrant plugin install vagrant-guest_ansible
$ vagrant up
```
(If `vagrant up` fails, run `vagrant provision` to try provisioning your VM
again.)
To fire off the builder:
```
$ vagrant ssh -c /vagrant/builder.sh
```
## Using docker
DOCKER IS UNTESTED OUTSIDE 3DR , USE VAGRANT FOR NOW.
Works in Docker and boot2docker.
Copy `id_rsa` and `solo-builder.pem` to this directory (sorry). Then run
```
docker build -t 3drobotics/solo-builder .
```
Then run
```
docker run -i 3drobotics/solo-builder su -l ubuntu /solo-build/builder.sh
```
TODO: write a script that gets the files off after
## Using something else
`playbook.yml` is an ansible file for an Ubuntu 14.04 distro. `builder.sh` is the build script for a user named `ubuntu`. Make it happen!
## Repos
3dr Private:
* https://github.com/3drobotics/mavlink-solo
* https://github.com/3drobotics/sculpture_proprietary
* https://github.com/3drobotics/solo-gimbal
* https://github.com/3drobotics/artoo
* https://github.com/3drobotics/SoloLink
Public:
* https://github.com/3drobotics/imx6-uboot
* https://github.com/3drobotics/imx6-linux
* https://github.com/3drobotics/MAVProxy
* https://github.com/3drobotics/stm32loader
* https://github.com/3drobotics/ardupilot-solo
* https://github.com/OpenSolo/ardupilot-solo
* https://github.com/OpenSolo/sololink
* https://github.com/OpenSolo/artoo
* https://github.com/OpenSolo/imx6-uboot
* https://github.com/OpenSolo/imx6-linux
* https://github.com/OpenSolo/3dr-arm-yocto-bsp
* https://github.com/OpenSolo/meta-3dr
* https://github.com/OpenSolo/dronekit-python-solo
* https://github.com/OpenSolo/sololink-python
* https://github.com/OpenSolo/solo-builder
* https://github.com/OpenSolo/3dr-yocto-bsb-base
* https://github.com/OpenSolo/stm32loader
* https://github.com/OpenSolo/MAVProxy

1
solo-builder/SOURCE Normal file
View File

@ -0,0 +1 @@
This source code was released by 3DR in the file: solo-builder_5444ac08.tar.gz

50
solo-builder/Vagrantfile vendored Normal file
View File

@ -0,0 +1,50 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.box_check_update = false
config.vm.provision "shell", path: "install-vagrant-deps.sh"
# detect number of cores,
# http://stackoverflow.com/questions/891537/detect-number-of-cpus-installed
def self.processor_count
case RbConfig::CONFIG['host_os']
when /darwin9/
`hwprefs cpu_count`.to_i
when /darwin/
((`which hwprefs` != '') ? `hwprefs thread_count` : `sysctl -n hw.ncpu`).to_i
when /linux/
`cat /proc/cpuinfo | grep processor | wc -l`.to_i
when /freebsd/
`sysctl -n hw.ncpu`.to_i
when /mswin|mingw/
require 'win32ole'
wmi = WIN32OLE.connect("winmgmts://")
cpu = wmi.ExecQuery("select NumberOfCores from Win32_Processor") # TODO count hyper-threaded in this
cpu.to_enum.first.NumberOfCores
end
end
# fwd host ssh for git access
config.ssh.forward_agent = true
config.vm.provider "virtualbox" do |vb|
# not recommended to use less than 6GB
vb.memory = "6144"
vb.cpus = processor_count
end
config.vm.provision "guest_ansible" do |ansible|
ansible.extra_vars = {
build_dir_owner: "vagrant"
}
ansible.playbook = "playbook.yml"
end
end

11
solo-builder/WARNING.md Normal file
View File

@ -0,0 +1,11 @@
WARNING - WORK IN PROGRESS
```
This code is known to be broken and/or incomplete. IT DOES NOT WORK.
We are actively working on fixing it, and we really, really do not recommend you download it just yet.
We will remove this warning from the repository when it is no longer required.
```

90
solo-builder/alt_sync.sh Executable file
View File

@ -0,0 +1,90 @@
#!/bin/bash
# alternative to the 'sync' tool, which puts stuff in /solo-build, for now we'll use /solo-build-alt
#
# 'master', 'tags/2.9.94' ( for a tag) or '2.9.94' ( for a branch ) is ok:
set -xv
name=$1
echo "git reference: $name"
#
sudo mkdir /solo-build-alt
sudo chown vagrant /solo-build-alt
cd /solo-build-alt
echo "----------------------------------------------------------------------------"
mkdir -p sources/poky
git clone git://git.yoctoproject.org/poky sources/poky 2>&1 | grep -v 'fatal'
cd sources/poky
git fetch
git checkout bee7e3756adf70edaeabe9d43166707aab84f581 2>&1
cd ../..
echo "----------------------------------------------------------------------------"
mkdir -p sources/meta-fsl-arm
git clone git://git.yoctoproject.org/meta-fsl-arm sources/meta-fsl-arm 2>&1 | grep -v 'fatal'
cd sources/meta-fsl-arm
git fetch
git checkout af392c22bf6b563525ede4a81b6755ff1dd2c1c6 2>&1
cd ../..
echo "----------------------------------------------------------------------------"
mkdir -p sources/meta-openembedded
git clone git://git.openembedded.org/meta-openembedded sources/meta-openembedded 2>&1 | grep -v 'fatal'
cd sources/meta-openembedded
git fetch
git checkout eb4563b83be0a57ede4269ab19688af6baa62cd2 2>&1
cd ../..
echo "----------------------------------------------------------------------------"
mkdir -p sources/base
git clone git://github.com/OpenSolo/3dr-yocto-bsp-base sources/base 2>&1 | grep -v 'fatal'
cd sources/base
git fetch
echo git checkout $name 2>&1
git checkout $name 2>&1
cd ../..
cp sources/base/README.md .
cp sources/base/setup-environment .
echo "----------------------------------------------------------------------------"
mkdir -p sources/meta-3dr
git clone git://github.com/OpenSolo/meta-3dr sources/meta-3dr 2>&1 | grep -v 'fatal'
cd sources/meta-3dr
git fetch
echo git checkout $name 2>&1
git checkout $name 2>&1
git pull origin
cd ../..
echo "----------------------------------------------------------------------------"
mkdir -p sources/meta-fsl-arm-extra
git clone git://github.com/Freescale/meta-fsl-arm-extra sources/meta-fsl-arm-extra 2>&1 | grep -v 'fatal'
cd sources/meta-fsl-arm-extra
git fetch
git checkout 07ad83db0fb67c5023bd627a61efb7f474c52622 2>&1
cd ../..
echo "----------------------------------------------------------------------------"
mkdir -p sources/meta-fsl-demos
git clone git://github.com/Freescale/meta-fsl-demos sources/meta-fsl-demos 2>&1 | grep -v 'fatal'
cd sources/meta-fsl-demos
git fetch
git checkout 5a12677ad000a926d23c444266722a778ea228a7 2>&1
cd ../..
echo "----------------------------------------------------------------------------"
mkdir -p sources/meta-browser
git clone git://github.com/OSSystems/meta-browser sources/meta-browser 2>&1 | grep -v 'fatal'
cd sources/meta-browser
git fetch
git checkout fc3969f63bda343c38c40a23f746c560c4735f3e 2>&1
cd ../..
echo "----------------------------------------------------------------------------"
mkdir -p sources/meta-fsl-bsp-release
git clone git://git.freescale.com/imx/meta-fsl-bsp-release sources/meta-fsl-bsp-release 2>&1 | grep -v 'fatal'
cd sources/meta-fsl-bsp-release
git fetch
git checkout dora_3.10.17-1.0.0_GA 2>&1
cd ../..
cp sources/meta-fsl-bsp-release/imx/tools/fsl-setup-release.sh .

5
solo-builder/ansible.cfg Normal file
View File

@ -0,0 +1,5 @@
[ssh_connection]
pipelining = True
[ssh_connection]
ssh_args = -o ForwardAgent=yes

View File

@ -0,0 +1,3 @@
[user]
name = Solo Builder
email = solo-builder@opensolo.org

122
solo-builder/builder.sh Executable file
View File

@ -0,0 +1,122 @@
#!/bin/bash
# USAGE: builder.sh -a GIT_ACCOUNT -r GIT_REPO -b GIT_BRANCH -b BUILD_MACHINE
# EXAMPLE: builder.sh -a OpenSolo -r 3dr-arm-yocto-bsp -b Master
# These are also the defaults that will be used if options are not specified
# EXAMPLE: builder.sh -a Pedals2Paddles -r 3dr-arm-yocto-bsp -b v0.1.0
# This will use Matt's fork with a branch named v0.1.0
# TIP: if the GIT_BRANCH starts with tags/, then it's actually a git tag that's used, if not it's a branch
# Defaults if options are not set from command line set
GIT_ACCOUNT=OpenSolo
GIT_REPO=3dr-arm-yocto-bsp
GIT_BRANCH=master
BUILD_MACHINE=both
CLEAN=clean
# Check command line options for git account, repo, and branch.
while getopts a:r:b:m:c: option
do
case ${option}
in
a) GIT_ACCOUNT=${OPTARG};;
r) GIT_REPO=${OPTARG};;
b) GIT_BRANCH=${OPTARG};;
m) BUILD_MACHINE=$${OPTARG};;
c) CLEAN=${OPTARG};;
esac
done
# Prompt for what is about to execute
echo
echo
echo "Ready to initialize the "$GIT_ACCOUNT $GIT_REPO" repo using branch "$GIT_BRANCH
echo
read -p "This is your last chance to say no. Proceed with build? (y/n):" choice
echo
case "$choice" in
y|Y ) echo "Yes! Proceeding with build.";;
n|N ) echo "No? Fine. Aborting build.." && exit 1;;
* ) echo "Invalid response. Quit pushing my buttons. Aborting build." && exit 1;;
esac
echo
#Do it.
/vagrant/alt_sync.sh $GIT_BRANCH 2>&1
echo "sync done"
cd /solo-build-alt
if [ ! $? -eq 0 ]
then
exit 1
fi
export MACHINE=imx6solo-3dr-1080p
EULA=1 source ./setup-environment build
if [ ! $? -eq 0 ]
then
exit 1
fi
#TIP: how to build just one bit, such as the pixhawk firmware from OpenSolo/meta-3dr/recipes-firmware/pixhawk/pixhawk-firmware_1.3.1.bb :
#assuming you've run the 'export MACHINE...' and 'source ./setup...' commands first, and are in /solo-build-alt/build/ folder as a result:
#bitbake -c clean pixhawk-firmware
#bitbake pixhawk-firmware
#or verbose:
#bitbake pixhawk-firmware -v
#TIP: -k means continue-after-error-for-as-much-as-possible
if [ $CLEAN = clean ]
then
# these clean command/s are very verbose, and return an error code even though the clean works, lets quieten them:
echo "solo clean started..."
MACHINE=imx6solo-3dr-1080p bitbake world -c cleansstate -f -k 2>&1 > /dev/null
echo "...solo clean finished."
echo "controller clean started..."
MACHINE=imx6solo-3dr-artoo bitbake world -c cleansstate -f -k 2>&1 > /dev/null
echo "...controller clean finished"
fi
MACHINE=imx6solo-3dr-1080p bitbake 3dr-solo
if [ ! $? -eq 0 ]
then
exit 1
fi
MACHINE=imx6solo-3dr-artoo bitbake 3dr-controller
if [ ! $? -eq 0 ]
then
exit 1
fi
#TIPS:
# Copy the relevant files to a date/time stamped completed directory in the git repo folder for easy access (on git ignore list).
# Make an MD5sum of each as is required for the Solo and Controller to accept the files.
# The tar.gz and the .md5 go directly in the /log/updates/ directory on the solo and/or controller.
COMP="completed_$(date +%F_%H-%M)"
NEW_DIR=/vagrant/binaries/$COMP
echo $COMP > /tmp/COMP.txt
mkdir -p $NEW_DIR
cd $NEW_DIR
cp /solo-build-alt/build/tmp-eglibc/deploy/images/imx6solo-3dr-1080p/3dr-solo.tar.gz $NEW_DIR
md5sum 3dr-solo.tar.gz > 3dr-solo.tar.gz.md5
cp /solo-build-alt/build/tmp-eglibc/deploy/images/imx6solo-3dr-artoo/3dr-controller.tar.gz $NEW_DIR
md5sum 3dr-controller.tar.gz > 3dr-controller.tar.gz.md5
ls -lh $NEW_DIR
echo
echo "All build files located in below directories of the Vagrant virtual machine (squashfs, uImage, kernel, u-boot, dtb file, initramfs, rootfs.cpio, etc)"
echo /solo-build-alt/build/tmp-eglibc/deploy/images/imx6solo-3dr-1080p/
echo /solo-build-alt/build/tmp-eglibc/deploy/images/imx6solo-3dr-artoo/

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,51 @@
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF0E1940624A220
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6D1D8367A3421AFB
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5BB92C09DB82666C
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E601AAF9486D3664
# fix broken urllib3 or some ssl stuff diesn't work
sudo apt-get install -y --force-yes python-pip
sudo pip install urllib3[secure]
sudo pip install bcrypt
sudo pip install pynacl
# need to update pip and setuptools to newer version before cryptography will install:
sudo pip install --upgrade pip
sudo pip install --upgrade setuptools
sudo apt-get install -y --force-yes libssl-dev
# get a specificversion of this, as newer ones don't work on 14.04:
#sudo pip install cryptography
sudo pip install cryptography==2.0.3
# fix broken python2.7.x by moving it forward to something newer than 2.7.8:
sudo add-apt-repository -y ppa:fkrull/deadsnakes-python2.7
sudo apt-get -y --force-yes update
sudo apt-get install -y --force-yes python2.7 python2.7-dev
## get deps for pillow, and note that we get Pillow from easy_install instead of 'pip' or apt-get becuase this method actually works.
#sudo apt-get install -y python-dev python-setuptools
#sudo apt-get install -y --force-yes libtiff4-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk
#sudo easy_install Pillow
sudo apt-add-repository 'deb http://ppa.launchpad.net/anatol/tup/ubuntu precise main' -y
sudo add-apt-repository 'ppa:terry.guo/gcc-arm-embedded' -y
sudo apt-get --assume-yes update
sudo apt-get --assume-yes install tup freetype* python-pip python-dev gcc-arm-none-eabi git
sudo apt-get --assume-yes install libffi*
sudo apt-get --assume-yes install ansible
ssh-keyscan -t rsa github.com
ssh-keyscan -t rsa bitbucket.org
#sudo pip install --upgrade pip
#sudo pip install pillow
#echo ""
#echo To build the artoo stm32 binary enter the VM with:
#echo vagrant ssh
#echo Then type this:
#echo cd /vagrant
#echo tup

View File

@ -0,0 +1 @@
default

59
solo-builder/playbook.yml Normal file
View File

@ -0,0 +1,59 @@
- hosts: all
tasks:
- name: Installs packages
sudo: true
apt: pkg={{item}} state=installed update_cache=true cache_valid_time=86400
with_items:
- gawk
- wget
- git-core
- diffstat
- unzip
- texinfo
- gcc-multilib
- build-essential
- chrpath
- socat
- libsdl1.2-dev
- xterm
- curl
- name: Install jq
sudo: true
get_url: url=http://stedolan.github.io/jq/download/linux64/jq dest=/usr/local/bin/jq mode=0755
- name: Install repo
sudo: true
get_url: url=https://storage.googleapis.com/git-repo-downloads/repo dest=/usr/local/bin/repo mode=0755
- name: Git configuration
copy: src=ansible.gitconfig dest=~/.gitconfig
#- name: ensure github.com is a known host
# lineinfile:
# dest: ~/.ssh/known_hosts
# create: yes
# state: present
# line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
# regexp: "^github\\.com"
#- name: ensure bitbucket.org is a known host
# lineinfile:
# dest: ~/.ssh/known_hosts
# create: yes
# state: present
# line: "{{ lookup('pipe', 'ssh-keyscan -t rsa bitbucket.org') }}"
# regexp: "^bitbucket\\.org"
- name: create build dir
sudo: true
# option to override build_dir_owner (currently used by vagrant)
file: path=/solo-build state=directory mode=0755 owner={{build_dir_owner | default('ubuntu')}}
- name: repo init
shell: repo init -u https://github.com/OpenSolo/3dr-arm-yocto-bsp/
args:
chdir: /solo-build
creates: /solo-build/build
#- copy: src=~/.ssh/github_token dest=~/.ssh/github_token mode=0455

View File

@ -0,0 +1,13 @@
#!/bin/bash
cd $(dirname $0)
set -e
rm -rf static
mkdir -p static
while read -r p && [[ "$p" != '' ]]; do
cp ../build/tmp-eglibc/deploy/rpm/$p static/
done <packages
cd static
createrepo .
aws s3 sync . s3://solo-packages/3.10.17-rt12/ --acl public-read --delete

View File

@ -0,0 +1,9 @@
cortexa9hf_vfp_neon/busybox-1.21.1-r1.cortexa9hf_vfp_neon.rpm
cortexa9hf_vfp_neon/libptp-1.1.10-r0.cortexa9hf_vfp_neon.rpm
cortexa9hf_vfp_neon/e2fsprogs-1.42.8-r0.cortexa9hf_vfp_neon.rpm
cortexa9hf_vfp_neon/e2fsprogs-badblocks-1.42.8-r0.cortexa9hf_vfp_neon.rpm
cortexa9hf_vfp_neon/e2fsprogs-mke2fs-1.42.8-r0.cortexa9hf_vfp_neon.rpm
cortexa9hf_vfp_neon/libss2-1.42.8-r0.cortexa9hf_vfp_neon.rpm
cortexa9hf_vfp_neon/lsof-4.87-r0.cortexa9hf_vfp_neon.rpm
cortexa9hf_vfp_neon/parted-3.1-r1.cortexa9hf_vfp_neon.rpm
cortexa9hf_vfp_neon/libusb-0.1-4-0.1.5-r0.cortexa9hf_vfp_neon.rpm

View File

@ -0,0 +1,187 @@
#!/usr/bin/python
import sys
import time
import pwd
import subprocess
import os, pwd, grp
import os.path
def get_username():
return pwd.getpwuid( os.getuid() )[ 0 ]
me = get_username()
if ( me != 'root' ) :
print(" must be run as root, sorry, aborting. \n");
exit(1);
if os.path.isfile("/vagrant/progress.log"):
print "unable to run, another copy is already runniing, see /vagrant/progress.log";
exit(1);
# open logfile:
logfile = "/vagrant/progress.log"
log = open(logfile, "w+")
# we display results as-it-happens, but also capture them
def run_command_capture_results(cmd='true', doLog=True):
if doLog:
print >>log, "cmd: "+cmd+"\n"
print "cmd: "+cmd+"\n"
p = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE,stdout=subprocess.PIPE)
ret = ''
dobreak = False
doNext = False
while True:
#print p.poll()
#out = p.stdout.readline()
out = p.stdout.read(1)
# poll() returns None if process is still running, or exit code if it's done
if out == "":
if p.poll() is not None:
#print "OUT BREAK : " + str(p.poll())
dobreak = True
# otherwise handle the data we got prom the process:
while out != '' and doNext == False:
#if doNext == True:
# out = out + "\n"
# doNext = False
sys.stdout.write(out)
sys.stdout.flush()
if doLog:
log.write(out)
log.flush()
ret += out
out = p.stdout.read(1)
#if out == "\n":
# doNext = True
#err = p.stderr.readline()
err = p.stderr.read(1)
if err == "":
if p.poll() is not None:
#print "ERR BREAK" + str(p.poll())
dobreak = True
while err != '' and doNext == False:
#if doNext == True:
# out = out + "\n"
# doNext = False
sys.stdout.write(err)
sys.stdout.flush()
if doLog:
log.write(err)
log.flush()
ret += err
err = p.stderr.read(1)
#if err == "\n":
# doNext = True
if dobreak == True:
break
return ret
def drop_privileges(uid_name='nobody', gid_name='nogroup'):
if os.getuid() != 0:
# We're not root so, like, whatever dude
return
# Get the uid/gid from the name
running_uid = pwd.getpwnam(uid_name).pw_uid
running_gid = grp.getgrnam(gid_name).gr_gid
# Remove group privileges
os.setgroups([])
# Try setting the new uid/gid
os.setgid(running_gid)
os.setuid(running_uid)
# Ensure a very conservative umask
old_umask = os.umask(002)
# tasks potentially needing root:
print >>log, "fixing perms\n";
print "fixing perms\n";
run_command_capture_results("chown -R vagrant /vagrant/.git /vagrant/.gitignore");
run_command_capture_results("chown -R vagrant /vagrant/*");
# now actually do ita:
#print >>log, "dropping privs to 'vagrant'\n";
drop_privileges('vagrant','vagrant');
me = get_username()
if ( me != 'vagrant' ) :
print >>log, "error while trying to drop root and running as vagrant user, aborting. \n";
exit(1);
run_command_capture_results("rm /vagrant/www/latest_run.txt", False);
#run_command_capture_results("touch /vagrant/www/in-progress.txt", False);
progress = open("/vagrant/www/in-progress.txt",'w+')
print >>log, "now running as 'vagrant' user.\nstarting run at:\n";
print "now running as 'vagrant' user.\nstarting run at:\n";
run_command_capture_results("date");
print >>log, "chdir /vagrant";
print "chdir /vagrant";
os.chdir("/vagrant");
run_command_capture_results("git pull");
# compare git rev with last-run, if changed, then we run again...
gitrev = run_command_capture_results("git rev-parse --verify HEAD");
touch = run_command_capture_results("touch /vagrant/gitrev.txt");
with open('gitrev.txt', 'r+') as f_in:
prev = f_in.read()
f_in.close()
# if they are different, make them the same.
if gitrev != prev:
with open('gitrev.txt', 'w+') as f_out:
f_out.write(gitrev)
f_in.close()
# just let the human know the thing we are currently trying to do, by it's git hash..
progress.write(gitrev)
# if no change, then don't re-run
if gitrev == prev:
print >>log, "no change in solo-builder git revision, not re-running. ( to force re-run, delete /vagrant/gitrev.txt file)";
print "no change in solo-builder git revision, not re-running. ( to force re-run, delete /vagrant/gitrev.txt file)";
else:
# run something.
run_command_capture_results("echo \"y\" |/vagrant/builder.sh");
print >>log, "finished run at:\n";
run_command_capture_results("date");
print "log closed. \n";
log.close();
print "log relocated. \n";
comp = ''
with open('/tmp/COMP.txt', 'r+') as f_in:
comp = f_in.read()
f_in.close()
comp = comp.rstrip()
if comp == '':
print "log relocation aborted,cant find /tmp/COMP.txt";
run_command_capture_results("mv /vagrant/progress.log /vagrant/binaries/"+comp+"/latest_run.txt", False);
# either way, wind up the files and handles:
progress.close()
run_command_capture_results("rm /vagrant/www/latest_run.txt", False);
run_command_capture_results("mv /vagrant/www/in-progress.txt /vagrant/www/latest_run.txt", False);
run_command_capture_results("rm /vagrant/progress.log", False);