The gist is this…you need kernel source matching the existing kernel. Try:
From there download kernel source:
Unpack it on your Jetson. Parts of this need to be done with “admin”/root authority, and since it is Ubuntu, from your login just run “sudo -s”. You could type “sudo” before every command requiring root, but it will simplify it if you just sudo -s prior to doing this.
Because the kernel is version 3.10.24, I suggest you unpack it in /usr/src/kernels/3.10.24/.
I’m guessing you are using L4T R19.2, which they ship with, so yours will differ from what I’m giving (default for R19.3). The command
should read something like this:
So…to make life simple and not copy source all over, cd to /usr/src/kernels/, and make a symbolic link via this versioned name to the generic 3.10.24 (remember, uname -r is likely different for you and use what your uname -r says):
ln -s 3.10.24 3.10.24-gf455cd4
Now you can
cd /usr/src/kernels/`uname -r`
From there copy your running configuration:
gunzip < /proc/config.gz > .config
(this decompresses and redirects to the .config file)
You may have to install something like libncurses5 and/or libncurses5-dev for menuconfig to work (it’ll tell you if this is the case), but once you have it, from the directory you just added .config to, you can do this:
From inside menuconfig, at the bottom, see the “Load” option (right arrow to reach it). Load the .config file which should match your system since you just put the file there. Go down to “General setup”, make sure that within this “Local version” is also set to uname -r. At this point the menuconfig should contain updatable setup which starts exactly as your current system runs. You’ll always start here, and if in doubt, “make mrproper”, and copy .config again from /proc/config.gz, and load menuconfig from this…you’ll always start out matching this way.
If you are satisfied your menuconfig is a copy of current system, you can add NFS server features. For NFSD (server, not client), scroll down to “File systems”, and from in that again go down to “Network File Systems”. Things needed for a client will already be set up there, what you want is to be an NFS server (NFS daemon). Scroll down to “NFS server support”, and hit the “m” key to enable it as a module (you could just check it on and not as a module, but you don’t need to be a server to boot the system). This will cause server support items for version 3 and 4 to appear, you will have whichever version you use. Probably version 4, but it wouldn’t hurt to make both available, both version 3 and 4…then you can use whichever works. Space bar enables, NFS server is already a module, this adds features within the module.
You’re set up now to scroll right to “Save” and save menuconfig to “.config”.
There are lots of options how to compile, but if you really want to keep it simple, just run
and it will go for quite awhile then finish. The -j4 makes it use all 4 cpu cores and run faster.
Subdirectory arch/arm/boot/ will contain zImage, used for kernel flashing. You will want to “make modules_install” before flashing though, this will add the new NFS server module to “/lib/modules/
uname -r”. Since you don’t need to install NFS daemon to boot, you could technically avoid this. I’m guessing the module will be in fs/nfsd/ with a name like “nfsd.ko”, and you could test first before flashing. You’d cd to fs/nfsd/, and run “insmod nfsd.ko” to see if it loads. If it does, the “make modules_install” will put this in the module directory. Follow the flashing instructions using the zImage.
Roughly, if you have not upgraded to R19.3 and still use R19.2 default, you’ll save the original L4T kernel directory’s zImage as backup (meaning you have the original kernel in the L4T download and you might want it back some day), and then replace the zImage there with the one you just created. Read about flashing in L4T docs for the rest. Just as a note, if you have upgraded to R19.3 and chose to use U-boot instead of fastboot (fastboot is the default), you’ll need put zImage in Jetson’s /boot directory (because U-boot looks here instead of the GPT partition where fastboot looks).
Flashing with “flash.sh -k 6 jetson-tk1 mmcblk0p1” puts the new kernel in. Just don’t do this until you’ve read the info on flashing.
FYI, kernel compile on Jetson is no different than any linux, and the Ubuntu distribution on Jetson is a full linux system. The difference is in installing the kernel since it is using fastboot or U-boot boot loader instead of grub. Module install is standard too, anything you read for Ubuntu is good for this.