Coder Social home page Coder Social logo

mdippold / buildkernelandmodules Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jetsonhacksnano/buildkernelandmodules

0.0 0.0 0.0 34 KB

Build the Linux Kernel and Modules on board the NVIDIA Jetson Nano Developer Kit

License: MIT License

Shell 100.00%

buildkernelandmodules's Introduction

buildKernelAndModules

Build the Linux Kernel and Modules on board the NVIDIA Jetson Nano Developer Kit

These scripts are for JetPack 4.3, L4T 32.3.1

Scripts to help build the 4.9.140 kernel and modules onboard the Jetson Nano Developer Kit Previous versions may be available in releases.

Note: The kernel source version must match the version of firmware flashed on the Jetson. For example, the source for the 4.9.140 kernel here is matched with L4T 32.3.1. This kernel compiled using this source tree may not work with newer versions or older versions of L4T

As of this writing, the "official" way to build the Jetson Nano kernel is to use a cross compiler on a Linux PC. This is an alternative which builds the kernel onboard the Jetson itself. These scripts will download the kernel source to the Jetson Nano, and then compile the kernel and selected modules. The newly compiled kernel can then be installed. We recommend a SD card size of 32GB, 64GB preferred.

The scripts should be run directly after flashing the Jetson, or copying the SD card image from a host PC. There are several scripts:

getKernelSources.sh

Downloads the kernel sources for L4T from the NVIDIA website, decompresses them and opens a graphical editor on the .config file. Note that this also sets the .config file to the current system, and also sets the local version to the current local version, i.e., -tegra

makeKernel.sh

Compiles the kernel using make. The script commands make the kernel Image file. Installing the Image file on to the system is a separate step. Note that the make is limited to the Image and modules.

The other parts of the kernel build, such as building the device tree, require that the result be 'signed' and flashed from the the NVIDIA tools on a host PC.

makeModules.sh

Compiles the modules using make and then installs them.

copyImage.sh

Copies the Image file created by compiling the kernel to the /boot directory. Note that while developing you will want to be more conservative than this: You will probably want to copy the new kernel Image to a different name in the boot directory, and modify /boot/extlinux/extlinux.conf to have entry points at the old image, or the new image. This way, if things go sideways you can still boot the machine using the serial console.

You will want to make a copy of the original Image before the copy, something like:

$ cp /boot/Image $INSTALL_DIR/Image.orig
$ ./copyImage.sh
$ echo "New Image created and placed in /boot"

editConfig.sh Edit the .config file located in /usr/src/kernel/kernel-4.9 This file must be present (from the getKernelSources.sh script) before launching the file. Note that if you change the local version, you will need to make both the kernel and modules and install them.

removeAllKernelSources.sh Removes all of the kernel sources and compressed source files. You may want to make a backup of the files before deletion.

Notes:

Make sure to update the micro SD card

The copyImage.sh script copies the Image to the current device. If you are building the kernel on an external device, for example a USB drive, you will probably want to copy the Image file over to the micro SD card in the micro SD's /boot directory. Special thanks to Raffaello Bonghi (https://github.com/rbonghi) for jetson_easy scripts. Special thanks to Shreeyak (https://github.com/Shreeyak) for discussing alternatives to get source directly from NVIDIA git repositories. Special thanks to Dustin Franklin (https://github.com/dusty-nv/) for how to correctly determine the correct L4T version. (https://github.com/dusty-nv/jetson-inference/blob/7e81381a96c1ac5f57f1728afbfdec7f1bfeffc2/tools/install-pytorch.sh#L296)

Sometimes it is useful to log the builds:

$ command 2>&1 | tee log.txt

so you can go back and catch errors.

Intended Use

The intended use of this repository is to help automate building known configurations of the kernel and build modules. You should use the kernel-4.9/scripts/config script to set the kernel configuration that you desire. See the 'rootOnUSB' repository on the JetsonHacksNano Github account for an example.

Release Notes

December, 2019

  • vL4T32.3.1
  • L4T 32.3.1 (JetPack 4.3)
  • Minor version update

November, 2019

  • vL4T32.2.3
  • L4T 32.2.3 (JetPack 4.2.2)
  • Minor version update

October, 2019

  • vL4T32.2.1
  • L4T 32.2.1 (JetPack 4.2.1)
  • Better release version parsing

July, 2019

  • vL4T32.2
  • L4T 32.2 (JetPack 4.2.1)

June, 2019

  • vL4T32.1
  • L4T 32.1 (JetPack 4.2)
  • Initial Release

buildkernelandmodules's People

Contributors

jetsonhacks avatar jetsonhacksnano avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.