Is the Beaglebone Linux Kernel PREEMPT_RT patched?

Hi everyone.

I’m utilizing the Beaglebone Black for a project I am working on that I am using to teach myself about embedded Linux. I require that the kernel is patched with the PREEMPT_RT patch from Redhat for lower latency. I came across this link:

https://patchwork.amarulasolutions.com/patch/3315/

that suggest to me that the default kernel is already patched with the PREEMPT_RT patch.

The reason I believe this is the case is because of this line in the patch.

+sha256 f1ae7325c6c146e0f852866a3bfd3f90ae1b5f46e414bc99a38384ed677e3721 linux-6.6.32-ti-arm32-r7.tar.gz

This line indicated that the sha256sum was calculated based on the linux-6.6.32-ti-arm32-r7.tar.gz and not the linux-6.6.32-ti-rt-arm32-r7.tar.gz, noticing the -rt piece.

Can anyone shed some light on whether or not this is true, and if not, is there anyone here that could give me the sha256sum for the linux-6.6.32-ti-arm32-r7.tar.gz so that I can use it in my Buildroot setup?

Regards
Dawid J. Blom

I’ve got non-rt and rt builds of 6.6.x:

Non-RT: GitHub - beagleboard/linux at v6.6.32-ti-arm32-r7

and

RT: GitHub - beagleboard/linux at v6.6.32-ti-rt-arm32-r7

v6.6.32-ti-rt-arm32-r7 tag includes: merge: CONFIG_PREEMPT_RT Patch Set · beagleboard/linux@b5f785e · GitHub

Regards,

Hi Robert, thank you for the information.

I found the kernels you are referring to and I appreciate that you guys provide both kernels, it makes my life a lot easier.

Follow-Up Question:
In Buildroot when the build system goes to download the kernel that the user specified to use, it requires a hash for the beaglebone kernels. Currently, it seems that beaglebone does not provide the hashes for Buildroot to use the RT kernel. I came across this hash, sha256 84003bc656c6b012e8ea32945559d1ee265a1227037178360d52a667122ffea5 linux-6.6.32-ti-rt-arm32-r7.tar.gz through trial and error and I was wondering if Beaglebone provides these different hashes to the public for us users to use and if so, where can I get them?

If beaglebone does not provide the hashes to the public, could I perhaps send my BSP for beaglebone black that uses the RT kernel you mentioned above along with a defconfig upstream? That way others can get a hold of the PREEMPT_RT patched kernel via Buildroot without the hassle?

Kind regards
Dawid J. Blom

Just Point Buildroot to the branch: v6.6.32-ti-rt-arm32-r7
GitHub - beagleboard/linux at v6.6.32-ti-rt-arm32-r7 has a git sha value of: 600786f98b18073e028ab3030fdd60ca98e8f372 6.6.32-ti-rt-arm32-r7 · beagleboard/linux@600786f · GitHub

There’s nothing for us to generate, when you git clone a tree, you going to get that sha…

Regards,

Hi Robert,

That’s interesting because the error suggests something else. I don’t think Buildroot has an issue with git cloning, because the command that fails is wget and it fails because the hash is wrong. For example, this is the error I get and the suggested hash I used to get passed it in order to produce the RT image. This was a test I ran just now after you gave the suggestion of just pointing to the RT branch. I added that hash in that you gave.

