diff --git a/kernel/Dockerfile b/kernel/Dockerfile index 0ba02a6fc..3372f38e6 100644 --- a/kernel/Dockerfile +++ b/kernel/Dockerfile @@ -1,6 +1,7 @@ FROM mobylinux/alpine-build-kernel:0e893fbf6fa7638d2f23354de03ea11017bb8065@sha256:3ef3f9d11f0802b759dbd9c43a7706cf0ec37263c99ae90e2b10c29ea85739fa -ARG KERNEL_VERSION=4.9.14 +ARG KERNEL_VERSION +ARG DEBUG=0 ENV KERNEL_SOURCE=https://www.kernel.org/pub/linux/kernel/v4.x/linux-${KERNEL_VERSION}.tar.xz @@ -11,8 +12,6 @@ RUN cat linux-${KERNEL_VERSION}.tar.xz | tar --absolute-names -xJ && mv /linux- COPY kernel_config /linux/arch/x86/configs/x86_64_defconfig COPY kernel_config.debug /linux/debug_config -ARG DEBUG=0 - RUN if [ $DEBUG -ne "0" ]; then \ sed -i 's/CONFIG_PANIC_ON_OOPS=y/# CONFIG_PANIC_ON_OOPS is not set/' /linux/arch/x86/configs/x86_64_defconfig; \ cat /linux/debug_config >> /linux/arch/x86/configs/x86_64_defconfig; \ diff --git a/kernel/Dockerfile.4.4 b/kernel/Dockerfile.4.4 index be702ba7f..82eb095b6 100644 --- a/kernel/Dockerfile.4.4 +++ b/kernel/Dockerfile.4.4 @@ -1,6 +1,7 @@ FROM mobylinux/alpine-build-kernel:0e893fbf6fa7638d2f23354de03ea11017bb8065@sha256:3ef3f9d11f0802b759dbd9c43a7706cf0ec37263c99ae90e2b10c29ea85739fa -ARG KERNEL_VERSION=4.4.53 +ARG KERNEL_VERSION +ARG DEBUG=0 ENV KERNEL_SOURCE=https://www.kernel.org/pub/linux/kernel/v4.x/linux-${KERNEL_VERSION}.tar.xz @@ -13,8 +14,6 @@ COPY kernel_config.debug /linux/debug_config COPY kernel_config.4.4 /linux/kernel_config.4.4 RUN cat /linux/kernel_config.4.4 >> /linux/arch/x86/configs/x86_64_defconfig -ARG DEBUG=0 - RUN if [ $DEBUG -ne "0" ]; then \ sed -i 's/CONFIG_PANIC_ON_OOPS=y/# CONFIG_PANIC_ON_OOPS is not set/' /linux/arch/x86/configs/x86_64_defconfig; \ cat /linux/debug_config >> /linux/arch/x86/configs/x86_64_defconfig; \ diff --git a/kernel/Dockerfile.aufs b/kernel/Dockerfile.aufs index e41ac77ca..bee56e4bc 100644 --- a/kernel/Dockerfile.aufs +++ b/kernel/Dockerfile.aufs @@ -1,6 +1,7 @@ FROM mobylinux/alpine-build-kernel:0e893fbf6fa7638d2f23354de03ea11017bb8065@sha256:3ef3f9d11f0802b759dbd9c43a7706cf0ec37263c99ae90e2b10c29ea85739fa -ARG KERNEL_VERSION=4.9.14 +ARG KERNEL_VERSION +ARG DEBUG=0 ENV KERNEL_SOURCE=https://www.kernel.org/pub/linux/kernel/v4.x/linux-${KERNEL_VERSION}.tar.xz @@ -49,8 +50,6 @@ COPY kernel_config.debug /linux/debug_config COPY kernel_config.aufs /linux/aufs_config RUN cat /linux/aufs_config >> /linux/arch/x86/configs/x86_64_defconfig -ARG DEBUG=0 - RUN if [ $DEBUG -ne "0" ]; then \ sed -i 's/CONFIG_PANIC_ON_OOPS=y/# CONFIG_PANIC_ON_OOPS is not set/' /linux/arch/x86/configs/x86_64_defconfig; \ cat /linux/debug_config >> /linux/arch/x86/configs/x86_64_defconfig; \ diff --git a/kernel/Makefile b/kernel/Makefile index 21ad6539d..d3c8cb2bb 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -3,16 +3,19 @@ DEBUG ?= 0 all: bzImage push ifdef AUFS +KERNEL_VERSION=4.9.14 DEPS=Dockerfile.aufs Makefile kernel_config kernel_config.debug kernel_config.aufs patches-4.9 else ifdef LTS4.4 +KERNEL_VERSION=4.4.53 DEPS=Dockerfile.4.4 Makefile kernel_config kernel_config.debug kernel_config.4.4 patches-4.4 else +KERNEL_VERSION=4.9.14 DEPS=Dockerfile Makefile kernel_config kernel_config.debug patches-4.9 endif endif kernel.tag: $(DEPS) - BUILD=$$( tar cf - $^ | docker build -f $< --build-arg DEBUG=$(DEBUG) -q - ) && [ -n "$$BUILD" ] && echo "Built $$BUILD" && echo "$$BUILD" > $@ + BUILD=$$( tar cf - $^ | docker build -f $< --build-arg DEBUG=$(DEBUG) --build-arg KERNEL_VERSION=$(KERNEL_VERSION) -q - ) && [ -n "$$BUILD" ] && echo "Built $$BUILD" && echo "$$BUILD" > $@ bzImage: kernel.tag rm -rf etc/kernel-patches