This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0dab28c
commit 1f7478d
Showing
19 changed files
with
85 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
sudo ./scripts/copyzImage.sh | ||
sudo ./scripts/copyImage.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
17a18,19 | ||
> | ||
> ccflags-y += -I$(src) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
2a3,4 | ||
> ccflags-y += -I$(src) | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
sudo ./scripts/fixMakeFiles.sh | ||
sudo ./scripts/makeKernel.sh | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.