Closed matthiasthomasbecker closed 2 years ago
running dockerlint on the Dockerfile throws an error at line 17 RUN contains and undefined ARG or ENV variable
I'm not sure what exactly it's missing, but I can say that manually applying the patch works.
For now, I've made the following edits to my version of the Dockerfile:
||
to an empty command that will return zero so docker will move on to the next step. source: stack overflow gzip -cd /rpi-kernel/linux/${PATCH}.patch.gz
to just gzip -cd ${PATCH}.patch.gz
as docker would complain that it couldn't find the patch with the original pathdiff --git a/Dockerfile b/Dockerfile
index b13517d..2358e7a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -14,10 +14,10 @@ RUN apt-get install -y wget zip unzip fdisk nano curl xz-utils
WORKDIR /rpi-kernel
RUN git clone https://github.com/raspberrypi/linux.git -b ${LINUX_KERNEL_BRANCH} --depth=1
WORKDIR /rpi-kernel/linux
-RUN export PATCH=$(curl -s https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/${LINUX_KERNEL_VERSION}/ | sed -n 's:.*<a href="\(.*\).patch.gz">.*:\1:p' | sort -V | tail -1) && \
- echo "Downloading patch ${PATCH}" && \
- curl https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/${LINUX_KERNEL_VERSION}/${PATCH}.patch.gz --output ${PATCH}.patch.gz && \
- gzip -cd /rpi-kernel/linux/${PATCH}.patch.gz | patch -p1 --verbose
+
+RUN export PATCH=$(curl -s https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/5.10/ | sed -n 's:.*<a href="\(.*\).patch.gz">.*:\1:p' | sort -V | tail -1) && echo "Downloading patch ${PATCH}" && wget https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/5.10/${PATCH}.patch.gz
+
+RUN export PATCH=$(curl -s https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/5.10/ | sed -n 's:.*<a href="\(.*\).patch.gz">.*:\1:p' | sort -V | tail -1) && sh -xc 'gzip -cd ${PATCH}.patch.gz | patch -p1 --verbose' || :
ENV KERNEL=kernel8
ENV ARCH=arm64
I listed four items, but I lament as I wonder if just using the logical or to an empty command would be good enough for the time being.
Right now the kernel is still compiling, which is good....so I'll see if this works out once it gets to building the img file. Will update when that happens.
Thank you a lot! The proposed changes to the dockerfile worked for me and I could successfully build the image with the preempt-rt patch applied.
Sorry to jump in: if the patch fails to be applied then I wouldn't fully trust the kernel. Maybe it works, maybe it doesn't. My bet right now is that 5.10 is not maintained anymore on https://github.com/raspberrypi/linux and newly RT patches for 5.10 fail to be applied.
However, I noticed that https://github.com/raspberrypi/linux moved to rpi-5.15.y branch by default so I changed to the same default branch in this repo. The patch successfully applies and things build fine with 5.15. I would recommend upgrading to 5.15 or if you insist on using 5.10 then I think you need to switch to an older RT patch that is compatible with the rpi-5.10.y branch (the newest RT patch doesn't work anymore).
thank you a lot! I rebuild the kernel using 5.15 and all went smooth.
I am not sure what exactly went wrong when I tried it initially as I got the same error for 5.10 and 5.15 when the patch was applied.
Hi,
I get an error in the build process when the patch is applied. I am not quite sure what the problem is, the error message is appended below. This happens for me with different kernel versions (I tried 5.10 and 5.15).
Is there a known way to work around this?
Thanks a lot!