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 Ubuntumaster
parent
db73573b58
commit
e7eacc9d2e
@ -1,7 +0,0 @@
|
|||||||
FROM trusty-pkgbuilder
|
|
||||||
|
|
||||||
RUN apt-get build-dep -y --no-install-recommends linux-image-$(uname -r) && \
|
|
||||||
apt-get install -y git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev ## specific for kernel building
|
|
||||||
|
|
||||||
## add script for getting source
|
|
||||||
COPY build-kernel.sh /home/rdeckard/
|
|
@ -1,16 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
apt-get source linux-image-$(uname -r)
|
|
||||||
|
|
||||||
cd linux-*
|
|
||||||
|
|
||||||
## will fail here if no patches are available
|
|
||||||
## why are you recompiling kernel if no custom patches are there?
|
|
||||||
for MYP in $(ls ../patches); do
|
|
||||||
patch -p1 < ../patches/$MYP
|
|
||||||
done
|
|
||||||
|
|
||||||
fakeroot debian/rules clean
|
|
||||||
DEB_BUILD_OPTIONS=parallel=3 AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-generic
|
|
@ -1,11 +0,0 @@
|
|||||||
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted
|
|
||||||
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted
|
|
||||||
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted
|
|
||||||
deb-src http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted
|
|
||||||
|
|
||||||
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
|
|
||||||
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
|
|
||||||
deb http://security.ubuntu.com/ubuntu trusty-security universe
|
|
||||||
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
|
|
||||||
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
|
|
||||||
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
|
|
@ -0,0 +1,14 @@
|
|||||||
|
FROM %IMAGE%-pkgbuilder
|
||||||
|
|
||||||
|
ENV KERNEL_VERSION %KERNEL_VERSION%
|
||||||
|
|
||||||
|
RUN apt-get build-dep -y --no-install-recommends linux-image-$KERNEL_VERSION && \
|
||||||
|
apt-get install -y git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev
|
||||||
|
|
||||||
|
USER rdeckard
|
||||||
|
|
||||||
|
## fetch source
|
||||||
|
RUN mkdir build && cd build && apt-get source linux-image-$KERNEL_VERSION
|
||||||
|
|
||||||
|
## add build script
|
||||||
|
COPY build-kernel.sh /home/rdeckard/
|
@ -0,0 +1,15 @@
|
|||||||
|
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
|
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
## enter the source-unpacked location
|
||||||
|
cd build/linux-*
|
||||||
|
|
||||||
|
## will fail here if no patches are available
|
||||||
|
for MYP in $(ls ../../patches); do
|
||||||
|
patch -p1 < ../../patches/$MYP
|
||||||
|
done
|
||||||
|
|
||||||
|
fakeroot debian/rules clean
|
||||||
|
|
||||||
|
DEB_BUILD_OPTIONS=parallel=4 AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-generic
|
||||||
|
|
||||||
|
mv ../*.deb $HOME/packages/
|
@ -0,0 +1,7 @@
|
|||||||
|
.DEFAULT: trusty
|
||||||
|
|
||||||
|
## supports any base Ubuntu image (gdm85/trusty, gdm85/wily etc)
|
||||||
|
## they should be generated with make-ubuntu-image.sh
|
||||||
|
%:
|
||||||
|
TMPD=`mktemp -d` && sed 's~%IMAGE%~gdm85/$@~g' Dockerfile.tpl > "$$TMPD/Dockerfile" && sed 's~%DIST%~$@~g' sources.list.tpl > "$$TMPD/sources.list" && cd "$$TMPD" && \
|
||||||
|
docker build --tag='$@-pkgbuilder' . && cd && rm -rf "$TMPD"
|
@ -0,0 +1,11 @@
|
|||||||
|
deb http://archive.ubuntu.com/ubuntu/ %DIST% main restricted
|
||||||
|
deb-src http://archive.ubuntu.com/ubuntu/ %DIST% main restricted
|
||||||
|
deb http://archive.ubuntu.com/ubuntu/ %DIST%-updates main restricted
|
||||||
|
deb-src http://archive.ubuntu.com/ubuntu/ %DIST%-updates main restricted
|
||||||
|
|
||||||
|
deb http://security.ubuntu.com/ubuntu %DIST%-security main restricted
|
||||||
|
deb-src http://security.ubuntu.com/ubuntu %DIST%-security main restricted
|
||||||
|
deb http://security.ubuntu.com/ubuntu %DIST%-security universe
|
||||||
|
deb-src http://security.ubuntu.com/ubuntu %DIST%-security universe
|
||||||
|
deb http://security.ubuntu.com/ubuntu %DIST%-security multiverse
|
||||||
|
deb-src http://security.ubuntu.com/ubuntu %DIST%-security multiverse
|
Loading…
Reference in New Issue