Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
L4T 28.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jetsonhacks committed Aug 5, 2017
1 parent 0dab28c commit 1f7478d
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 86 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016 Jetsonhacks
Copyright (c) 2017 Jetsonhacks

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
# buildJetsonTX1Kernel
Scripts to help build the kernel and modules onboard the Jetson TX1
# buildJetsonTX2Kernel
Scripts to help build the 4.4.38 kernel and modules onboard the Jetson TX1 (L4T 28.1, JetPack 3.1). For previous versions, visit the 'tags' section.

These scripts are for building 64-bit L4T 24.2.1 (Ubuntu 16.04 based) operating system on the NVIDIA Jetson TX1. The scripts should be run directly after flashing the Jetson with L4T 24.2.1 from a host PC. See JetsonHacks.com for article:
As of this writing, the "official" way to build the Jetson TX1 kernel is to use a cross compiler on a Linux PC. These scripts are an alternative which builds the kernel onboard the Jetson itself. These scripts will download the kernel source to the Jetson TX1, wrangle some of the Makefiles to make them work on the Jetson, and then compile the kernel and selected modules. The newly compiled kernel can then be installed.

http://jetsonhacks.com/2016/09/28/build-tx1-kernel-and-modules-nvidia-jetson-tx1/
WARNING: After flashing the Jetson TX1, there is a limited amount of room on the device. After completing these scripts there will be NO space on the device. You MUST remove some of the files that were added in the /usr/src directory. You should store the /usr/src/kernel directory offboard (like on a SATA drive or USB stick) along with the compressed sources before deleting them. You may want to use them again later.

These scripts are for building the kernel for the 64-bit L4T 28.1 (Ubuntu 16.04 based) operating system on the NVIDIA Jetson TX1. The scripts should be run directly after flashing the Jetson with L4T 28.1 from a host PC. There are three scripts:

<strong>getKernelSources.sh</strong>

Downloads the kernel sources for L4T 24.2.1 from the NVIDIA website, decompresses them and opens a graphical editor on the .config file.
Downloads the kernel sources for L4T 28.1 from the NVIDIA website, decompresses them and opens a graphical editor on the .config file.

<strong>patchAndBuildKernel.sh</strong>
<strong>makeKernel.sh</strong>

Applies patches to the kernel, adds 32-bit precompiled compoents, and then compiles the kernel and modules using make.
This script applies a few patches to makefiles in the kernel source, and then compiles the kernel and modules using make.

<strong>copyImage.sh</strong>

Copies the Image and zImage files created by compiling the kernel to the /boot directory
Copies the Image file created by compiling the kernel to the /boot directory

<strong>Notes:</strong>

The kernel source files are downloaded in a .tgz2 format. After compilation you may want to remove those files. The files are located in /usr/src You will need to use sudo to remove the files, as they are in a system area. The work directory 'sources' contains kernel_src-txt1.tbz2, you can remove that directory. The file 'source_release.tbz2' is a much larger file that holds the kernel sources as well as many other TX1 specific source packages. You can make a backup of source_release.tbz2 before deleting it.

You may want to save the newly built Image and modules to external media so that can be used to flash a Jetson image, or clone the disk image.

These scripts make only the kernel Image and Modules. You will need to modify the scripts if more are needed.

The copyImage.sh script copies the Image to the current device. If you are building the kernel on an external device, for example a SSD, you will want to copy the Image file over to the eMMC in the eMMC /boot directory if you are booting from the eMMC and using external storage as your root directory.


<strong>Note:</strong> that you may want to save the newly built Image, zImage and modules to external media so that can be used to flash a Jetson image, or clone the disk image.


