rt patch on Nvidia Xavier Agx

Hello,

I trying to patch a rt Kernel on my Nvidia Xavier Agx.

Have someone indructions how to do it?

Could you give me some advices about how to do the patch and which files and packages are required? I’ve never done that before. A detailed step-by-step guide would be very helpful!

Thanks in advance!

Download public sources from https://developer.nvidia.com/embedded/linux-tegra for 32.2 release

Download toolchain

tar -xvf <path where tar file is stored>/public_sources.tbz2
	
cd <path to above tar file>/public_sources; tar -xvf kernel_src.tbz2
	
cd <path to public_sources directory>/kernel/kernel-4.9/scripts
	
./rt-patch.sh apply-patches (this steps must succeed)
	
cd ../  ;back to kernel 4.9 directory
	
mkdir <create kernel output directory where output build artifacts will be stored>
	
export CROSS_COMPILE=<path to toolchain downloaded in step 2>/bin/aarch64-linux-gnu-; export LOCALVERSION=-tegra
	
make ARCH=arm64 O=<absolute path to directory created in step 8> -j4 tegra_defconfig
	
make ARCH=arm64 O=<absolute path to directory created in step 8> -j4 Image
	
mkdir <create kernel module install directory>
	
make ARCH=arm64 O=<absolute path to directory created in step 8> modules INSTALL_MOD_PATH=<absolute path to directory created in step 12> -j4
	
make ARCH=arm64 O=<absolute path to directory created in step 8> modules_install INSTALL_MOD_PATH=<absolute path to directory created in step 12>
	
scp <kernel output directory from step 8>arch/arm64/boot/Image nvidia@<DUT IP address>:/tmp
	
execute this in DUT: sudo mv /boot/Image /home/nvidia/ (take a backup); sudo cp /tmp/Image /boot/Image
	
scp -r <path to module install directory created in step 12>/lib/modules/4.9.140-rt93-tegra nvidia@<DUT IP address>:/tmp, this will take some time
	
In the DUT take a backup; sudo mv /lib/modules/4.9.140-tegra /home/nvidia/
	
In the DUT; sudo mv /tmp/4.9.140-rt93-tegra /lib/modules/
	
In the DUT: sync; systemctl reboot
	
During the boot it should display "Linux version 4.9.140-rt93-tegra xxxxxxxx RT <compilation date stamp>"

Hallo

if i execute the command in line 17 i got the following error massage.
I think the error is in line 13. toolchain/bin/aarch64-linux-gnu-; Do i have to chosse one of this files in the bin directory

