Kernel Rebuilding?

Probably some folks out there are trying to build variant kernels from source. I have a few questions.

  1. Any success? Any particular places that seem to always fail in the compile?

  2. Has anyone noticed if XATTR is set in the stock kernel, and if it’s not, are you recompiling to include it? If you’re compiling to add that, is it going well? That seems to be an essential if you’re building apps that handle Digital Rights Management (“DRM”), for example in “wine” and plugins that depend on Wine.

  3. Any clues you’d like to pass on regarding whether or not to prefer more modular style compiles or do you think it’s better to just compile in a lot of things that usually are left as modules? Additionally, how do you rate the initram tools?

When I get my board I’m surely going to build my own kernel. If people want, I can try to provide a ready built kernel + modules with a lot of “typical” features enabled.

Somebody commented in another thread that the kernel version is 3.10.24-g6eb5d7e. That would mean git commit 6eb5d7e but I didn’t find that commit from anywhere.

It seems that the kernel source package provided in the release page matches the branch l4t/l4t-r19.2 in nv-tegra.nvidia Code Review - linux-3.10.git/summary

Could somebody with a board check if /proc/config.gz matches the config in nv-tegra.nvidia Code Review - linux-3.10.git/blob - arch/arm/configs/tegra12_defconfig ?

Nevertheless I assume that kernel matches the one in the board and the config can be taken from /proc/config.gz so it should be trivial to rebuild it.

I’ve built quite a lot of kernels (mostly x86, OMAP and Tegra3) in the past and I would guess that enabling drivers should work without problems. Changing power management etc. options can lead to issues as they tend to be quite tuned for the particular hardware.

It’s often easy to compile features as built-in to the kernel if you know you’ll be using them always anyway. But e.g. wifi drivers often need a firmware so it might be easier to build them as modules so that the driver can load the firmware from the already mounted rootfs.

Usually I don’t use initrd images as they could be tricky to create and since I’m building the kernel for some particular device, I can build in the features I know will be needed for booting and mounting the rootfs (e.g. EXT4 and crypto drivers in case of crypted rootfs).

Compiling the kernel

NOTE: I haven’t tested these instructions, so they may contain typos or errors.

Download the sources to the device. Using git is always a good way to track your changes but it takes a lot of extra space. Alternative is to download the source from the release page.

Extract the sources, if needed, and change to the top directory of the kernel source tree.

# Copy the current config
zcat /proc/config.gz > .config

# Make sure the config is ok (this shouldn't ask questions, if the kernel versions match)
make oldconfig

# Optionally modify the options.
# I recommend changing the kernel version so that you can easily jump between the versions. Add e.g. "-mykernel1"  to General Setup -> Local version.
make menuconfig

# Compile the kernel and the kernel modules
make zImage modules -j4

# Install the modules
sudo make modules_install

Use the flash.sh script to flash the new kernel. I don’t know the exact command though, I’ll update the post when I do. I also wonder if the kernel could be flashed directly from the Linux…

Thank you looking forward to your update! I just created a zImage with support for my WiFi but can’t get it to flash.

I think flashing just the kernel goes like this:

mv <my kernel> <BSP>/kernel/zImage
./flash.sh -k 6 jetson-tk1 mmcblk0p1

I don’t have a board yet so I can’t test that. Let me know if it works and I’ll update my post above :)

Lots of diffs. Here’s the original config from my board

I see arch/arm/boot/install.sh next to my zImage. Is it just a matter of doing ‘sudo make install’ once I compiled the kernel and reboot?

I’m still unsure where to find flash.sh.

It’s included in the driver package downloads:
https://developer.nvidia.com/sites/default/files/akamai/mobile/files/L4T/Tegra124_Linux_R19.2.0_armhf.tbz2

Maybe flash.sh is the only way to do it…

I used sudo make install and it appears to have installed the kernel in /boot/vmlinuz-3.10.24-my1, but when I reboot and uname -r I still get 3.10.24-g6a2d13a. I checked dmesg, and it doesn’t have errors, it just boots straight into the original kernel. I’ve searched google about setting it to boot using my1 kernel, but all I find refers to /boot/default/grub which doesn’t exist on this system. apropos grub gives me nothing. Booting up and holding down shift is equally unsuccessful.

Well, the flash.sh does write the kernel at 0x81008000 and calls set the load address there.

In a way, yes you have to write via flash.

