Skip to content

Commit ded9c5f

Browse files
committed
fix build for kernel versions x.x.0 and new path in coreos image
1 parent d243b5f commit ded9c5f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ARG COREOS_RELEASE_CHANNEL=stable
1111
ARG COREOS_VERSION
1212
ARG NVIDIA_DRIVER_VERSION
1313
ARG KERNEL_VERSION
14+
ARG KERNEL_TAG
1415

1516
ENV KERNEL_PATH /usr/src/kernels/linux
1617
ENV KERNEL_NAME ${KERNEL_VERSION}-coreos
@@ -20,15 +21,15 @@ ENV COREOS_RELEASE_URL https://${COREOS_RELEASE_CHANNEL}.release.core-os.net/amd
2021
RUN git clone ${KERNEL_REPOSITORY} \
2122
--single-branch \
2223
--depth 1 \
23-
--branch v${KERNEL_VERSION} \
24+
--branch v${KERNEL_TAG} \
2425
${KERNEL_PATH}
2526

2627
WORKDIR ${KERNEL_PATH}
2728

28-
RUN git checkout -b stable v${KERNEL_VERSION} && rm -rf .git
29+
RUN git checkout -b stable v${KERNEL_TAG} && rm -rf .git
2930
RUN curl ${COREOS_RELEASE_URL}/coreos_developer_container.bin.bz2 | \
3031
bzip2 -d > /tmp/coreos_developer_container.bin
31-
RUN 7z e /tmp/coreos_developer_container.bin "usr/lib64/modules/*-coreos/build/.config"
32+
RUN 7z e /tmp/coreos_developer_container.bin "usr/lib64/modules/*-coreos*/build/.config"
3233
RUN make modules_prepare
3334
RUN sed -i -e "s/${KERNEL_VERSION}/${KERNEL_NAME}/" include/generated/utsrelease.h
3435

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ endif
2828
# the CoreOS release feed.
2929
KERNEL_VERSION = $(shell \
3030
curl -s ${COREOS_RELEASES_URL} | \
31-
jq -r .[\"${COREOS_VERSION}\"].major_software.kernel[0] | \
32-
sed -e 's/\(\.0\)*$$//g')
31+
jq -r .[\"${COREOS_VERSION}\"].major_software.kernel[0])
32+
33+
KERNEL_TAG := $(shell echo ${KERNEL_VERSION} | sed -e 's/\(\.0\)*$$//g')
3334

3435
# Environment
3536
WORKDIR := $(PWD)
@@ -75,6 +76,7 @@ build: validate
7576
--build-arg COREOS_VERSION=$(COREOS_VERSION) \
7677
--build-arg NVIDIA_DRIVER_VERSION=$(NVIDIA_DRIVER_VERSION) \
7778
--build-arg KERNEL_VERSION=$(KERNEL_VERSION) \
79+
--build-arg KERNEL_TAG=$(KERNEL_TAG) \
7880
--tag $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_REPOSITORY):$(COREOS_VERSION) \
7981
--file $(WORKDIR)/Dockerfile . \
8082

0 commit comments

Comments
 (0)