make ARCH=arm64 O=/home/nvidia/public_sources/kernel/kernel-4.9/kernelOut/ -j4 Image
make[1]: Entering directory ‘/home/nvidia/public_sources/kernel/kernel-4.9/kernelOut’
…/scripts/gcc-version.sh: line 25: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot execute binary file: Exec format error
…/scripts/gcc-version.sh: line 26: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot execute binary file: Exec format error
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
GEN ./Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
arch/arm64/Makefile:49: LSE atomics not supported by binutils
…/scripts/gcc-version.sh: line 25: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot execute binary file: Exec format error
…/scripts/gcc-version.sh: line 26: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot execute binary file: Exec format error
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
CHK include/config/kernel.release
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
GEN ./Makefile
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
UPD include/config/kernel.release
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
WRAP arch/arm64/include/generated/asm/bugs.h
WRAP arch/arm64/include/generated/asm/clkdev.h
WRAP arch/arm64/include/generated/asm/cputime.h
WRAP arch/arm64/include/generated/asm/delay.h
WRAP arch/arm64/include/generated/asm/div64.h
WRAP arch/arm64/include/generated/asm/dma.h
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
WRAP arch/arm64/include/generated/asm/early_ioremap.h
WRAP arch/arm64/include/generated/asm/emergency-restart.h
WRAP arch/arm64/include/generated/asm/dma-contiguous.h
WRAP arch/arm64/include/generated/asm/errno.h
WRAP arch/arm64/include/generated/asm/ioctl.h
CHK include/generated/uapi/linux/version.h
WRAP arch/arm64/include/generated/asm/ioctls.h
WRAP arch/arm64/include/generated/asm/hw_irq.h
WRAP arch/arm64/include/generated/asm/irq_regs.h
WRAP arch/arm64/include/generated/asm/ipcbuf.h
UPD include/generated/uapi/linux/version.h
WRAP arch/arm64/include/generated/asm/kvm_para.h
WRAP arch/arm64/include/generated/asm/kmap_types.h
WRAP arch/arm64/include/generated/asm/kdebug.h
WRAP arch/arm64/include/generated/asm/local64.h
WRAP arch/arm64/include/generated/asm/mcs_spinlock.h
WRAP arch/arm64/include/generated/asm/local.h
WRAP arch/arm64/include/generated/asm/mm-arch-hooks.h
WRAP arch/arm64/include/generated/asm/mman.h
WRAP arch/arm64/include/generated/asm/msi.h
WRAP arch/arm64/include/generated/asm/msgbuf.h
WRAP arch/arm64/include/generated/asm/poll.h
WRAP arch/arm64/include/generated/asm/preempt.h
WRAP arch/arm64/include/generated/asm/mutex.h
WRAP arch/arm64/include/generated/asm/resource.h
WRAP arch/arm64/include/generated/asm/segment.h
WRAP arch/arm64/include/generated/asm/sembuf.h
WRAP arch/arm64/include/generated/asm/rwsem.h
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
WRAP arch/arm64/include/generated/asm/shmbuf.h
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
WRAP arch/arm64/include/generated/asm/serial.h
WRAP arch/arm64/include/generated/asm/sizes.h
WRAP arch/arm64/include/generated/asm/simd.h
WRAP arch/arm64/include/generated/asm/socket.h
WRAP arch/arm64/include/generated/asm/sockios.h
WRAP arch/arm64/include/generated/asm/swab.h
WRAP arch/arm64/include/generated/asm/switch_to.h
WRAP arch/arm64/include/generated/asm/termbits.h
CHK include/generated/utsrelease.h
WRAP arch/arm64/include/generated/asm/trace_clock.h
WRAP arch/arm64/include/generated/asm/types.h
WRAP arch/arm64/include/generated/asm/termios.h
WRAP arch/arm64/include/generated/asm/user.h
WRAP arch/arm64/include/generated/asm/unaligned.h
WRAP arch/arm64/include/generated/asm/vga.h
UPD include/generated/utsrelease.h
WRAP arch/arm64/include/generated/asm/xor.h
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
WRAP arch/arm64/include/generated/uapi/asm/kvm_para.h
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
HOSTCC scripts/basic/bin2c
Using … as source for kernel
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: cannot open @@: No such file
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: ELF: not found
/home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: 3: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Syntax error: “(” unexpected
CHK include/generated/timeconst.h
CC kernel/bounds.s
/bin/sh: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Exec format error
…/./Kbuild:20: recipe for target ‘kernel/bounds.s’ failed
make[2]: *** [kernel/bounds.s] Error 2
make[2]: *** Waiting for unfinished jobs…
UPD include/generated/timeconst.h
/home/nvidia/public_sources/kernel/kernel-4.9/Makefile:1149: recipe for target ‘prepare0’ failed
make[1]: *** [prepare0] Error 2
make[1]: *** Waiting for unfinished jobs…
HOSTCC scripts/kallsyms
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/genksyms/genksyms.o
CC scripts/mod/empty.o
/bin/sh: 1: /home/nvidia/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc: Exec format error
…/scripts/Makefile.build:335: recipe for target ‘scripts/mod/empty.o’ failed
make[3]: *** [scripts/mod/empty.o] Error 2
…/scripts/Makefile.build:649: recipe for target ‘scripts/mod’ failed
make[2]: *** [scripts/mod] Error 2
make[2]: *** Waiting for unfinished jobs…
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
SHIPPED scripts/genksyms/parse.tab.c
SHIPPED scripts/genksyms/lex.lex.c
SHIPPED scripts/genksyms/keywords.hash.c
SHIPPED scripts/genksyms/parse.tab.h
HOSTCC scripts/genksyms/parse.tab.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/genksyms/lex.lex.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
SHIPPED scripts/dtc/dtc-lexer.lex.c
SHIPPED scripts/dtc/dtc-parser.tab.h
SHIPPED scripts/dtc/dtc-parser.tab.c
HOSTCC scripts/dtc/dtc-lexer.lex.o
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/genksyms/genksyms
HOSTLD scripts/dtc/dtc
/home/nvidia/public_sources/kernel/kernel-4.9/Makefile:579: recipe for target ‘scripts’ failed
make[1]: *** [scripts] Error 2
make[1]: Leaving directory ‘/home/nvidia/public_sources/kernel/kernel-4.9/kernelOut’
Makefile:171: recipe for target ‘sub-make’ failed
make: *** [sub-make] Error 2

Have a check the toolchain.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fxavier_toolchain.html%23

I still have the same problem.
I using the toolchain from you link above

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fxavier_toolchain.html%23

Is it possible that the standart compiler is used by jetpack?

This version runs on my system by typing gcc -v in the Terminal

gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)

