diff --git a/Dockerfile b/Dockerfile index d0356fc..b74b2c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Makefile b/Makefile index 8f104bc..8cb356b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/bundle_firmware_and_modules.sh b/bundle_firmware_and_modules.sh new file mode 100755 index 0000000..466c503 --- /dev/null +++ b/bundle_firmware_and_modules.sh @@ -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 +"