So currently i have the latest r28.2 on my TX2 running.
uname -r → 4.4.38-tegra
First i want to recompile the kernel and only to change the name so that uname -r says-> 4.4.38-myname
what i have done
created a directory named nvidia. Downloaded from nvida site:
gcc-4.8.5-aarch64.tgz
tx2_sources.tbz2
mkdir nvidia
cd nvidia
mkdir tx2
cd tx2
mkdir kernel
mkdir modules
cd ..
tar -xvf gcc-4.8.5-aarch64.tgz
mkdir source
cd source
tar -xvjf tx2_sources.tbz2
cd public_release
tar -xvjf kernel_src.tbz2
cd kernel/kernel-4.4/
export TEGRA_KERNEL_OUT=~/nvidia/tx2/kernel
export TEGRA_MODULES_OUT=~/nvidia/tx2/modules
export ARCH=arm64
export CROSS_COMPILE=~/nvidia/install/bin/aarch64-unknown-linux-gnu-
make mrproper
make O=$TEGRA_KERNEL_OUT tegra18_defconfig
make O=$TEGRA_KERNEL_OUT menuconfig
set the local version under general setup to -myname
make O=$TEGRA_KERNEL_OUT modules -j4
make O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=$TEGRA_MODULES_OUT -j4
make O=$TEGRA_KERNEL_OUT zImage -j4
make O=$TEGRA_KERNEL_OUT dtbs -j4
i didn’t get any error.
Now i have under
~/nvidia/tx2/kernel/arch/arm64/boot/
the Image file
What is the proper way to flash this kernel image on to my TX2?
Hi Joko, after attaching your devkit to the host PC via micro-USB cable and entering the Jetson into Recovery mode, you can run this command to flash the kernel:
When i flash my image with the flash.sh, what should i do with the modules that i compiled ? Because i have files that are in folder lib/modules/4.4.38-myname.
2.1) there are also some other files do i need to copy them somewhere in order to boot correctly with my custom kernel image 4.4.38-myname
I would like to know if i can have two kernel images on system and to choose between them?
3.1) can i rename the current image to eg. image_gold and add the image that i compiled and then add a second entry into /boot/extlinux/extlinux.conf ??
You probably have to copy these over to your Jetson manually after flashing the kernel, or you could mount the root filesystem image on the host via loopback, add to the image and slipstream them there, then reflash the entire image.
Using extlinux.conf, I believe you may be able to do this, but I’m not sure myself as I haven’t done this part before.
It is possible to specify an kernel image and a rootfs from extlinux.conf.
You would have to copy your alternate kernel image into boot directory of filesystem of partition /dev/mmcblk0p1 (/boot/Image-test), and edit there the /boot/extlinux/extlinux.conf.
For example, you may have ‘test’ version of your kernel on MMC0:/boot and according rootfs having modules on /dev/sda1 with such extlinux.conf:
TIMEOUT 30
DEFAULT primary
MENU TITLE p2771-0000 eMMC boot options
LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
APPEND ${cbootargs} root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4
LABEL test
MENU LABEL primary test
LINUX /boot/Image-test
APPEND ${cbootargs} root=/dev/sda1 rw rootwait rootfstype=ext4
By default, this would start the standard image and rootfs on MMC0p1.
If you use a serial console, you would be able to choose the second entry, booting Image-test kernel and then mounting /dev/sda1 as rootfs (assuming your kernel has builtin drivers for your drive and ext4 filesystem support).
When you are sure it works, you can set this as default by editing the second line of MMC0p1:/boot/extlinux/extlinux.conf into DEFAULT test.
make O=$TEGRA_KERNEL_OUT zImage -j4
make O=$TEGRA_KERNEL_OUT dtbs -j4
make O=$TEGRA_KERNEL_OUT modules -j4
make O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=$TEGRA_MODULES_OUT -j4
and then apply binearies
sudo ./apply_binaries.sh
and flash to TX2
sudo ./flash.sh jetson-tx2 mmcblk0p1
The TX2 is starting ok.
but one thing i don’t understand, when doing the:
make O=$TEGRA_KERNEL_OUT dtbs -j4
in the output folder $TEGRA_KERNEL_OUT/arch/arm64/boot/dts i get 22 different .dts files.
Just the one file. There are many TX2 platforms, some with different carrier boards, some with different variations on the actual SoC (e.g., we now have the TX2i), and so there are multiple trees. You use one tree, but have a choice among them for your situation.
Watch the flash operation and verify logs or output from the flash that the correct file was used.