mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-19 17:26:28 +00:00
kernel: Pass kernel version as build-arg to docker
Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
7020a2d975
commit
54cb00edd8
@ -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; \
|
||||
|
@ -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; \
|
||||
|
@ -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; \
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user