Should not be there gcc version 7.3.1 ?

Thanks in advance!

Did you compile it on Tegra? You need compile it on x86 system.

What do you mean exactly?

I installed Jetpack 4.2 on my Nvidia Xavier AGX.

Afterwards I followed the steps at the beginning of the post.

Just want to confirm you didn’t compile the kernel on Xavier AGX.

Is threr anything else im doing wrong?

Hi, i tryed to follow the manual and got an error after executing line 17.

This is the console output:

make[1]: Entering directory ‘/home/nvidia/public_sources/kernel/kernel-4.9/home/nvidia/public_sources/kernel/kernel-4.9/kernel_output’
GEN ./Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
arch/arm64/Makefile:49: LSE atomics not supported by binutils
CHK include/config/kernel.release
UPD include/config/kernel.release
GEN ./Makefile
WRAP arch/arm64/include/generated/asm/cputime.h
WRAP arch/arm64/include/generated/asm/clkdev.h
WRAP arch/arm64/include/generated/asm/bugs.h
WRAP arch/arm64/include/generated/asm/div64.h
WRAP arch/arm64/include/generated/asm/dma.h
WRAP arch/arm64/include/generated/asm/delay.h
WRAP arch/arm64/include/generated/asm/early_ioremap.h
WRAP arch/arm64/include/generated/asm/dma-contiguous.h
WRAP arch/arm64/include/generated/asm/emergency-restart.h
WRAP arch/arm64/include/generated/asm/errno.h
WRAP arch/arm64/include/generated/asm/hw_irq.h
WRAP arch/arm64/include/generated/asm/ioctl.h
WRAP arch/arm64/include/generated/asm/ipcbuf.h
WRAP arch/arm64/include/generated/asm/ioctls.h
WRAP arch/arm64/include/generated/asm/irq_regs.h
WRAP arch/arm64/include/generated/asm/kdebug.h
WRAP arch/arm64/include/generated/asm/kmap_types.h
WRAP arch/arm64/include/generated/asm/kvm_para.h
CHK include/generated/uapi/linux/version.h
WRAP arch/arm64/include/generated/asm/local.h
WRAP arch/arm64/include/generated/asm/local64.h
WRAP arch/arm64/include/generated/asm/mcs_spinlock.h
WRAP arch/arm64/include/generated/asm/mm-arch-hooks.h
UPD include/generated/uapi/linux/version.h
WRAP arch/arm64/include/generated/asm/mman.h
WRAP arch/arm64/include/generated/asm/msgbuf.h
WRAP arch/arm64/include/generated/asm/mutex.h
WRAP arch/arm64/include/generated/asm/msi.h
WRAP arch/arm64/include/generated/asm/poll.h
WRAP arch/arm64/include/generated/asm/preempt.h
WRAP arch/arm64/include/generated/asm/rwsem.h
WRAP arch/arm64/include/generated/asm/resource.h
WRAP arch/arm64/include/generated/asm/segment.h
WRAP arch/arm64/include/generated/asm/sembuf.h
WRAP arch/arm64/include/generated/asm/serial.h
WRAP arch/arm64/include/generated/asm/simd.h
WRAP arch/arm64/include/generated/asm/shmbuf.h
WRAP arch/arm64/include/generated/asm/sizes.h
WRAP arch/arm64/include/generated/asm/sockios.h
WRAP arch/arm64/include/generated/asm/swab.h
WRAP arch/arm64/include/generated/asm/socket.h
WRAP arch/arm64/include/generated/asm/termbits.h
WRAP arch/arm64/include/generated/asm/switch_to.h
WRAP arch/arm64/include/generated/asm/termios.h
WRAP arch/arm64/include/generated/asm/trace_clock.h
WRAP arch/arm64/include/generated/asm/types.h
WRAP arch/arm64/include/generated/asm/unaligned.h
WRAP arch/arm64/include/generated/asm/user.h
WRAP arch/arm64/include/generated/asm/vga.h
WRAP arch/arm64/include/generated/asm/xor.h
CHK include/generated/utsrelease.h
WRAP arch/arm64/include/generated/uapi/asm/kvm_para.h
UPD include/generated/utsrelease.h
HOSTCC scripts/basic/bin2c
Using /home/nvidia/public_sources/kernel/kernel-4.9 as source for kernel
HOSTCC scripts/kallsyms
CC scripts/mod/empty.o
HOSTCC scripts/dtc/dtc.o
HOSTCC scripts/genksyms/genksyms.o
gcc: error: unrecognized command line option ‘-mlittle-endian’; did you mean ‘-fconvert=little-endian’?
/home/nvidia/public_sources/kernel/kernel-4.9/scripts/Makefile.build:335: recipe for target ‘scripts/mod/empty.o’ failed
make[3]: *** [scripts/mod/empty.o] Error 1
/home/nvidia/public_sources/kernel/kernel-4.9/scripts/Makefile.build:649: recipe for target ‘scripts/mod’ failed
make[2]: *** [scripts/mod] Error 2
make[2]: *** Waiting for unfinished jobs…
SHIPPED scripts/genksyms/parse.tab.c
SHIPPED scripts/genksyms/lex.lex.c
SHIPPED scripts/genksyms/keywords.hash.c
SHIPPED scripts/genksyms/parse.tab.h
HOSTCC scripts/genksyms/parse.tab.o
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/genksyms/lex.lex.o
HOSTCC scripts/dtc/fstree.o
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
SHIPPED scripts/dtc/dtc-lexer.lex.c
HOSTLD scripts/genksyms/genksyms
SHIPPED scripts/dtc/dtc-parser.tab.h
SHIPPED scripts/dtc/dtc-parser.tab.c
HOSTCC scripts/dtc/dtc-lexer.lex.o
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/dtc/dtc
/home/nvidia/public_sources/kernel/kernel-4.9/Makefile:579: recipe for target ‘scripts’ failed
make[1]: *** [scripts] Error 2
make[1]: Leaving directory ‘/home/nvidia/public_sources/kernel/kernel-4.9/home/nvidia/public_sources/kernel/kernel-4.9/kernel_output’
Makefile:171: recipe for target ‘sub-make’ failed
make: *** [sub-make] Error 2

