This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
comfilepi:compile_a_real-time_kernel:index [2023/05/12 10:27] COMFILE Technology [Compile and Deploy a Real-Time Kernel to the ComfilePi] |
comfilepi:compile_a_real-time_kernel:index [2023/11/22 08:57] (current) COMFILE Technology [Deploy to the ComfilePi] |
||
---|---|---|---|
Line 8: | Line 8: | ||
===== Kernel Versioning ===== | ===== Kernel Versioning ===== | ||
- | The Raspberry Pi Foundation maintains the kernel for Raspberry Pi-based products at https://github.com/raspberrypi/linux. The real-time kernel patches are maintained by a different group at https://cdn.kernel.org/pub/linux/kernel/projects/rt/. Compile errors and/or patch errors can arise if the 3 digit version number of the Raspberry Pi kernel and the real time patch do not match. The Raspberry Pi Foundation and the real-time patch maintainers do no coordinate their releases, so one must search the [[https://github.com/raspberrypi/linux/commits/rpi-5.10.y/Makefile|kernel's Makefile version history]] for a "Linux x.y.z" commit that matches the real-time kernel patch version, then use the "Merge remote-tracking..." commit that follows it. At the time of writing this, the latest such commit for the 5.10.y branch was here: | + | The Raspberry Pi Foundation maintains the kernel for Raspberry Pi-based products at https://github.com/raspberrypi/linux. The real-time kernel patches are maintained by a different group at https://cdn.kernel.org/pub/linux/kernel/projects/rt/. Compile errors and/or patch errors can arise if the 3 digit version number of the Raspberry Pi kernel and the real time patch do not match. The Raspberry Pi Foundation and the real-time patch maintainers do no coordinate their releases, so one must search the [[https://github.com/raspberrypi/linux/commits/rpi-6.1.y|kernel's commit history]] for a "Linux x.y.z" commit that matches the real-time kernel patch version, then use the "Merge remote-tracking..." commit that follows it. At the time of writing this, the latest such commit for the 5.10.y branch was here: |
{{ :comfilepi:compile_a_real-time_kernel:commit.png }} | {{ :comfilepi:compile_a_real-time_kernel:commit.png }} | ||
Line 79: | Line 79: | ||
# copy assets to the $PROJECT_DIR/result directory | # copy assets to the $PROJECT_DIR/result directory | ||
RESULT_DIR=$WORK_DIR/result | RESULT_DIR=$WORK_DIR/result | ||
- | cp "${WORK_DIR}/linux/arch/$ARCH/boot/Image.gz" "${RESULT_DIR}/boot/$KERNEL_NAME.img" | + | mkdir -p $RESULT_DIR/boot/overlays |
- | cp -r ${WORK_DIR}/linux/modules_to_install/lib/* "${RESULT_DIR}/lib/" | + | cp ${WORK_DIR}/linux/arch/$ARCH/boot/Image.gz ${RESULT_DIR}/boot/$KERNEL_NAME.img |
- | cp ${WORK_DIR}/linux/arch/$ARCH/boot/dts/broadcom/*.dtb "${RESULT_DIR}/boot/" | + | cp -r ${WORK_DIR}/linux/modules_to_install/lib/* ${RESULT_DIR}/lib/ |
- | cp ${WORK_DIR}/linux/arch/$ARCH/boot/dts/overlays/*.dtb* "${RESULT_DIR}/boot/overlays/" | + | cp ${WORK_DIR}/linux/arch/$ARCH/boot/dts/broadcom/*.dtb ${RESULT_DIR}/boot/ |
- | cp "${WORK_DIR}/linux/arch/$ARCH/boot/dts/overlays/README" "${RESULT_DIR}/boot/overlays/" | + | cp ${WORK_DIR}/linux/arch/$ARCH/boot/dts/overlays/*.dtb* ${RESULT_DIR}/boot/overlays/ |
+ | cp ${WORK_DIR}/linux/arch/$ARCH/boot/dts/overlays/README ${RESULT_DIR}/boot/overlays/ | ||
</code> | </code> | ||
===== Deploy to the ComfilePi ===== | ===== Deploy to the ComfilePi ===== | ||
- | After running the build script above, the //rtkernel/result// directory will contain 2 directories: //fat32// and //ext4//. The //fat32// directory contains assets that must be deployed to the ComfilePi's FAT32 partition (i.e. the ///boot// directory) and the //ext4// directory contains assets that must be deployed to the ComfilePi's operating system root partition (i.e. the ///// directory). | + | After running the build script above, the //rtkernel/result// directory will contain 2 directories: //boot// and //lib//. The //boot// directory contains assets that must be deployed to the ComfilePi's FAT32 partition (i.e. the ///boot// directory) and the //lib// directory contains assets that must be deployed to the ComfilePi's operating system root partition (i.e. the ///lib// directory). |
+ | On the build PC: | ||
<code bash> | <code bash> | ||
# Package up the result into a single file | # Package up the result into a single file | ||
- | tar czf rtkernel.tgz rtkernel/result/* | + | tar czf rtkernel.tgz -C rtkernel/result/ . |
# transfer the file to the ComfilePi | # transfer the file to the ComfilePi | ||
Line 98: | Line 100: | ||
</code> | </code> | ||
+ | [[http://downloads.comfiletech.com/ComfilePi/realtime/rtkernel_6.1.26-rt8.tgz|Download rtkernel_6.1.26-rt8.tgz]] (MD5: cadb563fc3cc61e9a2a5fc571a08004a) | ||
+ | |||
+ | On the ComfilePi: | ||
<code bash> | <code bash> | ||
- | # Unpack the files | + | # Install the kernel assets |
- | tar xzf rtkernel.tgz | + | sudo tar xzf rtkernel.tgz --directory / --keep-directory-symlink --no-same-owner |
- | + | ||
- | cd rtkernel/result | + | |
- | + | ||
- | # Copy files to the /boot directory | + | |
- | sudo cp fat32/zImage /boot/kernel7.img | + | |
- | sudo cp fat32/*.dtb /boot/ | + | |
- | sudo cp fat32/overlays/*.dtb* /boot/overlays/ | + | |
- | sudo cp fat32/overlays/README /boot/overlays/ | + | |
- | + | ||
- | # Copy files to the / directory | + | |
- | sudo cp -rd ext4/lib/* /lib | + | |
</code> | </code> | ||
Line 117: | Line 111: | ||
<code> | <code> | ||
$uname -a | $uname -a | ||
- | Linux raspberrypi 5.10.35-rt39-v7+ #1 SMP PREEMPT_RT Thu Jun 24 11:13:50 KST 2021 armv7l GNU/Linux | + | Linux raspberrypi 6.1.21-rt8-v8+ #1 SMP PREEMPT_RT Fri May 12 10:19:19 KST 2023 aarch64 GNU/Linux |
</code> | </code> | ||