From 997d6e24d31b3ce4685ab64263e572f71f620dde Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Fri, 5 Oct 2018 03:35:10 +0000 Subject: [PATCH] Add docker files for build environment and generation of kernels --- tools/kernel-factory/.gitignore | 1 + tools/kernel-factory/CentOS/6/Dockerfile | 24 ++++++++++++++++++++ tools/kernel-factory/CentOS/7/Dockerfile | 24 ++++++++++++++++++++ tools/kernel-factory/Debian/7/Dockerfile | 4 ++++ tools/kernel-factory/Debian/8/Dockerfile | 4 ++++ tools/kernel-factory/Debian/9/Dockerfile | 4 ++++ tools/kernel-factory/Debian/TODO | 4 ++++ tools/kernel-factory/Ubuntu/14.04/Dockerfile | 4 ++++ tools/kernel-factory/Ubuntu/16.04/Dockerfile | 4 ++++ tools/kernel-factory/Ubuntu/18.04/Dockerfile | 4 ++++ 10 files changed, 77 insertions(+) create mode 100644 tools/kernel-factory/.gitignore create mode 100644 tools/kernel-factory/CentOS/6/Dockerfile create mode 100644 tools/kernel-factory/CentOS/7/Dockerfile create mode 100644 tools/kernel-factory/Debian/7/Dockerfile create mode 100644 tools/kernel-factory/Debian/8/Dockerfile create mode 100644 tools/kernel-factory/Debian/9/Dockerfile create mode 100644 tools/kernel-factory/Debian/TODO create mode 100644 tools/kernel-factory/Ubuntu/14.04/Dockerfile create mode 100644 tools/kernel-factory/Ubuntu/16.04/Dockerfile create mode 100644 tools/kernel-factory/Ubuntu/18.04/Dockerfile diff --git a/tools/kernel-factory/.gitignore b/tools/kernel-factory/.gitignore new file mode 100644 index 0000000..53752db --- /dev/null +++ b/tools/kernel-factory/.gitignore @@ -0,0 +1 @@ +output diff --git a/tools/kernel-factory/CentOS/6/Dockerfile b/tools/kernel-factory/CentOS/6/Dockerfile new file mode 100644 index 0000000..6d411f2 --- /dev/null +++ b/tools/kernel-factory/CentOS/6/Dockerfile @@ -0,0 +1,24 @@ +FROM centos:6 + +# Last release must be download from mirror.centos.org, because vault.centos.org +# does not containt repodata for last release. +RUN yum list --showduplicates kernel \ + | grep kernel | awk '{print $2}' | while read VERSION; do \ + echo kernel-devel-${VERSION} kernel-${VERSION}; \ + done | xargs yum install -y; + +# mirror.centos.org does not contain old releases. +RUN sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/* +RUN sed -i 's;^#baseurl=http://mirror.centos.org/centos/;baseurl=http://vault.centos.org/;' /etc/yum.repos.d/* + +# do not remove old kernels +RUN sed -i 's;installonly_limit=;installonly_limit=100500;' /etc/yum.conf + +# After new release must put PREVIOUS version here, e.g. at the time of +# writing the comment last CentOS version was 6.10. +RUN for RELEASEVER in 6.0 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9; do \ + yum list --releasever=${RELEASEVER} --showduplicates kernel \ + | grep kernel | awk '{print $2}' | while read VERSION; do \ + echo kernel-devel-${VERSION} kernel-${VERSION}; \ + done | xargs yum install --releasever=${RELEASEVER} -y; \ + done diff --git a/tools/kernel-factory/CentOS/7/Dockerfile b/tools/kernel-factory/CentOS/7/Dockerfile new file mode 100644 index 0000000..24b2b39 --- /dev/null +++ b/tools/kernel-factory/CentOS/7/Dockerfile @@ -0,0 +1,24 @@ +FROM centos:7 + +# Last release must be download from mirror.centos.org, because vault.centos.org +# does not containt repodata for last release. +RUN yum list --showduplicates kernel \ + | grep kernel | awk '{print $2}' | while read VERSION; do \ + echo kernel-devel-${VERSION} kernel-${VERSION}; \ + done | xargs yum install -y; + +# mirror.centos.org does not contain old releases. +RUN sed -i 's/^mirrorlist/#mirrorlist/' /etc/yum.repos.d/* +RUN sed -i 's;^#baseurl=http://mirror;baseurl=http://vault;' /etc/yum.repos.d/* + +# do not remove old kernels +RUN sed -i 's;installonly_limit=;installonly_limit=100500;' /etc/yum.conf + +# After new release must put PREVIOUS version here, e.g. at the time of +# writing the comment last CentOS version was 7.5.1804. +RUN for RELEASEVER in 7.0.1406 7.1.1503 7.2.1511 7.3.1611 7.4.1708; do \ + yum list --releasever=${RELEASEVER} --showduplicates kernel \ + | grep kernel | awk '{print $2}' | while read VERSION; do \ + echo kernel-devel-${VERSION} kernel-${VERSION}; \ + done | xargs yum install --releasever=${RELEASEVER} -y; \ + done diff --git a/tools/kernel-factory/Debian/7/Dockerfile b/tools/kernel-factory/Debian/7/Dockerfile new file mode 100644 index 0000000..dc585a8 --- /dev/null +++ b/tools/kernel-factory/Debian/7/Dockerfile @@ -0,0 +1,4 @@ +FROM debian:7 + +RUN apt-get update +#RUN DEBIAN_FRONTEND=noninteractive apt-get install -y... diff --git a/tools/kernel-factory/Debian/8/Dockerfile b/tools/kernel-factory/Debian/8/Dockerfile new file mode 100644 index 0000000..38bac65 --- /dev/null +++ b/tools/kernel-factory/Debian/8/Dockerfile @@ -0,0 +1,4 @@ +FROM debian:8 + +RUN apt-get update +#RUN DEBIAN_FRONTEND=noninteractive apt-get install -y... diff --git a/tools/kernel-factory/Debian/9/Dockerfile b/tools/kernel-factory/Debian/9/Dockerfile new file mode 100644 index 0000000..56a9e78 --- /dev/null +++ b/tools/kernel-factory/Debian/9/Dockerfile @@ -0,0 +1,4 @@ +FROM debian:9 + +RUN apt-get update +#RUN DEBIAN_FRONTEND=noninteractive apt-get install -y... diff --git a/tools/kernel-factory/Debian/TODO b/tools/kernel-factory/Debian/TODO new file mode 100644 index 0000000..9bebbe3 --- /dev/null +++ b/tools/kernel-factory/Debian/TODO @@ -0,0 +1,4 @@ +1. Lookup kernel in https://snapshot.debian.org/package/linux* +2. Go to snapshot (e.g. https://snapshot.debian.org/archive/debian/20120612T040311Z/pool/main/l/linux/) +3. Checkout release version +4. ... \ No newline at end of file diff --git a/tools/kernel-factory/Ubuntu/14.04/Dockerfile b/tools/kernel-factory/Ubuntu/14.04/Dockerfile new file mode 100644 index 0000000..bb06328 --- /dev/null +++ b/tools/kernel-factory/Ubuntu/14.04/Dockerfile @@ -0,0 +1,4 @@ +FROM ubuntu:14.04 + +RUN apt-get update +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y linux-image-3*-generic linux-image-4*-generic linux-headers-*-generic diff --git a/tools/kernel-factory/Ubuntu/16.04/Dockerfile b/tools/kernel-factory/Ubuntu/16.04/Dockerfile new file mode 100644 index 0000000..6ff2bca --- /dev/null +++ b/tools/kernel-factory/Ubuntu/16.04/Dockerfile @@ -0,0 +1,4 @@ +FROM ubuntu:16.04 + +RUN apt-get update +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y linux-image-4*-generic linux-headers-*-generic diff --git a/tools/kernel-factory/Ubuntu/18.04/Dockerfile b/tools/kernel-factory/Ubuntu/18.04/Dockerfile new file mode 100644 index 0000000..54e02f1 --- /dev/null +++ b/tools/kernel-factory/Ubuntu/18.04/Dockerfile @@ -0,0 +1,4 @@ +FROM ubuntu:18.04 + +RUN apt-get update +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y linux-image-4*-generic linux-headers-*-generic