Do you have any idea what could be wrong ?

Greets Teo

What’s your compile machine environment?

I sucess patching the PREEMPT patch on my xavier. I had some issues setting my Invoirement varibles from my toolchain.
This is the actuell Kernel version now by typing uname -a in the console

Linux jetson-0423618000999 4.9.108+ #1 SMP PREEMPT Fri Nov 8 21:13:28 CET 2019 aarch64 aarch64 aarch64 GNU/Linux

I tryed now testing my Kernel by using cyclic-tests.
I followed the indructions on this page:

https://wiki.linuxfoundation.org/realtime/documentation/howto/tools/cyclictest/start

But i got the fowlloing error message.
Unable to change scheduling policy! either run as root or join realtime group
Creating a group named realtime its not working.

Is it possible that the cyclic-tests not running on the Xavier AGX
Or is thre any other way testing the PREEMPT patch?

Thnak´s for your help!

Hello,

Do you mean PREEMPT_RT patch or just the PREEMPT config option turned on? Looking at ‘uname -a’ it doesn’t look like you are running a PREEMPT_RT enabled kernel. And that is why the cyclictest is not running on it.

Hallo,

Thanks for your fast answer.
Do I have to turn on the rt kernel or did i build the wrong kernel?

Hello,

If you wish to run PREEMPT_RT kernel then turn it on. Hope you followed steps from comment #2.

Thanks. I was now able to enable the RT-Kernel