summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@spinner.gnome.org>2015-03-26 12:38:28 +0000
committerAlexander Larsson <alexl@spinner.gnome.org>2015-03-26 14:03:54 +0000
commit8e6d1e5b50a962710a63f544531b6676513ed565 (patch)
treee2712504a6ee0495b5498e06a4e74087f3879fb5
parent46466befa88445480f51815e7ae1f2232963836d (diff)
Properly extract every image built based on git sha-1
-rw-r--r--.gitignore1
-rw-r--r--Makefile10
-rwxr-xr-xfreedesktop-sdk-build-yocto9
3 files changed, 12 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c291c09
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+images
diff --git a/Makefile b/Makefile
index 56f71cf..7c6656c 100644
--- a/Makefile
+++ b/Makefile
@@ -3,11 +3,13 @@ builddir = $(CURDIR)
NULL=
ARCH=x86_64
-IMAGES=build/$(ARCH)/images
+IMAGEDIR=images/$(ARCH)
+HASH:=$(shell git rev-parse HEAD)
+IMAGES=$(IMAGEDIR)/freedesktop-base-contents-sdk-$(ARCH)-$(HASH).tar.gz $(IMAGEDIR)/freedesktop-base-contents-platform-$(ARCH)-$(HASH).tar.gz
-all: images
+all: $(IMAGES)
-$(IMAGES)/freedesktop-base-contents-sdk-$(ARCH).tar.gz $(IMAGES)/freedesktop-base-contents-platform-$(ARCH).tar.gz images:
+ $(IMAGES) allimages:
git submodule update --init
mkdir -p build/$(ARCH)
- ./freedesktop-sdk-build-yocto ${srcdir}/ ${builddir}/build/ $(ARCH) `git rev-parse HEAD`
+ ./freedesktop-sdk-build-yocto $(srcdir)/ $(builddir)/build/ $(ARCH) $(HASH)
diff --git a/freedesktop-sdk-build-yocto b/freedesktop-sdk-build-yocto
index e1b1960..259422f 100755
--- a/freedesktop-sdk-build-yocto
+++ b/freedesktop-sdk-build-yocto
@@ -39,6 +39,9 @@ test -n "${architecture}" || (usage; exit 1)
HASH=$4
test -n "${HASH}" || (usage; exit 1)
+IMAGEDIR=${srcdir}/images/${architecture}
+mkdir -p $IMAGEDIR
+
. "${srcdir}/yocto/oe-init-build-env" "${workdir}/${architecture}"
LAYERNAMES=$(cat ${srcdir}/LAYERS)
@@ -89,11 +92,9 @@ EOF
mv ${localconf}.tmp ${localconf}
fi
-IMAGEDIR=${workdir}/${architecture}/images
-mkdir -p "${IMAGEDIR}"
-
bitbake freedesktop-contents-{sdk,platform}
+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
for basetype in sdk platform; do
- ln -sf ${workdir}/${architecture}/tmp-glibc/deploy/images/${MACHINE}/freedesktop-contents-${basetype}-${MACHINE}.tar.gz images/freedesktop-contents-${basetype}-${architecture}-${HASH}.tar.gz
+ ln -f ${workdir}/${architecture}/tmp-glibc/deploy/images/${MACHINE}/freedesktop-contents-${basetype}-${MACHINE}.tar.gz $IMAGEDIR/freedesktop-contents-${basetype}-${architecture}-${HASH}.tar.gz
done