Save a copy of your current Jetson’s “/proc/config.gz”. Start with that. You do need to learn to cross compile to build a kernel for the TX1, but you can just get the kernel source here (you don’t need to use git)…be sure your current release matches the kernel source:
If you are using the current release it will be R24.2.1 from here (look for kernel source):
Note that this same page has a “Documentation” download which includes compile instructions:
The URL you gave seems to concentrate on using the most recent sources via git, but also mentions the documentation download I just gave. You might want to skim that documentation first (for kernel build), then look at the article you mentioned for other details.
I already have tools installed, and those tools are different than what an Ubuntu user would use (I’m using Fedora, I manually installed a lot of different compilers…it’s easier to just use the ones available as standard packages on Ubuntu if you have that).
Some environment variables important to set (my specific case is just an example, yours will not match exactly):
You probably also want to pre-create an output location, e.g.:
(you won’t actually build firmware, but it is in my notes)
Place your .config at “~/build/kernel”. Make sure the CONFIG_LOCALVERSION matches…either edit the file or use something like the “make O=$TEGRA_KERNEL_OUT nconfig” and search for CONFIG_LOCALVERSION (this was the suffix from the running Jetson’s “uname -r”).
Note that there are edits needed for this kernel to build. The edits may already exist in some versions, I’ll mention below more about that.
Technically you don’t need to build the whole kernel, but it does some configuration and is preferable as an error check. Actual build (after some edits…the nconfig stage is where you look for your driver…commands are from the kernel source tree):
make O=$TEGRA_KERNEL_OUT mrproper
make O=$TEGRA_KERNEL_OUT nconfig
make O=$TEGRA_KERNEL_OUT Image
make O=$TEGRA_KERNEL_OUT modules
make O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=$TEGRA_MODULES_OUT
…take a look in $TEGRA_MODULES_OUT…you’ll get to a subdirectory with the actual modules and within that somewhere will be the module of interest…this will get manually copied to the analogous location on the Jetson and it’ll be done (you’ll probably reboot the Jetson even though you could just manually run commands to insert the module).
Remember, I gave the path to some tools that are my version on Fedora, adjust paths to your tools.
About fixes needed for the source to compile…check the following within your kernel source…some may already be fixed:
# R24.1, NOTE: drivers/base/Kconfig, line 234, missing double quote to close string.
# NOTE: May need to edit "drivers/platform/tegra/tegra21_clocks.c:1065"
# c->state = ((!is_lp_cluster()) == (c->u.cpu.mode == MODE_G)) ? ON : OFF;
# NOTE: toplevel Makefile, KBUILD_CFLAGS_KERNEL := -fomit-frame-pointer