ci: Build more targets, cache SDKs, eatmydata

Build graph-depends and legal-info along with firmware images

Also, use proper O=/foo for telling buildroot where to build images.
Also, use the magic buildroot config script rather than hacky hacks.

Support building and caching an SDK, meaning you can build simple
defconfigs in dozens of minutes, and greatly reduce the total time
for building all configurations.

Eatmydata will save us a *lot* of fsync() activity when you don't
have infinite IOPS.

Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
diff --git a/ci/build-sdk.sh b/ci/build-sdk.sh
new file mode 100755
index 0000000..8267af3
--- /dev/null
+++ b/ci/build-sdk.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+set -ex
+set -eo pipefail
+
+if [ -z "$1" ]; then
+	echo "No build distro specified"
+	exit 1;
+fi
+
+if [ -z "$2" ]; then
+	echo "No defconfig to build SDK from specified"
+	exit 1;
+fi
+
+if [ -z "$CCACHE_DIR" ]; then
+	CCACHE_DIR=`pwd`/.op-build_ccache
+fi
+
+shopt -s expand_aliases
+source op-build-env
+
+if [ -n "$DL_DIR" ]; then
+	unset BR2_DL_DIR
+	export BR2_DL_DIR=${DL_DIR}
+fi
+
+export O=`pwd`/output-$1-$2/
+op-build O=$O $2
+./buildroot/utils/config --file $O/.config --set-val BR2_CCACHE y
+./buildroot/utils/config --file $O/.config --set-str BR2_CCACHE_DIR $CCACHE_DIR
+op-build O=$O olddefconfig
+op-build O=$O sdk