From d9eac7df4acc3476cabf891399aacc2ee9867f44 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Thu, 10 Sep 2015 15:39:22 -0700 Subject: [PATCH] update kernel builder for linux next Signed-off-by: Jessica Frazelle --- kernel-builder/Dockerfile | 1 + kernel-builder/install_kernel | 39 ++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/kernel-builder/Dockerfile b/kernel-builder/Dockerfile index d53f7d0..0a96e74 100644 --- a/kernel-builder/Dockerfile +++ b/kernel-builder/Dockerfile @@ -8,6 +8,7 @@ RUN apt-get update && apt-get install -y \ kernel-package \ make \ libncurses5-dev \ + libssl-dev \ --no-install-recommends \ && rm -rf /var/lib/apt/lists/* diff --git a/kernel-builder/install_kernel b/kernel-builder/install_kernel index aa05c39..f933d4a 100755 --- a/kernel-builder/install_kernel +++ b/kernel-builder/install_kernel @@ -1,12 +1,49 @@ #!/bin/bash set -e +linux_next(){ + ( + cd /usr/src + + # check if we already have the source checked out + if [[ -d linux ]]; then + cd linux + + git checkout master + + git remote update + else + # clone the source files + git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git + + # add the linux-next remote + cd linux + git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git + + # fetch linux-next and tags + git fetch linux-next + git fetch --tags linux-next + fi + + git checkout -b next-$(date +%Y%m%d) next-$(date +%Y%m%d) + + if [[ ! -f .config ]] && [[ -f ../config ]]; then + cp ../config .config + fi + + nice -19 make -j$JOBS KDEB_PKGVERSION=$PKGVERSION INSTALL_MOD_STRIP=1 deb-pkg + ) +} + install_kernel(){ local VERSION=$1 if [[ -z $VERSION ]]; then echo "Please specify a kernel version." exit 1 + elif [[ "$VERSION" == "next" ]]; then + linux_next + exit 0 fi local MAJOR_VERSION=${VERSION:0:1} @@ -16,7 +53,7 @@ install_kernel(){ # get the kernel source if [[ "$VERSION" == *-rc* ]]; then [ -d /usr/src/linux-${VERSION} ] || curl -sSL https://kernel.org/pub/linux/kernel/v${MAJOR_VERSION}.x/testing/linux-${VERSION}.tar.xz | tar -v -C /usr/src -xJ - + MAJOR_MINOR_VERSION="${MAJOR_VERSION}.x-rcN" else [ -d /usr/src/linux-${VERSION} ] || curl -sSL https://www.kernel.org/pub/linux/kernel/v${MAJOR_VERSION}.x/linux-${VERSION}.tar.xz | tar -v -C /usr/src -xJ