Closed rebeccaRossRobotics closed 1 month ago
Hello. Thank you for reporting this. I have a working version for kernel 6.x in another project and will post it here by Monday. I will return on this issue soon.
I have made an update to the repo: it should build with kernel 6.6 now. You may pull the latest changes and just run make
. I am getting the image on my machine:
-rw-r--r-- 1 rp rp 703745130 May 11 10:07 2024-03-15-raspios-bookworm-arm64-lite.zip
Let me know if you still have issues.
Hi,
I've tried the latest code on here but am still having issues getting an image with the RT kernel patch applied.
I had top make some mods to the docker file so it downloaded the patch as some of the variable references were wrong
# set PLATFORM32 to something not null if you're building for older platforms, i.e. Pi 1, Pi Zero, Pi Zero W and Pi CM1
# do not define PLATFORM32 or set it to null if you're building for newer platforms, i.e. Pi 3, Pi 3+, Pi 4, Pi 400, Pi Zero 2 W, Pi CM3, Pi CM3+, Pi CM4
FROM ubuntu:24.04
ARG PLATFORM32
ARG RASPIOS_IMAGE_NAME
ENV LINUX_KERNEL_VERSION=6.6
ENV LINUX_KERNEL_BRANCH=rpi-${LINUX_KERNEL_VERSION}.y
ENV LINUX_KERNEL_RT_PATCH=patch-6.6.30-rt30
ENV TZ=Europe/London
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update
RUN apt-get install -y git make gcc bison flex libssl-dev bc ncurses-dev kmod \
crossbuild-essential-arm64 crossbuild-essential-armhf \
wget zip unzip fdisk nano curl xz-utils jq
WORKDIR /rpi-kernel
RUN git clone https://github.com/raspberrypi/linux.git -b ${LINUX_KERNEL_BRANCH} --depth=1
WORKDIR /rpi-kernel/linux
RUN curl https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/${LINUX_KERNEL_VERSION}/${LINUX_KERNEL_RT_PATCH}.patch.gz --output ${LINUX_KERNEL_RT_PATCH}.patch.gz && \
gzip -cd /rpi-kernel/linux/${LINUX_KERNEL_RT_PATCH}.patch.gz | patch -p1 --verbose
# if PLATFORM32 has been defined then set KERNEL=kernel else set KERNEL=kernel8 (arm64)
ENV KERNEL=${PLATFORM32:+kernel}
ENV KERNEL=${KERNEL:-kernel8}
# if PLATFORM32 has been defined then set ARCH=arm else set ARCH=arm64
ENV ARCH=${PLATFORM32:+arm}
ENV ARCH=${ARCH:-arm64}
# if PLATFORM32 has been defined then set CROSS_COMPILE=arm-linux-gnueabihf- else set CROSS_COMPILE=aarch64-linux-gnu-
ENV CROSS_COMPILE=${PLATFORM32:+arm-linux-gnueabihf-}
ENV CROSS_COMPILE=${CROSS_COMPILE:-aarch64-linux-gnu-}
# print the above env variables
RUN echo ${KERNEL} ${ARCH} ${CROSS_COMPILE}
RUN [ "$ARCH" = "arm" ] && make bcmrpi_defconfig || make bcm2711_defconfig
RUN ./scripts/config --disable CONFIG_VIRTUALIZATION
RUN ./scripts/config --enable CONFIG_PREEMPT_RT
RUN ./scripts/config --disable CONFIG_RCU_EXPERT
RUN ./scripts/config --enable CONFIG_RCU_BOOST
RUN [ "$ARCH" = "arm" ] && ./scripts/config --enable CONFIG_SMP || true
RUN [ "$ARCH" = "arm" ] && ./scripts/config --disable CONFIG_BROKEN_ON_SMP || true
RUN ./scripts/config --set-val CONFIG_RCU_BOOST_DELAY 500
RUN make -j4 Image modules dtbs
RUN echo "using raspberry pi image ${RASPIOS_IMAGE_NAME}"
WORKDIR /raspios
RUN export DATE=$(curl -s https://downloads.raspberrypi.org/${RASPIOS_IMAGE_NAME}/images/ | sed -n "s:.*${RASPIOS_IMAGE_NAME}-\(.*\)/</a>.*:\1:p" | tail -1) && \
export RASPIOS=$(curl -s https://downloads.raspberrypi.org/${RASPIOS_IMAGE_NAME}/images/${RASPIOS_IMAGE_NAME}-${DATE}/ | sed -n "s:.*<a href=\"\(.*\).xz\">.*:\1:p" | tail -1) && \
echo "Downloading ${RASPIOS}.xz" && \
curl https://downloads.raspberrypi.org/${RASPIOS_IMAGE_NAME}/images/${RASPIOS_IMAGE_NAME}-${DATE}/${RASPIOS}.xz --output ${RASPIOS}.xz && \
xz -d ${RASPIOS}.xz
RUN mkdir /raspios/mnt && mkdir /raspios/mnt/disk && mkdir /raspios/mnt/boot
ADD build.sh ./build.sh
ADD config.txt ./
When I run make PiCM4
it generates the image, but when i put that image onto a CM4 it either doesn't boot properly and turns itself off, or if it does boot and I ssh into it and do uname -a
the resulting string is missing the SMP PREEMPT_RT
I will test on a CM4 by Friday. I think I have one somewhere. I will be back. Do you work on a custom hardware or on the official CM4 IO Board? I have the official CM4 IO board somewhere and will test on it.
Thanks! I've been testing on the official CM4 IO board.
Hey! Have you managed to test this?
Hello. I've just pushed a fix. I tested on my CM4 (IO board) and worked fine. It should print PREEMPT_RT now. Let me know if it works for you too.
Aamzing thanks! I will test is this week any let you know!
Hi! I'm trying to use your repo to add the RT Kernel along with support for PCIE for the CM4 but I keep getting these errors. Any idea on how to fix them?
I did have to make some small mods to the dockerfile...