diff options
-rw-r--r-- | software/.gitmodules | 9 | ||||
-rw-r--r-- | software/Makefile | 64 | ||||
-rw-r--r-- | software/README.md | 31 | ||||
-rw-r--r-- | software/reprepro-conf/distributions | 7 | ||||
-rw-r--r-- | software/reprepro-conf/options | 4 | ||||
-rw-r--r-- | software/source/Makefile | 19 | ||||
-rw-r--r-- | software/source/debian/compat | 1 | ||||
-rw-r--r-- | software/source/debian/control | 14 | ||||
-rw-r--r-- | software/source/debian/copyright | 27 | ||||
-rwxr-xr-x | software/source/debian/rules | 4 | ||||
-rw-r--r-- | software/source/debian/source/format | 1 | ||||
m--------- | software/source/sw/libhal | 0 | ||||
m--------- | software/source/sw/pkcs11 | 0 | ||||
m--------- | software/source/sw/thirdparty/libtfm | 0 |
14 files changed, 181 insertions, 0 deletions
diff --git a/software/.gitmodules b/software/.gitmodules new file mode 100644 index 0000000..a464eb3 --- /dev/null +++ b/software/.gitmodules @@ -0,0 +1,9 @@ +[submodule "source/sw/libhal"] + path = source/sw/libhal + url = https://git.cryptech.is/sw/libhal.git +[submodule "source/sw/pkcs11"] + path = source/sw/pkcs11 + url = https://git.cryptech.is/sw/pkcs11.git +[submodule "source/sw/thirdparty/libtfm"] + path = source/sw/thirdparty/libtfm + url = https://git.cryptech.is/sw/thirdparty/libtfm.git diff --git a/software/Makefile b/software/Makefile new file mode 100644 index 0000000..787fea4 --- /dev/null +++ b/software/Makefile @@ -0,0 +1,64 @@ +# Top-level build of software packages to work with Cryptech Alpha board. + +export CRYPTECH_VERSION := 2.0 + +HEAD_TIME := $(shell git show -s --format=%ct HEAD) +HEAD_HASH := $(shell git rev-parse HEAD) + +PACKAGE_NAME := cryptech-alpha +PACKAGE_VERSION := ${CRYPTECH_VERSION}~${HEAD_TIME}~${HEAD_HASH} + +export GNUPGHOME := /home/aptbot/gnupg + +REPO_BASE := /home/aptbot/alpha +REPO_UMASK := 002 + +PBUILDER_BASE := ${HOME}/pbuilder +PBUILDER_TARGETS := debian/jessie/i386 debian/jessie/amd64 ubuntu/xenial/i386 ubuntu/xenial/amd64 + +REPO_UPLOAD_USER := aptbot +REPO_UPLOAD_URI := rsync://apt.cryptech.is/alpha/ + +# Command to generate a new changelog containing one entry. +# Does nothing if the changelog already exists. + +DCH = test -f debian/changelog || \ + EDITOR=true VISUAL=true TZ=UTC DEBEMAIL='APT Builder Robot <aptbot@cryptech.is>' \ + dch --create --package ${PACKAGE_NAME} --newversion '${PACKAGE_VERSION}' \ + '$(strip Version ${CRYPTECH_VERSION} of software for Cryptech Alpha development board.)' + +all: init source pbuilder homebrew + +enchilada: all upload + +init: + git submodule update --init --recursive + +clean: + git clean -dfx + git submodule foreach --recursive git clean -dfx + +sandblast: clean + git submodule deinit -f . + +source: + cd source; ${DCH} + cd source; debuild -S -uc -us + +pbuilder: + rm -f ${PBUILDER_BASE}/*result/* + umask ${REPO_UMASK}; \ + for target in ${PBUILDER_TARGETS}; do echo $$target | tr '/' ' '; done | \ + while read dist code arch; do \ + reprepro -b ${REPO_BASE}/$$dist -A $$arch list $$code ${PACKAGE_NAME} | awk '{v = $$3} END {exit v != "${PACKAGE_VERSION}"}' && continue; \ + pbuilder-dist $$code $$arch build ${PACKAGE_NAME}_${PACKAGE_VERSION}.dsc; \ + reprepro -b ${REPO_BASE}/$$dist include $$code ${PBUILDER_BASE}/$${code}-$${arch}_result/${PACKAGE_NAME}_${PACKAGE_VERSION}_$${arch}.changes; \ + done + +RSYNC := rsync --rsh 'ssh -l ${REPO_UPLOAD_USER}' --archive --itemize-changes + +upload: + ${RSYNC} --ignore-existing ${REPO_BASE}/ ${REPO_UPLOAD_URI} + ${RSYNC} --delete --delete-delay ${REPO_BASE}/ ${REPO_UPLOAD_URI} + +.PHONY: all init clean source pbuilder homebrew upload enchilada sandblast diff --git a/software/README.md b/software/README.md new file mode 100644 index 0000000..15c1006 --- /dev/null +++ b/software/README.md @@ -0,0 +1,31 @@ +Preliminary release engineering super-repository for building software +to work with the Cryptech "Alpha" board. + +Primary task here is to build the PKCS #11 library and any needed +support tools for whichever platforms we support. This will involve +some packaging voodoo. + +Our first targets for this are Debian and Ubuntu, probably the Jessie +and Xenial releases, respectively. If we really need to support +multiple releases for each of these platforms, the packaging mechanics +become more complicated, so we may just stop here for these platforms +and assume we can fill any odd corners using the associated source +package. + +Our next target for this is likely to be Mac OS X. This should be +relatively straightforward so long as we only have to support Homebrew +and we don't have to produce Homebrew "bottles" (binary packages). If +we do need to bottle, we either need one or more Mac build machines or +we need some kind of cross-compilation scheme (eg, +https://github.com/tpoechtrager/osxcross). + +Supporting Homebrew at all requires a bit of extra voodoo on top of +supporting Debian packaging, but none of it looks particularly +difficult, and the Debian packaging will produce the source tarball we +need for the Homebrew formula, so integrating production of these two +kinds of packaging makes some sense. + +Windoze is not currently on the radar. In theory, MinGW would suffice +as a cross compiler if and when we have to do something about it. + +This README is probably obsolete by the time you're reading it. diff --git a/software/reprepro-conf/distributions b/software/reprepro-conf/distributions new file mode 100644 index 0000000..57c1afc --- /dev/null +++ b/software/reprepro-conf/distributions @@ -0,0 +1,7 @@ +Origin: cryptech.is +Label: cryptech.is APT repository +Codename: jessie +Architectures: i386 amd64 source +Components: main +Description: cryptech.is APT Repository +SignWith: yes diff --git a/software/reprepro-conf/options b/software/reprepro-conf/options new file mode 100644 index 0000000..f5ad660 --- /dev/null +++ b/software/reprepro-conf/options @@ -0,0 +1,4 @@ +verbose +ask-passphrase +basedir . +ignore wrongdistribution diff --git a/software/source/Makefile b/software/source/Makefile new file mode 100644 index 0000000..e2fdb1b --- /dev/null +++ b/software/source/Makefile @@ -0,0 +1,19 @@ +# Makefile to build Debian package for Cryptech Alpha board software + +all: + cd sw/thirdparty/libtfm; ${MAKE} + cd sw/libhal; ${MAKE} daemon + cd sw/pkcs11; ${MAKE} + +clean distclean: + cd sw/thirdparty/libtfm; ${MAKE} $@ + cd sw/libhal; ${MAKE} $@ + cd sw/pkcs11; ${MAKE} $@ + +install: all + install -m 644 -D sw/pkcs11/libpkcs11.so ${DESTDIR}/usr/lib/libpkcs11.so + install -D sw/pkcs11/p11util ${DESTDIR}/usr/sbin/p11util + install -D sw/libhal/cryptech_rpcd ${DESTDIR}/usr/sbin/cryptech_rpcd + ln -s libpkcs11.so ${DESTDIR}/usr/lib/libpkcs11.so.0 + +# Might also want to install the firmware tarball, scripts to use it, .... diff --git a/software/source/debian/compat b/software/source/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/software/source/debian/compat @@ -0,0 +1 @@ +9 diff --git a/software/source/debian/control b/software/source/debian/control new file mode 100644 index 0000000..8ae25b9 --- /dev/null +++ b/software/source/debian/control @@ -0,0 +1,14 @@ +Source: cryptech-alpha +Maintainer: APT Builder Robot <aptbot@cryptech.is> +Section: misc +Priority: optional +Standards-Version: 3.9.6 +Build-Depends: debhelper (>= 9), libsqlite3-0, libsqlite3-dev, python (>= 2.7), python-yaml +Homepage: http://trac.cryptech.is/wiki + +Package: cryptech-alpha +Architecture: any +Depends: libc6 (>= 2.13), ${misc:Depends}, libsqlite3-0 +Description: Cryptech open-source crypto software + "cryptech-alpha" contains software for use with the Cryptech Project + "Alpha" development board. diff --git a/software/source/debian/copyright b/software/source/debian/copyright new file mode 100644 index 0000000..ec25460 --- /dev/null +++ b/software/source/debian/copyright @@ -0,0 +1,27 @@ +Copyright (c) 2015-2016, NORDUnet A/S All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +- Neither the name of the NORDUnet nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/software/source/debian/rules b/software/source/debian/rules new file mode 100755 index 0000000..2d33f6a --- /dev/null +++ b/software/source/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ diff --git a/software/source/debian/source/format b/software/source/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/software/source/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/software/source/sw/libhal b/software/source/sw/libhal new file mode 160000 +Subproject 709a71c0030225ba08cddf5227a1c67c2dbb417 diff --git a/software/source/sw/pkcs11 b/software/source/sw/pkcs11 new file mode 160000 +Subproject 3118c1384c46140269033ea63faa6ebca9a3af5 diff --git a/software/source/sw/thirdparty/libtfm b/software/source/sw/thirdparty/libtfm new file mode 160000 +Subproject 269fc4e58f616a2cf1c318f494ec18a52991da8 |