mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-12-24 13:03:05 +00:00
I got error when un-tarring the linux-4.14 kernel: tar: linux-4.14/arch/arm64/boot/dts/arm: Directory renamed before its status could be extracted tar: linux-4.14/arch/arm64/boot/dts: Directory renamed before its status could be extracted tar: linux-4.14/arch/arm64/boot: Directory renamed before its status could be extracted tar: linux-4.14/arch/arm64: Directory renamed before its status could be extracted tar: linux-4.14/arch: Directory renamed before its status could be extracted Using bsdtar, this error goes away. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
40 lines
1.3 KiB
Docker
40 lines
1.3 KiB
Docker
FROM linuxkit/alpine:07f7d136e427dc68154cd5edbb2b9576f9ac5213 AS kernel-build
|
|
RUN apk add \
|
|
argp-standalone \
|
|
build-base \
|
|
curl \
|
|
diffutils \
|
|
libarchive-tools \
|
|
ncurses-dev \
|
|
xz
|
|
|
|
ARG KERNEL_VERSIONS
|
|
|
|
COPY / /
|
|
|
|
# Unpack kernels (download if not present)
|
|
RUN set -e && for VERSION in ${KERNEL_VERSIONS}; do \
|
|
echo "Downloading/Unpacking $VERSION" && \
|
|
KERNEL_SOURCE=https://www.kernel.org/pub/linux/kernel/v4.x/linux-${VERSION}.tar.xz && \
|
|
[ -f sources/linux-${VERSION}.tar.xz ] || curl -fSLo sources/linux-${VERSION}.tar.xz ${KERNEL_SOURCE} && \
|
|
bsdtar xf sources/linux-${VERSION}.tar.xz; \
|
|
done
|
|
|
|
# Apply patches to all kernels and move config files into place
|
|
RUN for VERSION in ${KERNEL_VERSIONS}; do \
|
|
SERIES=${VERSION%.*}.x && \
|
|
echo "Patching $VERSION" && \
|
|
cd /linux-${VERSION} && \
|
|
set -e && \
|
|
if [ -d /patches-${KERNEL_SERIES} ]; then \
|
|
for patch in /patches-${SERIES}/*.patch; do \
|
|
echo "Applying $patch" && \
|
|
patch -p1 < "$patch"; \
|
|
done; \
|
|
fi && \
|
|
mv /config-${SERIES}-x86_64 arch/x86/configs/x86_64_defconfig && \
|
|
mv /config-${SERIES}-aarch64 arch/arm64/configs/defconfig; \
|
|
done
|
|
|
|
ENTRYPOINT ["/bin/sh"]
|