2 changes: 1 addition & 1 deletion copyImage.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
sudo ./scripts/copyzImage.sh
sudo ./scripts/copyImage.sh
3 changes: 3 additions & 0 deletions diffs/devfreq/devfreq.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
17a18,19
>
> ccflags-y += -I$(src)
6 changes: 6 additions & 0 deletions diffs/nvgpu/nvgpu.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
8a9
> ccflags-y += -I./$(src)/
14a16,18
>
> ccflags-y += -I$(src)
>
3 changes: 3 additions & 0 deletions diffs/tegra-alt/tegra-alt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2a3,4
> ccflags-y += -I$(src)
>
4 changes: 2 additions & 2 deletions getKernelSources.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
# Install the kernel source for L4T 24.2.1
sudo ./scripts/installKernelSources.sh
# Install the kernel source for L4T
sudo ./scripts/getKernelSources.sh
4 changes: 4 additions & 0 deletions makeKernel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
sudo ./scripts/fixMakeFiles.sh
sudo ./scripts/makeKernel.sh

30 changes: 0 additions & 30 deletions patchAndBuildKernel.sh

This file was deleted.

15 changes: 15 additions & 0 deletions scripts/copyImage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
cd /usr/src/kernel/kernel-4.4
# On the stock Jetson TX2 install, there is no zImage in the boot directory
# So we just copy the Image file over
# If the zImage is needed, you must either
# $ make zImage
# or
# $ make
# Both of these commands must be executed in /usr/src/kernel/kernel-4.4
# sudo cp arch/arm64/boot/zImage /boot/zImage
# Note that if you are compiling on an external device, like a SSD, you should probably
# copy this over to the internal eMMC if that is where the Jetson boots
sudo cp arch/arm64/boot/Image /boot/Image


6 changes: 0 additions & 6 deletions scripts/copyzImage.sh

This file was deleted.

10 changes: 10 additions & 0 deletions scripts/fixMakeFiles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# Fix the Makefiles so that they compile on the device
patch /usr/src/kernel/kernel-4.4/drivers/devfreq/Makefile ./diffs/devfreq/devfreq.patch
patch /usr/src/kernel/nvgpu/drivers/gpu/nvgpu/Makefile ./diffs/nvgpu/nvgpu.patch
# The Jetson TX2 requires the following; Not needed for the Jetson TX1
# patch /usr/src/kernel/kernel-4.4/sound/soc/tegra-alt/Makefile ./diffs/tegra-alt/tegra-alt.patch
# vmipi is in a sub directory without a Makefile, there was an include problem
cp /usr/src/kernel/kernel-4.4/drivers/media/platform/tegra/mipical/mipi_cal.h /usr/src/kernel/kernel-4.4/drivers/media/platform/tegra/mipical/vmipi/mipi_cal.h


14 changes: 14 additions & 0 deletions scripts/getKernelSources.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
apt-add-repository universe
apt-get update
apt-get install qt5-default pkg-config -y
cd /usr/src
wget http://developer.download.nvidia.com/embedded/L4T/r28_Release_v1.0/BSP/source_release.tbz2
tar -xvf source_release.tbz2 sources/kernel_src-tx1.tbz2
tar -xvf sources/kernel_src-tx1.tbz2
# Space is tight get rid of the compressed kernel source
rm sources/kernel_src-tx1.tbz2
cd kernel/kernel-4.4
zcat /proc/config.gz > .config
make xconfig

13 changes: 0 additions & 13 deletions scripts/installKernelSources.sh

This file was deleted.

8 changes: 6 additions & 2 deletions scripts/makeKernel.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/bin/bash
# Builds the kernel and modules
# Assumes that the .config file is available
cd /usr/src/kernel
cd /usr/src/kernel/kernel-4.4
make prepare
make modules_prepare
make -j4
# Make alone will build the dts files too
# make -j6
make -j6 Image
make modules
make modules_install

8 changes: 0 additions & 8 deletions scripts/makeKernel1.sh

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/patchKernel.sh

This file was deleted.

11 changes: 0 additions & 11 deletions tegraClocks.patch

This file was deleted.

Binary file removed vdso32Files.tbz2
Binary file not shown.

0 comments on commit 1f7478d

Please sign in to comment.