ERROR: while checking hashes from board/beagleboard-rt/beaglebone-rt/patches/linux-headers/linux-headers.hash ERROR: linux-6.6.32-ti-rt-arm32-r7.tar.gz has wrong sha256 hash: ERROR: expected: 600786f98b18073e028ab3030fdd60ca98e8f372 ERROR: got : 84003bc656c6b012e8ea32945559d1ee265a1227037178360d52a667122ffea5 ERROR: Incomplete download, or man-in-the-middle (MITM) attack`

So I was just curious if it’s possible to add this hash 84003bc656c6b012e8ea32945559d1ee265a1227037178360d52a667122ffea5 to the beaglebone Buildroot BSP. Currently, the BSP in Buildroot does not just point to the Git URL so I assumed that Beaglebone handles it in a particular way and I wanted to conform to that method. But never mind I got the Hash via some Janky trial and error so it’s ok.

Thank you for your effort.

Kind regards,
Dawid J. Blom

No, this is a problem in your buildroot configuration changes. you can share you current buildroot diff, for pointers…

Hi Robert,

Yes that would be great, since I cannot think of any configs that have messed up. So, let me explain what I did. Firstly, I downloaded buildroot-2024.08-rc3. Secondly, form within the buildroot directory, I copied the board/beagleboard/beaglebone/ directory and renamed it to board/beagleboard-rt/beaglebone-rt, noticing the -rt at the end. Thirdly, I adjusted the configs in this file linux-sgx.fragment and I updated the hash from the trial and error I mentioned earlier in this file board/beagleboard-rt/beaglebone-rt/patches/linux/linux.hash. Finally, I copied the configs/beaglebone_defconfig and renamed it to beaglebone_rt_defconfig and adjusted it’s URL to point to the kernel you mentioned earlier.

Here are the diffsf

BSP_DIFF
diff -r board/beagleboard/beaglebone/linux-sgx.fragment board/beagleboard-rt/beaglebone-rt/linux-sgx.fragment
1a2

CONFIG_PREEMPT_RT_FULL=y
2a4
CONFIG_HIGH_RES_TIMERS=y
diff -r board/beagleboard/beaglebone/patches/linux/linux.hash board/beagleboard-rt/beaglebone-rt/patches/linux/linux.hash
2c2
< sha256 f1ae7325c6c146e0f852866a3bfd3f90ae1b5f46e414bc99a38384ed677e3721 linux-6.6.32-ti-arm32-r7.tar.gz


sha256 84003bc656c6b012e8ea32945559d1ee265a1227037178360d52a667122ffea5 linux-6.6.32-ti-rt-arm32-r7.tar.gz
diff -r board/beagleboard/beaglebone/patches/linux-headers/linux-headers.hash board/beagleboard-rt/beaglebone-rt/patches/linux-headers/linux-headers.hash
2c2
< sha256 f1ae7325c6c146e0f852866a3bfd3f90ae1b5f46e414bc99a38384ed677e3721 linux-6.6.32-ti-arm32-r7.tar.gz


sha256 84003bc656c6b012e8ea32945559d1ee265a1227037178360d52a667122ffea5 linux-6.6.32-ti-rt-arm32-r7.tar.gz
diff -r board/beagleboard/beaglebone/rootfs_overlay/etc/qt5/eglfs_kms_cfg.json board/beagleboard-rt/beaglebone-rt/rootfs_overlay/etc/qt5/eglfs_kms_cfg.json
12c12
< “mode”: “1024x768”


  "mode": "off"

DEFCONFIG_DIFF
1d0
< # Architecture
5,6d3
<
< # Linux headers same as kernel, a 6.6 series
8,10c5
<
< # System
< BR2_GLOBAL_PATCH_DIR=“board/beagleboard/beaglebone/patches”

BR2_GLOBAL_PATCH_DIR=“board/beagleboard-rt/beaglebone-rt/patches”
11a7,8
< # Image
< BR2_ROOTFS_POST_BUILD_SCRIPT=“board/beagleboard/beaglebone/post-build.sh”


BR2_ROOTFS_POST_BUILD_SCRIPT=“board/beagleboard-rt/beaglebone-rt/post-build.sh”
17,19c12
< BR2_ROOTFS_POST_SCRIPT_ARGS=“-c board/beagleboard/beaglebone/genimage.cfg”
<
< # Kernel


BR2_ROOTFS_POST_SCRIPT_ARGS=“-c board/beagleboard-rt/beaglebone-rt/genimage.cfg”
22c15
< BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION=“$(call github,beagleboard,linux,6.6.32-ti-arm32-r7)/linux-6.6.32-ti-arm32-r7.tar.gz”


BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION=“$(call github,beagleboard,linux,6.6.32-ti-rt-arm32-r7)/linux-6.6.32-ti-rt-arm32-r7.tar.gz”
25a19
BR2_LINUX_KERNEL_INTREE_DTS_OVERLAY_NAMES=“ti/omap/BB-UART1-00A0 ti/omap/BB-UART2-00A0 ti/omap/BB-UART4-00A0”
27,28c21,24
<
< # Filesystem


BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_XZ=y
BR2_PACKAGE_KMOD=y
BR2_PACKAGE_KMOD_TOOLS=y
31,32d26
<
< # Bootloader
44,45d37
<
< # Required tools to create the SD image
48,54d39
< BR2_PACKAGE_HOST_MTOOLS=y
<
< # Enable compressed kernel module support
< BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
< BR2_PACKAGE_KMOD_TOOLS=y
< BR2_PACKAGE_XZ=y
< BR2_PACKAGE_KMOD=y
55a41
BR2_PACKAGE_HOST_MTOOLS=y

I also attached the files for your convenience.
BSP_diff.txt (1.1 KB)
defconfig_diff.txt (1.4 KB)

Kind regards,
Dawid J. Blom

Um… configs/beaglebone: bump Linux to 6.6.32-ti-rt-arm32-r7 and U-Boot to… · buildroot/buildroot@e321e81 · GitHub

The Buildroot target “configs/beaglebone_defconfig” is already on 6.6.x-rt…

Regards,

Hi Robert.

Ok, so you mean that the assumption I made with the question I had at the very beginning is correct in the context of Buildroot but not individual Beaglebone kernels? My question was about whether or not the beaglebone kernel is patched with the PREEMP_RT patch by default because of this configs/beaglebone: bump Linux to 6.6.32-ti-rt-arm32-r7 and U-Boot to… · buildroot/buildroot@e321e81 · GitHub.

The reason I want to clarify it is because this line in the default beaglebone_defconfig
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION=“$(call github,beagleboard,linux,6.6.32-ti-arm32-r7)/linux-6.6.32-ti-arm32-r7.tar.gz”
points to the non-RT kernel and when you build and boot the image using that kernel and you run uname -ra the output specifies PREEMPT and not PREEMPT_RT. However, after I made my changes pointing my beaglebone_rt_defconfig to the RT kernel and got the hash through trial and error, I booted the image and confirmed that it is patched with the PREEMPT_RT patch since the output of uname -ra shows PREEMPT_RT.

Kind regards,
Dawid J. Blom

The commit message doesn’t match the actual commit… the message talked about rt, but it’s grabbing the none rt kernel. Just now by 6.6 a lot of RT is in mainline but it’s not the full patches.

Anyways ping the buildroot group, they probably meant to grab full rt…

Hi Robert.

Alright, thank you for the effort invested into my questions. I will get in contact with the Buildroot community.

Kind regards,
Dawid J. Blom