Curiously, I wonder if recompiling the u-boot would help.
But I’m missing a few items if it like how FPGA /w ARM SoC setup ie fastboot.bin contains the fsbl, bitstream, ssbl (u-boot?)

I wanted to change the bootdevice to e.g. /dev/sda1 without destroying /dev/mmcblk0p1 (see another thread) :

If I understand it well my problem could be solved by using :

./flash.sh -k 6 jetson-tk1 mmcblk0p1

This will only replace the kernel in partition 6 and leave the rest untouched. I’ll try and let you know the result …

Kees

Are there any instructions for the flash.sh beyond what is in the download? Do I need to copy my compiled zImage to ./kernel/zImage? Or maybe I need to make install into the l4t directory? I see rootfs directory is empty with instruction to download that from somewhere not mentioned.

I just found this

https://developer.nvidia.com/sites/default/files/akamai/mobile/files/L4T/l4t_quick_start_guide.txt

which looks helpful, but it doesn’t mention anything about having compiled your own kernel/drivers.

I was able to get a custom zImage built (using the latest source from the daily-2014.06.03.0_l4t/l4t-r19.3 tag on the git).

I cross compiled it and flashed both the zImage and the separate iwlwifi drivers for my 6300 series card but would get kernel panics every time I booted with it inserted. It’s funny, if the wifi card isn’t present it boots into Ubuntu without incident.

I am going to try building the modules from source on the board itself and install straight from it. Has anyone had luck with the iwlwifi module? Particularly with the 6300 series cards?

@jarocks

That’s the reason I’m trying to compile drivers too. I have a HMW 7260 I bought for this board. It’s been over a month since I got this board. All I’ve been able to do with it is futz around with the non functional wifi/bluetooth. I’m frustrated with it. I’m going to the electronics store today to get additional cabling I need to flash the board. I compiled everything on the board, so maybe I’ll have better luck once I figure out the flash.sh, but I’m not counting on it :/

…Maybe I’ll just pick up a wireless bridge and usb bluetooth adapter and cut my losses. The wireless card really isn’t worth the effort to me at this point. It has become a blackhole for my time and things aren’t improving. Thanks for letting me know about the kernel panics.

Recompiled the modules on board without any luck.

I saw some folks at Codethink toting around the 3.15 kernel on the TK1. Just without any guides, source or anything that could be useful for reproducing it.

I don’t suppose someone could host some of their said builds? I am also attempting to use a Intel 7260HMW for this board, but I followed these instructions in order to add the drivers as modules. I am very fed up with my kernel and would like to use ANYONE else’s build.

I’m beginning to think it doesn’t work and NVidia shipped hoping one of us would fix it for them :-| Why else would they fail to include a 9.2Mb driver that lots of people are sure to need?

CodeThink posted some early instructions on how to install the upstream Linux 3.15 kernel on Jetson TK1 [url]http://www.phoronix.com/scan.php?page=news_item&px=MTcxODc[/url]. But you shouldn’t need to use the upstream kernel just to get Wifi working, it will be easier to update your L4T kernel. Unfortunately it looks like no-one at NVIDIA seems to have tested Wifi on Jetson TK1 yet so I guess it has no support right as of yet, sorry! I’ll ask someone to get Wifi working then post it on the Wiki ([url]http://elinux.org/Jetson_TK1[/url]).

Just a side note about the upstream kernel. It can be considered quite experimental still and it’s missing e.g. a lot of power management features. Also the there’s no hardware accelerated video decoding/encoding and for OpenGL you need to use the open source Nouveau driver and Mesa, the proprietary OpenGL stack doesn’t work with the upstream kernel, nor does CUDA.

Have you installed the firmware for your card?
Look at this page for Intel WiFi firmware:
http://wireless.kernel.org/en/users/Drivers/iwlwifi

I’m under Debian but i may remember that under L4T, linux-firmware are not installed by default.

Can you post your dmesg (or only the part where the iwlwifi driver is loaded)?

We (NVIDIA) are aware that many devices currently need firmware drivers installed to “/lib/firmware” or building & flashing a custom L4T kernel. We will provide some instructions soon on how to build & flash a custom L4T kernel and will provide many common Wifi & webcam drivers on our Support page soon. But we want to know which drivers are the most desired.

I created a list of drivers at [url]Jetson/Network Adapters - eLinux.org, if you don’t see your driver mentioned then add it to the list or email me (semami@nvidia.com).

Thanks for your patience!