Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:24.04

ENV LINUX_KERNEL_VERSION=6.6
ENV LINUX_KERNEL_BRANCH=stable_20240529
ENV LINUX_KERNEL_RT_PATCH=patch-6.6.30-rt30
ENV LINUX_KERNEL_VERSION=6.12
ENV LINUX_KERNEL_BRANCH=stable_20250702
ENV LINUX_KERNEL_RT_PATCH=patch-6.12.43-rt12

ENV TZ=Europe/Copenhagen
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,15 @@ build:
custom:
docker run --rm --privileged -it rpi-rt-linux bash

# Extract relevant files for update of existing system.
kernel_zips:
docker images | grep rpi-rt-linux >/dev/null || ( echo "Build image before running this target." && exit 1)
docker rm -f tmp-rpi-rt-linux || true
docker run -dit --name tmp-rpi-rt-linux rpi-rt-linux
docker cp bundle_firmware_and_modules.sh tmp-rpi-rt-linux:/raspios/.
docker exec --privileged tmp-rpi-rt-linux /raspios/bundle_firmware_and_modules.sh
docker cp tmp-rpi-rt-linux:/raspios/kernel_zips ./
docker rm -f tmp-rpi-rt-linux

clean:
rm -fr build
42 changes: 42 additions & 0 deletions bundle_firmware_and_modules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

cd /rpi-kernel/linux/
make INSTALL_MOD_PATH=/raspios/mnt/disk modules_install
make INSTALL_DTBS_PATH=/raspios/mnt/boot/firmware dtbs_install
cd -


if [ "$ARCH" = "arm64" ]; then
echo "arm_64bit=1" >> /raspios/config.txt
cp /rpi-kernel/linux/arch/arm64/boot/Image.gz /raspios/mnt/boot/firmware/$KERNEL\_rt.img
cp /rpi-kernel/linux/arch/arm64/boot/dts/broadcom/*.dtb /raspios/mnt/boot/firmware/
cp /rpi-kernel/linux/arch/arm64/boot/dts/overlays/*.dtb* /raspios/mnt/boot/firmware/overlays/
cp /rpi-kernel/linux/arch/arm64/boot/dts/overlays/README /raspios/mnt/boot/firmware/overlays/
elif [ "$ARCH" = "arm" ]; then
echo "arm_64bit=0" >> /raspios/config.txt
cp /rpi-kernel/linux/arch/arm/boot/zImage /raspios/mnt/boot/firmware/$KERNEL\_rt.img
cp /rpi-kernel/linux/arch/arm/boot/dts/broadcom/*.dtb /raspios/mnt/boot/firmware/
cp /rpi-kernel/linux/arch/arm/boot/dts/overlays/*.dtb* /raspios/mnt/boot/firmware/overlays/
cp /rpi-kernel/linux/arch/arm/boot/dts/overlays/README /raspios/mnt/boot/firmware/overlays/
fi

# Redundant files…
rm -r /raspios/mnt/boot/firmware/broadcom

KERNEL_VERSION=$(ls -1 /raspios/mnt/disk/lib/modules)
TARGET_DIR="/raspios/kernel_zips"
MODULES_ZIP="modules.${KERNEL_VERSION}.zip"
BOOT_ZIP="boot.${KERNEL_VERSION}.zip"
sed -zne "/[ \n\t]./{q1;}" <<< "$KERNEL_VERSION" || ( echo "Strange modules folder name?!" && exit 1)

mkdir -p "${TARGET_DIR}"
cd /raspios/mnt/disk
zip --symlinks -r "${TARGET_DIR}/${MODULES_ZIP}" *
cd /raspios/mnt/boot/firmware
zip --symlinks -r "${TARGET_DIR}/${BOOT_ZIP}" *

echo "Done.

1. Unzip '${BOOT_ZIP}' on / (rootfs-partition) and '${MODULES_ZIP}' on /boot/firmware (boot-partition)
2. Update boot/config.txt with kernel=${KERNEL}_rt.img
"