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

Commit 7f51221

Browse files
authored
Merge pull request #12 from jetsonhacks/development
Development for L4T 28.2
2 parents 6273157 + 0fa70d7 commit 7f51221

17 files changed

+354
-45
lines changed

README.md

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,92 @@
11
# buildJetsonTX1Kernel
2-
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.
2+
Scripts to help build the 4.4.38 kernel and modules onboard the Jetson TX1 (L4T 28.2, JetPack 3.2). For previous versions, visit the 'tags' section.
33

4-
<em><strong>Note:</strong> The kernel source version must match the version of firmware flashed on the Jetson. For example, the source for the 4.4.38 kernel here is matched with L4T 28.1. This kernel compiled using this source tree will not work with newer versions or older versions of L4T, only 28.1.</em>
4+
<em><strong>Note:</strong> The kernel source version must match the version of firmware flashed on the Jetson. For example, the source for the 4.4.38 kernel here is matched with L4T 28.2. This kernel compiled using this source tree will not work with newer versions or older versions of L4T, only 28.2.</em>
55

66

7-
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.
7+
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 and then compile the kernel and selected modules. The newly compiled kernel can then be installed.
88

9-
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.
9+
<strong>WARNING:</strong> After flashing the Jetson TX1, there is a limited amount of room on the device. You should modify the kernel directly after flashing the device. After completing these scripts there will be little space left on the device. After building the kernel and modules, you should remove some of the files that were added in the /usr/src directory. You may want to store the /usr/src/kernel directory offboard (like on a SATA drive or USB stick) along with the compressed sources before deleting them as you may want to use them again later.
1010

11-
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:
11+
These scripts are for building the kernel for the 64-bit L4T 28.2 (Ubuntu 16.04 based) operating system on the NVIDIA Jetson TX1. The scripts should be run directly after flashing the Jetson with L4T 28.2 from a host PC. There are five scripts:
1212

1313
<strong>getKernelSources.sh</strong>
1414

15-
Downloads the kernel sources for L4T 28.1 from the NVIDIA website, decompresses them and opens a graphical editor on the .config file.
15+
Downloads the kernel sources for L4T 28.2 from the NVIDIA website, decompresses them and opens a graphical editor on the .config file.
16+
17+
<strong>getKernelSourcesNoGUI.sh</strong>
18+
19+
Downloads the kernel sources for L4T 28.2 from the NVIDIA website and decompresses them. This is useful when using SSH, or you prefer a different method of editing the .config file.
1620

1721
<strong>makeKernel.sh</strong>
1822

19-
This script applies a few patches to makefiles in the kernel source, and then compiles the kernel and modules using make.
23+
This script compiles the kernel and modules using make.
2024

2125
<strong>copyImage.sh</strong>
2226

23-
Copies the Image file created by compiling the kernel to the /boot directory
27+
Copies the Image file created by compiling the kernel to the /boot directory. If you modify the kernel, you will probably want to make a copy of the original kernel image (/boot/Image) before copying over the newly generated one. You will also want to modify /boot/extlinux/extlinux.conf so that you can boot from the new Image or the old Image in case something untowards happens. That way, you will be able to select the old Image through the serial console.
2428

25-
<strong>Notes:</strong>
29+
<strong>Note:</strong> The Image file is copied to the boot directory of the current root directory device. The Jetson generally boots from the internal eMMC. If you are developing on external media (such as a SSD or USB drive) you will probably need to manually copy the Image file to the /boot directory of the eMMC. Refer to the script for the location of the Image file in the source tree.
2630

27-
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.
31+
<strong>removeAllKernelSources.sh</strong>
32+
Removes all of the kernel sources and compressed source files. You may want to make a backup of the files before deletion.
2833

29-
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.
34+
35+
<strong>Notes:</strong>
3036

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

