tenku/docker/ubuntu-kernelbuilder/Makefile
gdm85 e7eacc9d2e Adding templating to support multiple Ubuntu versions
Renaming images to be more generic and not tied to Trusty

Have both pkgbuilder and kernelbuilder support multiple versions of Ubuntu
2015-10-28 16:06:43 +01:00

16 lines
615 B
Makefile

ifeq ($(KERNEL_VERSION),)
KERNEL_VERSION := $(shell uname -r)
endif
linux-image-%:
mkdir -p packages
docker run -e KERNEL_VERSION=$(KERNEL_VERSION) -v $(CURDIR)/packages:/home/rdeckard/packages -v $(CURDIR)/patches:/home/rdeckard/patches:ro $*-kernelbuilder ./build-kernel.sh $(KERNEL_VERSION)
## supports any Ubuntu version (trusty, wily etc)
%:
TMPD=`mktemp -d` && cp build-kernel.sh "$$TMPD/" && \
sed -e 's~%IMAGE%~$*~g' -e 's~%KERNEL_VERSION%~$(KERNEL_VERSION)~' Dockerfile.tpl > "$$TMPD/Dockerfile" && cd "$$TMPD" && \
docker build --tag='$*-kernelbuilder' . && cd && rm -rf "$TMPD"
.DEFAULT: trusty