How can I take a PREEMPT_RT patch to kernel on TX2?

For real-time requirement, I want to make a rt-linux kernel for TX2.
I download the kernel (linux-4.4.32.tar.gz) and the rt patch (patch-4.4.32-rt43.patch.gz), then make the kernel image with Complete Preempt option. Use ‘update-grub’ command and the display as follow:

nvidia@tegra-ubuntu:~$ sudo update-grub
[sudo] password for nvidia:
Generating grub configuration file …
Found linux image: /boot/vmlinuz-4.4.32-rt43
Found initrd image: /boot/initrd.img-4.4.32-rt43
Found linux image: /boot/vmlinuz-4.4.15-rt23
Found initrd image: /boot/initrd.img-4.4.15-rt23
Found linux image: /boot/vmlinuz-4.4.15-rt23.old
Found initrd image: /boot/initrd.img-4.4.15-rt23
Found Ubuntu 16.04 LTS (16.04) on /dev/mmcblk0p1

I got the linux image: /boot/vmlinuz-4.4.15-rt23 but I can’t choose it when startup(No grub GUI, start up directly).

My TX2 info:
nvidia@tegra-ubuntu:~$ uname -a
Linux tegra-ubuntu 4.4.38+ #43 SMP PREEMPT Wed Dec 13 10:21:54 CST 2017 aarch64 aarch64 aarch64 GNU/Linux

Did I download a wrong kernel release for TX2(aarch64)? How can I take a real-time kernel on TX2?

Grub is used only on x86 PCs (requires a BIOS or UEFI). Jetson’s use U-Boot (takes over some of the missing BIOS/UEFI function not present on an embedded system). A TX2 uses the Image, not the vmlinux image (U-Boot can’t handle most of those alternate kernel file formats…it could technically handle a zImage if not in 64-bit space). Basically “make Image”…but you would also need to go through correct steps for setting up a cross-compile environment, or else be directly on the TX2.

I doubt getting 4.4.32 from mainline will be easy or without significant pain. If you do want to go down that path, then start with the config from the existing kernel when booted…it’ll be found as a pseudo file ("/proc/config.gz").

A serial console is recommended to try various kernels since it lets you select from multiple kernel choices within U-Boot at boot time (just edit “/boot/extlinux/extlinux.conf” to add another entry). Put your kernel in “/boot” as an ordinary file copy with some alternate name (e.g., “/boot/Image-test1”).

A hard real-time kernel probably won’t be possible. A well-behaved soft real-time kernel might be possible with such patches if you are also selective about what you run. I have not applied those patches so I don’t know how much trouble it is, but I suspect it will be significant.

NOTE: I forget who it was, but there is a commercial RT version available for purchase.

Thanks a lot!

You mean I could use U-boot to guide my kernel to start.
Dose any linux kernel with a real-time patch could be used on TX2 (like 4.4.32)? Or with some limits?

U-Boot has a prompt to select entries from extlinux.conf, but only via serial console (there is no video driver at that stage). This allows you to try different kernels with different file names while keeping the original kernel in place as a fall back.

I don’t know if any publicly available RT kernels are available. If someone remembers who it is there is one commercial supplier of a complete RT system on the TX2…I just don’t remember who it is. It means it can be done, but there is a lot required to get real time…it isn’t trivial.