33-
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.
39+
<strong>IMPORTANT</strong> 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.
40+
41+
Special thanks to Raffaello Bonghi (https://github.com/rbonghi) for jeston_easy scripts.
42+
43+
44+
### Release Notes
45+
April, 2018
46+
* v1.0-L4T28.2
47+
* L4T 28.2 (JetPack 3.2)
48+
* Add getKernelSourcesNoGUI.sh for cases where the user does not want to edit the .config file through a GUI.
49+
* Add removeAllSources.sh for removing kernel sources and compressed files after the kernel is built.
50+
* Check to make sure that the version of the kernel matches the sources to download
51+
52+
March, 2018
53+
* v1.0-L4T28.1
54+
* L4T 28.1 (JetPack 3.1)
55+
56+
July, 2017
57+
* v1.0-L4T24.2.1
58+
* L4T 24.2.1
59+
60+
April, 2017
61+
* Initial Release
62+
* v1.0-L4T24.2
63+
* L4T 24.2
64+
65+
## License
66+
MIT License
67+
68+
Copyright (c) 2017-2018 Jetsonhacks
69+
Copyright (c) 2015-2018 Raffaello Bonghi (jetson_easy)
70+
71+
Permission is hereby granted, free of charge, to any person obtaining a copy
72+
of this software and associated documentation files (the "Software"), to deal
73+
in the Software without restriction, including without limitation the rights
74+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
75+
copies of the Software, and to permit persons to whom the Software is
76+
furnished to do so, subject to the following conditions:
77+
78+
The above copyright notice and this permission notice shall be included in all
79+
copies or substantial portions of the Software.
80+
81+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
82+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
83+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
84+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
85+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
86+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
87+
SOFTWARE.
88+
89+
3490

3591

3692

copyImage.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
11
#!/bin/bash
2-
sudo ./scripts/copyImage.sh
2+
# Check to make sure the Image file has been generated
3+
# The "could not stat" error seems to confuse people
4+
if [ -f /usr/src/kernel/kernel-4.4/arch/arm64/boot/Image ] ; then
5+
echo "Copying Image to /boot diretory"
6+
sudo ./scripts/copyImage.sh
7+
echo "Image copied"
8+
tput setaf 2
9+
echo "Please reboot for changes to take effect"
10+
tput sgr0
11+
else
12+
tput setaf 1
13+
echo "==== Image file does not exist ===="
14+
tput sgr0
15+
echo "Check for errors in makeKernel"
16+
echo ""
17+
echo "Copy failed"
18+
fi
19+

diffs/devfreq/devfreq.patch

Lines changed: 0 additions & 3 deletions
This file was deleted.

diffs/nvgpu/nvgpu.patch

Lines changed: 0 additions & 6 deletions
This file was deleted.

diffs/tegra-alt/tegra-alt.patch

Lines changed: 0 additions & 3 deletions
This file was deleted.

getKernelSources.sh

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
11
#!/bin/bash
22
# Install the kernel source for L4T
3-
sudo ./scripts/getKernelSources.sh
3+
# Make sure that we are downloading the correct kernel source
4+
source scripts/jetson_variables.sh
5+
#Print Jetson version
6+
echo "$JETSON_DESCRIPTION"
7+
#Print Jetpack version
8+
echo "Jetpack $JETSON_JETPACK [L4T $JETSON_L4T]"
9+
10+
# Check to make sure we're installing the correct kernel sources
11+
L4TTarget="28.2"
12+
if [ $JETSON_L4T == $L4TTarget ] ; then
13+
echo "Getting kernel sources"
14+
sudo ./scripts/getKernelSources.sh
15+
else
16+
echo ""
17+
tput setaf 1
18+
echo "==== L4T Kernel Version Mismatch! ============="
19+
tput sgr0
20+
echo ""
21+
echo "This repository branch is for installing the kernel sources for L4T "$L4TTarget
22+
echo "You are attempting to use these kernel sources on a L4T "$JETSON_L4T "system."
23+
echo "The kernel sources do not match their L4T release!"
24+
echo ""
25+
echo "Please git checkout the appropriate kernel sources for your release"
26+
echo " "
27+
echo "You can list the tagged versions."
28+
echo "$ git tag -l"
29+
echo "And then checkout the latest version: "
30+
echo "For example"
31+
echo "$ git checkout v1.0-L4T"$JETSON_L4T
32+
echo ""
33+
fi
34+
35+

getKernelSourcesNoGUI.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
# Install the kernel source for L4T
3+
# Make sure that we are downloading the correct kernel source
4+
source scripts/jetson_variables.sh
5+
#Print Jetson version
6+
echo "$JETSON_DESCRIPTION"
7+
#Print Jetpack version
8+
echo "Jetpack $JETSON_JETPACK [L4T $JETSON_L4T]"
9+
10+
# Check to make sure we're installing the correct kernel sources
11+
L4TTarget="28.2"
12+
if [ $JETSON_L4T == $L4TTarget ] ; then
13+
echo "Getting kernel sources"
14+
sudo ./scripts/getKernelSourcesNoGUI.sh
15+
else
16+
echo ""
17+
tput setaf 1
18+
echo "==== L4T Kernel Version Mismatch! ============="
19+
tput sgr0
20+
echo ""
21+
echo "This repository branch is for installing the kernel sources for L4T "$L4TTarget
22+
echo "You are attempting to use these kernel sources on a L4T "$JETSON_L4T "system."
23+
echo "The kernel sources do not match their L4T release.!"
24+
echo ""
25+
echo "Please git checkout the appropriate kernel sources for your release"
26+
echo " "
27+
echo "You can list the tagged versions."
28+
echo "$ git tag -l"
29+
echo "And then checkout the latest version: "
30+
echo "For example"
31+
echo "$ git checkout v1.0-L4T"$JETSON_L4T
32+
echo ""
33+
fi
34+

makeKernel.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/bash
2-
sudo ./scripts/fixMakeFiles.sh
32
sudo ./scripts/makeKernel.sh
43

removeAllKernelSources.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
# Remove all of the kernel sources that were downloaded and built during the kernel build process
3+
# Note that this will also remove the possibly changed .config file in:
4+
# /usr/src/kernel/kernel-4.4
5+
echo "Removing All Kernel Sources"
6+
sudo ./scripts/removeAllKernelSources.sh
7+
echo "Kernel sources removed"

scripts/copyImage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ cd /usr/src/kernel/kernel-4.4
1010
# sudo cp arch/arm64/boot/zImage /boot/zImage
1111
# Note that if you are compiling on an external device, like a SSD, you should probably
1212
# copy this over to the internal eMMC if that is where the Jetson boots
13-
sudo cp arch/arm64/boot/Image /boot/Image
13+
cp arch/arm64/boot/Image /boot/Image
1414

1515

0 commit comments

Comments
 (0)