From 86d207af7e02e3c6b4b227545428a08a97462ab4 Mon Sep 17 00:00:00 2001 From: Shreeyak Date: Tue, 26 Jun 2018 14:23:57 +0530 Subject: [PATCH 1/9] Updated repo to build kernel for 28.2.1 --- getKernelSources.sh | 6 ++-- scripts/getKernelSources.sh | 51 +++++++++++++++++++++++--- scripts/jetson_variables.sh | 72 +++++++++++++++++++------------------ 3 files changed, 87 insertions(+), 42 deletions(-) diff --git a/getKernelSources.sh b/getKernelSources.sh index 5e414ba..f5da10c 100755 --- a/getKernelSources.sh +++ b/getKernelSources.sh @@ -7,7 +7,7 @@ echo "$JETSON_DESCRIPTION" echo "Jetpack $JETSON_JETPACK [L4T $JETSON_L4T]" # Check to make sure we're installing the correct kernel sources -L4TTarget="28.2" +L4TTarget="28.2.1" if [ $JETSON_L4T == $L4TTarget ] ; then echo "Getting kernel sources" sudo ./scripts/getKernelSources.sh @@ -17,7 +17,7 @@ else echo "==== L4T Kernel Version Mismatch! =============" tput sgr0 echo "" - echo "This repository branch is for installing the kernel sources for L4T "$L4TTarget + echo "This repository branch is for installing the kernel sources for L4T "$L4TTarget echo "You are attempting to use these kernel sources on a L4T "$JETSON_L4T "system." echo "The kernel sources do not match their L4T release!" echo "" @@ -27,7 +27,7 @@ else echo "$ git tag -l" echo "And then checkout the latest version: " echo "For example" - echo "$ git checkout v1.0-L4T"$JETSON_L4T + echo "$ git checkout L4T"$JETSON_L4T echo "" fi diff --git a/scripts/getKernelSources.sh b/scripts/getKernelSources.sh index ec84ba0..390afe4 100755 --- a/scripts/getKernelSources.sh +++ b/scripts/getKernelSources.sh @@ -3,12 +3,53 @@ apt-add-repository universe apt-get update apt-get install qt5-default pkg-config -y cd /usr/src -wget -N http://developer.download.nvidia.com/embedded/L4T/r28_Release_v2.0/GA/BSP/tx2_sources.tbz2 -sudo tar -xvf tx2_sources.tbz2 public_release/kernel_src.tbz2 -tar -xvf public_release/kernel_src.tbz2 -# Space is tight; get rid of the compressed kernel source -rm -r public_release + +# For older method, following can be used, but decided to come up with more efficient mode: +# wget -N "https://developer.download.nvidia.com/embedded/L4T/r28_Release_v2.1/public_sources.tbz2?YoszKxkjC1hGlemo-Y1ErDXXvPUeDepDcd8KBvWL29Re9YNC8HZyClKNEEqvIB2r_pxl7GJyusN7ucO-DhysxFqkqLUOyPRpB2qvvefsf7CcJpOnrb0imN2Lkpa8C3K_ItZ0cl3yneR7VQb9L-_wmw" +# Getting from Git via cloning takes way too long, so we download the "snapshots" generated by gitweb. Inspired by source_sync.sh script. +# The snapshot option can be seen here: http://nv-tegra.nvidia.com/gitweb/?p=linux-4.4.git;a=commit;h=d259faa6df3f513591e4246a782f51bb940d09ad + +# Set kernel tag to one of the tags from the repo, like in here: http://nv-tegra.nvidia.com/gitweb/?p=linux-t18x.git;a=summary +KERNEL_TAG=tegra-l4t-r28.2.1 + +SOURCE_INFO=" +kernel/kernel-4.4:linux-4.4.git +kernel/t18x:linux-t18x.git +kernel/nvgpu:linux-nvgpu.git +kernel/nvhost:linux-nvhost.git +kernel/nvmap:linux-nvmap.git +kernel/nvmap-t18x:linux-nvmap-t18x.git +kernel/display:linux-display.git +hardware/nvidia/soc/t18x:device/hardware/nvidia/soc/t18x.git +hardware/nvidia/platform/tegra/common:device/hardware/nvidia/platform/tegra/common.git +hardware/nvidia/platform/t18x/common:device/hardware/nvidia/platform/t18x/common.git +hardware/nvidia/platform/t18x/quill:device/hardware/nvidia/platform/t18x/quill.git +hardware/nvidia/soc/t210:device/hardware/nvidia/soc/t210.git +hardware/nvidia/platform/t210/common:device/hardware/nvidia/platform/t210/common.git +hardware/nvidia/platform/t210/jetson:device/hardware/nvidia/platform/t210/jetson.git +hardware/nvidia/soc/tegra:device/hardware/nvidia/soc/tegra.git +" +NSOURCES=0 +declare -a SOURCE_INFO_PROCESSED +SOURCE_INFO_PROCESSED=($(echo "$SOURCE_INFO")) +NSOURCES=${#SOURCE_INFO_PROCESSED[*]} + +for ((i=0; i < NSOURCES; i++)); do + FOLDER_NAME=$(echo "${SOURCE_INFO_PROCESSED[i]}" | cut -f 1 -d ':') + REPO_URL=$(echo "${SOURCE_INFO_PROCESSED[i]}" | cut -f 2 -d ':') + REPO_NAME=$(echo "${REPO_URL}" | cut -f 1 -d '.') + + mkdir -p "$FOLDER_NAME" + wget -O "$REPO_NAME.tgz" -vr "http://nv-tegra.nvidia.com/gitweb/?p=$REPO_URL;a=snapshot;h=$KERNEL_TAG;sf=tgz" + + tar -xvf "$REPO_NAME.tgz" -C "$FOLDER_NAME" --strip-components 1 + rm "$REPO_NAME.tgz" + +done + + cd kernel/kernel-4.4 + # Go get the default config file; this becomes the new system configuration zcat /proc/config.gz > .config # Ready to configure kernel diff --git a/scripts/jetson_variables.sh b/scripts/jetson_variables.sh index e11ea11..815dd08 100755 --- a/scripts/jetson_variables.sh +++ b/scripts/jetson_variables.sh @@ -6,29 +6,29 @@ # modification, are permitted provided that the following conditions # are met: # -# 1. Redistributions of source code must retain the above copyright +# 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the names of its -# contributors may be used to endorse or promote products derived +# 3. Neither the name of the copyright holder nor the names of its +# contributors may be used to endorse or promote products derived # from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND -# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# NVIDIA Identify version -# reference: +# NVIDIA Identify version +# reference: # https://devtalk.nvidia.com/default/topic/1014424/jetson-tx2/identifying-tx1-and-tx2-at-runtime/ # https://devtalk.nvidia.com/default/topic/996988/jetson-tk1/chip-uid/post/5100481/#5100481 @@ -53,62 +53,66 @@ if [ -f /etc/nv_tegra_release ]; then JETSON_L4T_STRING=$(head -n 1 /etc/nv_tegra_release) # Load release and revision - JETSON_L4T_RELEASE=$(echo $JETSON_L4T_STRING | cut -f 1 -d ',' | sed 's/\# R//g' | cut -d ' ' -f1) - JETSON_L4T_REVISION=$(echo $JETSON_L4T_STRING | cut -f 2 -d ',' | sed 's/\ REVISION: //g' | cut -d. -f1) + JETSON_L4T_RELEASE=$(echo $JETSON_L4T_STRING | cut -f 1 -d ',' | sed 's,\# R,,' | cut -d ' ' -f 1) + JETSON_L4T_REVISION=$(echo $JETSON_L4T_STRING | cut -f 2 -d ',' | sed 's,\ REVISION: ,,g' | cut -d. -f 1) # unset variable unset JETSON_L4T_STRING - + # Write Jetson description JETSON_L4T="$JETSON_L4T_RELEASE.$JETSON_L4T_REVISION" # Write version of jetpack installed # https://developer.nvidia.com/embedded/jetpack-archive - if [ "$JETSON_BOARD" = "TX2i" ] ; then + if [ "$JETSON_BOARD" = "TX2i" ] ; then case $JETSON_L4T in - "28.2") + "28.2.1") + JETSON_JETPACK="3.2.1" ;; + "28.2") JETSON_JETPACK="3.2" ;; *) JETSON_JETPACK="UNKNOWN" ;; - esac + esac elif [ "$JETSON_BOARD" = "TX2" ] ; then case $JETSON_L4T in - "28.2") + "28.2.1") + JETSON_JETPACK="3.2.1" ;; + "28.2") JETSON_JETPACK="3.2" ;; - "28.1") + "28.1") JETSON_JETPACK="3.1" ;; - "27.1") + "27.1") JETSON_JETPACK="3.0" ;; *) JETSON_JETPACK="UNKNOWN" ;; esac elif [ "$JETSON_BOARD" = "TX1" ] ; then case $JETSON_L4T in - "28.2") + "28.2") JETSON_JETPACK="3.2" ;; - "28.1") + "28.1") JETSON_JETPACK="3.1" ;; - "24.2.1") + "24.2.1") JETSON_JETPACK="3.0 or 2.3.1" ;; - "24.2") + "24.2") JETSON_JETPACK="2.3" ;; - "24.1") + "24.1") JETSON_JETPACK="2.2.1 or 2.2" ;; - "23.2") + "23.2") JETSON_JETPACK="2.1" ;; - "23.1") + "23.1") JETSON_JETPACK="2.0" ;; *) JETSON_JETPACK="UNKNOWN" ;; esac elif [ "$JETSON_BOARD" ="TK1" ] ; then case $JETSON_L4T in - "21.5") + "21.5") JETSON_JETPACK="2.3.1 or 2.3" ;; - "21.4") + "21.4") JETSON_JETPACK="2.2 or 2.1 or 2.0 or DP 1.2" ;; - "21.3") + "21.3") JETSON_JETPACK="DP 1.1" ;; - "21.2") + "21.2") JETSON_JETPACK="DP 1.0" ;; *) JETSON_JETPACK="UNKNOWN" ;; From cb3458230324a0c3632ebeec0c6c3bf1072af9e8 Mon Sep 17 00:00:00 2001 From: Shreeyak Date: Tue, 26 Jun 2018 19:36:41 +0530 Subject: [PATCH 2/9] Automatically detects L4T version and fetches corresponding sources --- getKernelSources.sh | 63 ++++++++++++++++++++++++------------- scripts/getKernelSources.sh | 3 +- 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/getKernelSources.sh b/getKernelSources.sh index f5da10c..2acba7f 100755 --- a/getKernelSources.sh +++ b/getKernelSources.sh @@ -6,29 +6,50 @@ echo "$JETSON_DESCRIPTION" #Print Jetpack version echo "Jetpack $JETSON_JETPACK [L4T $JETSON_L4T]" -# Check to make sure we're installing the correct kernel sources -L4TTarget="28.2.1" -if [ $JETSON_L4T == $L4TTarget ] ; then - echo "Getting kernel sources" + +# Set kernel tag to to the version of L4T in system. Reference: http://nv-tegra.nvidia.com/gitweb/?p=linux-t18x.git;a=summary +# Possible kernel tags for TX2: +# tegra-l4t-r28.2.1 +# tegra-l4t-r28.2 +# tegra-l4t-r28.2-rc +# tegra-l4t-r28.1 +# tegra-l4t-r27.1 +KERNEL_TAG=0 + +if [ "$JETSON_BOARD" = "TX2i" ] ; then + case $JETSON_L4T in + "28.2.1") + KERNEL_TAG="tegra-l4t-r28.2.1" ;; + "28.2") + KERNEL_TAG="tegra-l4t-r28.2" ;; + *) + KERNEL_TAG="UNKNOWN" ;; + esac +elif [ "$JETSON_BOARD" = "TX2" ] ; then + case $JETSON_L4T in + "28.2.1") + KERNEL_TAG="tegra-l4t-r28.2.1" ;; + "28.2") + KERNEL_TAG="tegra-l4t-r28.2" ;; + "28.1") + KERNEL_TAG="tegra-l4t-r28.1" ;; + "27.1") + KERNEL_TAG="tegra-l4t-r27.1" ;; + *) + JETSON_JETPACK="UNKNOWN" ;; + esac +else + # Unknown board + JETSON_JETPACK="UNKNOWN" +fi + +if [ $JETSON_JETPACK == "UNKNOWN" ] ; then + echo "An unsupported version of the board or L4T detected! " sudo ./scripts/getKernelSources.sh else - echo "" - tput setaf 1 - echo "==== L4T Kernel Version Mismatch! =============" - tput sgr0 - echo "" - echo "This repository branch is for installing the kernel sources for L4T "$L4TTarget - echo "You are attempting to use these kernel sources on a L4T "$JETSON_L4T "system." - echo "The kernel sources do not match their L4T release!" - echo "" - echo "Please git checkout the appropriate kernel sources for your release" - echo " " - echo "You can list the tagged versions." - echo "$ git tag -l" - echo "And then checkout the latest version: " - echo "For example" - echo "$ git checkout L4T"$JETSON_L4T - echo "" + echo "Setting the kernel URL for L4T $L4TTarget" + echo "Getting kernel sources" + sudo ./scripts/getKernelSources.sh fi diff --git a/scripts/getKernelSources.sh b/scripts/getKernelSources.sh index 390afe4..5818ef2 100755 --- a/scripts/getKernelSources.sh +++ b/scripts/getKernelSources.sh @@ -4,13 +4,12 @@ apt-get update apt-get install qt5-default pkg-config -y cd /usr/src +# Note: New Method for getting kernel source. # For older method, following can be used, but decided to come up with more efficient mode: # wget -N "https://developer.download.nvidia.com/embedded/L4T/r28_Release_v2.1/public_sources.tbz2?YoszKxkjC1hGlemo-Y1ErDXXvPUeDepDcd8KBvWL29Re9YNC8HZyClKNEEqvIB2r_pxl7GJyusN7ucO-DhysxFqkqLUOyPRpB2qvvefsf7CcJpOnrb0imN2Lkpa8C3K_ItZ0cl3yneR7VQb9L-_wmw" # Getting from Git via cloning takes way too long, so we download the "snapshots" generated by gitweb. Inspired by source_sync.sh script. # The snapshot option can be seen here: http://nv-tegra.nvidia.com/gitweb/?p=linux-4.4.git;a=commit;h=d259faa6df3f513591e4246a782f51bb940d09ad -# Set kernel tag to one of the tags from the repo, like in here: http://nv-tegra.nvidia.com/gitweb/?p=linux-t18x.git;a=summary -KERNEL_TAG=tegra-l4t-r28.2.1 SOURCE_INFO=" kernel/kernel-4.4:linux-4.4.git From 4aacdaf3fd4d9cf75b182e1c01a76ba123ce6e4a Mon Sep 17 00:00:00 2001 From: Shreeyak Date: Tue, 26 Jun 2018 19:41:43 +0530 Subject: [PATCH 3/9] updated noGui script --- scripts/getKernelSourcesNoGUI.sh | 53 +++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/scripts/getKernelSourcesNoGUI.sh b/scripts/getKernelSourcesNoGUI.sh index bc01444..7dca28b 100755 --- a/scripts/getKernelSourcesNoGUI.sh +++ b/scripts/getKernelSourcesNoGUI.sh @@ -3,12 +3,55 @@ apt-add-repository universe apt-get update apt-get install pkg-config -y cd /usr/src -wget -N http://developer.download.nvidia.com/embedded/L4T/r28_Release_v2.0/GA/BSP/tx2_sources.tbz2 -sudo tar -xvf tx2_sources.tbz2 public_release/kernel_src.tbz2 -tar -xvf public_release/kernel_src.tbz2 -# Space is tight; get rid of the compressed kernel source -rm -r public_release + +# Note: New Method for getting kernel source. +# For older method, following can be used, but decided to come up with more efficient mode: +# wget -N "https://developer.download.nvidia.com/embedded/L4T/r28_Release_v2.1/public_sources.tbz2?YoszKxkjC1hGlemo-Y1ErDXXvPUeDepDcd8KBvWL29Re9YNC8HZyClKNEEqvIB2r_pxl7GJyusN7ucO-DhysxFqkqLUOyPRpB2qvvefsf7CcJpOnrb0imN2Lkpa8C3K_ItZ0cl3yneR7VQb9L-_wmw" +# Getting from Git via cloning takes way too long, so we download the "snapshots" generated by gitweb. Inspired by source_sync.sh script. +# The snapshot option can be seen here: http://nv-tegra.nvidia.com/gitweb/?p=linux-4.4.git;a=commit;h=d259faa6df3f513591e4246a782f51bb940d09ad + + +SOURCE_INFO=" +kernel/kernel-4.4:linux-4.4.git +kernel/t18x:linux-t18x.git +kernel/nvgpu:linux-nvgpu.git +kernel/nvhost:linux-nvhost.git +kernel/nvmap:linux-nvmap.git +kernel/nvmap-t18x:linux-nvmap-t18x.git +kernel/display:linux-display.git +hardware/nvidia/soc/t18x:device/hardware/nvidia/soc/t18x.git +hardware/nvidia/platform/tegra/common:device/hardware/nvidia/platform/tegra/common.git +hardware/nvidia/platform/t18x/common:device/hardware/nvidia/platform/t18x/common.git +hardware/nvidia/platform/t18x/quill:device/hardware/nvidia/platform/t18x/quill.git +hardware/nvidia/soc/t210:device/hardware/nvidia/soc/t210.git +hardware/nvidia/platform/t210/common:device/hardware/nvidia/platform/t210/common.git +hardware/nvidia/platform/t210/jetson:device/hardware/nvidia/platform/t210/jetson.git +hardware/nvidia/soc/tegra:device/hardware/nvidia/soc/tegra.git +" +NSOURCES=0 +declare -a SOURCE_INFO_PROCESSED +SOURCE_INFO_PROCESSED=($(echo "$SOURCE_INFO")) +NSOURCES=${#SOURCE_INFO_PROCESSED[*]} + +for ((i=0; i < NSOURCES; i++)); do + FOLDER_NAME=$(echo "${SOURCE_INFO_PROCESSED[i]}" | cut -f 1 -d ':') + REPO_URL=$(echo "${SOURCE_INFO_PROCESSED[i]}" | cut -f 2 -d ':') + REPO_NAME=$(echo "${REPO_URL}" | cut -f 1 -d '.') + + mkdir -p "$FOLDER_NAME" + wget -O "$REPO_NAME.tgz" -vr "http://nv-tegra.nvidia.com/gitweb/?p=$REPO_URL;a=snapshot;h=$KERNEL_TAG;sf=tgz" + + tar -xvf "$REPO_NAME.tgz" -C "$FOLDER_NAME" --strip-components 1 + rm "$REPO_NAME.tgz" + +done + + cd kernel/kernel-4.4 + # Go get the default config file; this becomes the new system configuration zcat /proc/config.gz > .config +# Ready to configure kernel + + From fdc72fa7f6a572c349f64025e419f386a13ff2c9 Mon Sep 17 00:00:00 2001 From: Shreeyak Date: Tue, 26 Jun 2018 19:57:48 +0530 Subject: [PATCH 4/9] fixed recognition of r28.2.1 as r28.2 --- scripts/jetson_variables.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/jetson_variables.sh b/scripts/jetson_variables.sh index 815dd08..767b05b 100755 --- a/scripts/jetson_variables.sh +++ b/scripts/jetson_variables.sh @@ -54,7 +54,7 @@ if [ -f /etc/nv_tegra_release ]; then # Load release and revision JETSON_L4T_RELEASE=$(echo $JETSON_L4T_STRING | cut -f 1 -d ',' | sed 's,\# R,,' | cut -d ' ' -f 1) - JETSON_L4T_REVISION=$(echo $JETSON_L4T_STRING | cut -f 2 -d ',' | sed 's,\ REVISION: ,,g' | cut -d. -f 1) + JETSON_L4T_REVISION=$(echo $JETSON_L4T_STRING | cut -f 2 -d ',' | sed 's,\ REVISION: ,,g') # unset variable unset JETSON_L4T_STRING @@ -67,7 +67,7 @@ if [ -f /etc/nv_tegra_release ]; then case $JETSON_L4T in "28.2.1") JETSON_JETPACK="3.2.1" ;; - "28.2") + "28.2.0") JETSON_JETPACK="3.2" ;; *) JETSON_JETPACK="UNKNOWN" ;; @@ -76,43 +76,43 @@ if [ -f /etc/nv_tegra_release ]; then case $JETSON_L4T in "28.2.1") JETSON_JETPACK="3.2.1" ;; - "28.2") + "28.2.0") JETSON_JETPACK="3.2" ;; - "28.1") + "28.1.0") JETSON_JETPACK="3.1" ;; - "27.1") + "27.1.0") JETSON_JETPACK="3.0" ;; *) JETSON_JETPACK="UNKNOWN" ;; esac elif [ "$JETSON_BOARD" = "TX1" ] ; then case $JETSON_L4T in - "28.2") + "28.2.0") JETSON_JETPACK="3.2" ;; - "28.1") + "28.1.0") JETSON_JETPACK="3.1" ;; "24.2.1") JETSON_JETPACK="3.0 or 2.3.1" ;; - "24.2") + "24.2.0") JETSON_JETPACK="2.3" ;; - "24.1") + "24.1.0") JETSON_JETPACK="2.2.1 or 2.2" ;; - "23.2") + "23.2.0") JETSON_JETPACK="2.1" ;; - "23.1") + "23.1.0") JETSON_JETPACK="2.0" ;; *) JETSON_JETPACK="UNKNOWN" ;; esac elif [ "$JETSON_BOARD" ="TK1" ] ; then case $JETSON_L4T in - "21.5") + "21.5.0") JETSON_JETPACK="2.3.1 or 2.3" ;; - "21.4") + "21.4.0") JETSON_JETPACK="2.2 or 2.1 or 2.0 or DP 1.2" ;; - "21.3") + "21.3.0") JETSON_JETPACK="DP 1.1" ;; - "21.2") + "21.2.0") JETSON_JETPACK="DP 1.0" ;; *) JETSON_JETPACK="UNKNOWN" ;; From 840fc6987a9d4649a4f989206e21a41ca53db3ae Mon Sep 17 00:00:00 2001 From: Shreeyak Date: Tue, 26 Jun 2018 20:07:52 +0530 Subject: [PATCH 5/9] corrected kernel_tag not being passed --- getKernelSources.sh | 49 +------------ scripts/getKernelSources.sh | 142 +++++++++++++++++++++++------------- 2 files changed, 96 insertions(+), 95 deletions(-) diff --git a/getKernelSources.sh b/getKernelSources.sh index 2acba7f..beac034 100755 --- a/getKernelSources.sh +++ b/getKernelSources.sh @@ -7,49 +7,6 @@ echo "$JETSON_DESCRIPTION" echo "Jetpack $JETSON_JETPACK [L4T $JETSON_L4T]" -# Set kernel tag to to the version of L4T in system. Reference: http://nv-tegra.nvidia.com/gitweb/?p=linux-t18x.git;a=summary -# Possible kernel tags for TX2: -# tegra-l4t-r28.2.1 -# tegra-l4t-r28.2 -# tegra-l4t-r28.2-rc -# tegra-l4t-r28.1 -# tegra-l4t-r27.1 -KERNEL_TAG=0 - -if [ "$JETSON_BOARD" = "TX2i" ] ; then - case $JETSON_L4T in - "28.2.1") - KERNEL_TAG="tegra-l4t-r28.2.1" ;; - "28.2") - KERNEL_TAG="tegra-l4t-r28.2" ;; - *) - KERNEL_TAG="UNKNOWN" ;; - esac -elif [ "$JETSON_BOARD" = "TX2" ] ; then - case $JETSON_L4T in - "28.2.1") - KERNEL_TAG="tegra-l4t-r28.2.1" ;; - "28.2") - KERNEL_TAG="tegra-l4t-r28.2" ;; - "28.1") - KERNEL_TAG="tegra-l4t-r28.1" ;; - "27.1") - KERNEL_TAG="tegra-l4t-r27.1" ;; - *) - JETSON_JETPACK="UNKNOWN" ;; - esac -else - # Unknown board - JETSON_JETPACK="UNKNOWN" -fi - -if [ $JETSON_JETPACK == "UNKNOWN" ] ; then - echo "An unsupported version of the board or L4T detected! " - sudo ./scripts/getKernelSources.sh -else - echo "Setting the kernel URL for L4T $L4TTarget" - echo "Getting kernel sources" - sudo ./scripts/getKernelSources.sh -fi - - +echo "Setting the kernel URL for L4T $KERNEL_TAG" +echo "Getting kernel sources" +sudo ./scripts/getKernelSources.sh diff --git a/scripts/getKernelSources.sh b/scripts/getKernelSources.sh index 5818ef2..733271c 100755 --- a/scripts/getKernelSources.sh +++ b/scripts/getKernelSources.sh @@ -4,53 +4,97 @@ apt-get update apt-get install qt5-default pkg-config -y cd /usr/src -# Note: New Method for getting kernel source. -# For older method, following can be used, but decided to come up with more efficient mode: -# wget -N "https://developer.download.nvidia.com/embedded/L4T/r28_Release_v2.1/public_sources.tbz2?YoszKxkjC1hGlemo-Y1ErDXXvPUeDepDcd8KBvWL29Re9YNC8HZyClKNEEqvIB2r_pxl7GJyusN7ucO-DhysxFqkqLUOyPRpB2qvvefsf7CcJpOnrb0imN2Lkpa8C3K_ItZ0cl3yneR7VQb9L-_wmw" -# Getting from Git via cloning takes way too long, so we download the "snapshots" generated by gitweb. Inspired by source_sync.sh script. -# The snapshot option can be seen here: http://nv-tegra.nvidia.com/gitweb/?p=linux-4.4.git;a=commit;h=d259faa6df3f513591e4246a782f51bb940d09ad - - -SOURCE_INFO=" -kernel/kernel-4.4:linux-4.4.git -kernel/t18x:linux-t18x.git -kernel/nvgpu:linux-nvgpu.git -kernel/nvhost:linux-nvhost.git -kernel/nvmap:linux-nvmap.git -kernel/nvmap-t18x:linux-nvmap-t18x.git -kernel/display:linux-display.git -hardware/nvidia/soc/t18x:device/hardware/nvidia/soc/t18x.git -hardware/nvidia/platform/tegra/common:device/hardware/nvidia/platform/tegra/common.git -hardware/nvidia/platform/t18x/common:device/hardware/nvidia/platform/t18x/common.git -hardware/nvidia/platform/t18x/quill:device/hardware/nvidia/platform/t18x/quill.git -hardware/nvidia/soc/t210:device/hardware/nvidia/soc/t210.git -hardware/nvidia/platform/t210/common:device/hardware/nvidia/platform/t210/common.git -hardware/nvidia/platform/t210/jetson:device/hardware/nvidia/platform/t210/jetson.git -hardware/nvidia/soc/tegra:device/hardware/nvidia/soc/tegra.git -" -NSOURCES=0 -declare -a SOURCE_INFO_PROCESSED -SOURCE_INFO_PROCESSED=($(echo "$SOURCE_INFO")) -NSOURCES=${#SOURCE_INFO_PROCESSED[*]} - -for ((i=0; i < NSOURCES; i++)); do - FOLDER_NAME=$(echo "${SOURCE_INFO_PROCESSED[i]}" | cut -f 1 -d ':') - REPO_URL=$(echo "${SOURCE_INFO_PROCESSED[i]}" | cut -f 2 -d ':') - REPO_NAME=$(echo "${REPO_URL}" | cut -f 1 -d '.') - - mkdir -p "$FOLDER_NAME" - wget -O "$REPO_NAME.tgz" -vr "http://nv-tegra.nvidia.com/gitweb/?p=$REPO_URL;a=snapshot;h=$KERNEL_TAG;sf=tgz" - - tar -xvf "$REPO_NAME.tgz" -C "$FOLDER_NAME" --strip-components 1 - rm "$REPO_NAME.tgz" - -done - - -cd kernel/kernel-4.4 - -# Go get the default config file; this becomes the new system configuration -zcat /proc/config.gz > .config -# Ready to configure kernel -make xconfig + +# Set kernel tag to to the version of L4T in system. Reference: http://nv-tegra.nvidia.com/gitweb/?p=linux-t18x.git;a=summary +# Possible kernel tags for TX2: +# tegra-l4t-r28.2.1 +# tegra-l4t-r28.2 +# tegra-l4t-r28.2-rc +# tegra-l4t-r28.1 +# tegra-l4t-r27.1 +KERNEL_TAG=0 + +if [ "$JETSON_BOARD" = "TX2i" ] ; then + case $JETSON_L4T in + "28.2.1") + KERNEL_TAG="tegra-l4t-r28.2.1" ;; + "28.2") + KERNEL_TAG="tegra-l4t-r28.2" ;; + *) + KERNEL_TAG="UNKNOWN" ;; + esac +elif [ "$JETSON_BOARD" = "TX2" ] ; then + case $JETSON_L4T in + "28.2.1") + KERNEL_TAG="tegra-l4t-r28.2.1" ;; + "28.2") + KERNEL_TAG="tegra-l4t-r28.2" ;; + "28.1") + KERNEL_TAG="tegra-l4t-r28.1" ;; + "27.1") + KERNEL_TAG="tegra-l4t-r27.1" ;; + *) + JETSON_JETPACK="UNKNOWN" ;; + esac +else + # Unknown board + JETSON_JETPACK="UNKNOWN" +fi + +if [ $JETSON_JETPACK == "UNKNOWN" ] ; then + echo "An unsupported version of the board or L4T detected! " + sudo ./scripts/getKernelSources.sh +else + + + # Note: New Method for getting kernel source. + # For older method, following can be used, but decided to come up with more efficient mode: + # wget -N "https://developer.download.nvidia.com/embedded/L4T/r28_Release_v2.1/public_sources.tbz2?YoszKxkjC1hGlemo-Y1ErDXXvPUeDepDcd8KBvWL29Re9YNC8HZyClKNEEqvIB2r_pxl7GJyusN7ucO-DhysxFqkqLUOyPRpB2qvvefsf7CcJpOnrb0imN2Lkpa8C3K_ItZ0cl3yneR7VQb9L-_wmw" + # Getting from Git via cloning takes way too long, so we download the "snapshots" generated by gitweb. Inspired by source_sync.sh script. + # The snapshot option can be seen here: http://nv-tegra.nvidia.com/gitweb/?p=linux-4.4.git;a=commit;h=d259faa6df3f513591e4246a782f51bb940d09ad + + + SOURCE_INFO=" + kernel/kernel-4.4:linux-4.4.git + kernel/t18x:linux-t18x.git + kernel/nvgpu:linux-nvgpu.git + kernel/nvhost:linux-nvhost.git + kernel/nvmap:linux-nvmap.git + kernel/nvmap-t18x:linux-nvmap-t18x.git + kernel/display:linux-display.git + hardware/nvidia/soc/t18x:device/hardware/nvidia/soc/t18x.git + hardware/nvidia/platform/tegra/common:device/hardware/nvidia/platform/tegra/common.git + hardware/nvidia/platform/t18x/common:device/hardware/nvidia/platform/t18x/common.git + hardware/nvidia/platform/t18x/quill:device/hardware/nvidia/platform/t18x/quill.git + hardware/nvidia/soc/t210:device/hardware/nvidia/soc/t210.git + hardware/nvidia/platform/t210/common:device/hardware/nvidia/platform/t210/common.git + hardware/nvidia/platform/t210/jetson:device/hardware/nvidia/platform/t210/jetson.git + hardware/nvidia/soc/tegra:device/hardware/nvidia/soc/tegra.git + " + NSOURCES=0 + declare -a SOURCE_INFO_PROCESSED + SOURCE_INFO_PROCESSED=($(echo "$SOURCE_INFO")) + NSOURCES=${#SOURCE_INFO_PROCESSED[*]} + + for ((i=0; i < NSOURCES; i++)); do + FOLDER_NAME=$(echo "${SOURCE_INFO_PROCESSED[i]}" | cut -f 1 -d ':') + REPO_URL=$(echo "${SOURCE_INFO_PROCESSED[i]}" | cut -f 2 -d ':') + REPO_NAME=$(echo "${REPO_URL}" | cut -f 1 -d '.') + + mkdir -p "$FOLDER_NAME" + wget -O "$REPO_NAME.tgz" -vr "http://nv-tegra.nvidia.com/gitweb/?p=$REPO_URL;a=snapshot;h=$KERNEL_TAG;sf=tgz" + + tar -xvf "$REPO_NAME.tgz" -C "$FOLDER_NAME" --strip-components 1 + rm "$REPO_NAME.tgz" + + done + + + cd kernel/kernel-4.4 + + # Go get the default config file; this becomes the new system configuration + zcat /proc/config.gz > .config + # Ready to configure kernel + make xconfig +fi From 28307b16ba2e076694070c44948d1643ada748bf Mon Sep 17 00:00:00 2001 From: Shreeyak Date: Tue, 26 Jun 2018 20:10:07 +0530 Subject: [PATCH 6/9] corrected kernel_tag not being passes --- getKernelSources.sh | 3 +-- scripts/getKernelSources.sh | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/getKernelSources.sh b/getKernelSources.sh index beac034..ef9ecdf 100755 --- a/getKernelSources.sh +++ b/getKernelSources.sh @@ -7,6 +7,5 @@ echo "$JETSON_DESCRIPTION" echo "Jetpack $JETSON_JETPACK [L4T $JETSON_L4T]" -echo "Setting the kernel URL for L4T $KERNEL_TAG" -echo "Getting kernel sources" + sudo ./scripts/getKernelSources.sh diff --git a/scripts/getKernelSources.sh b/scripts/getKernelSources.sh index 733271c..5547934 100755 --- a/scripts/getKernelSources.sh +++ b/scripts/getKernelSources.sh @@ -46,6 +46,8 @@ if [ $JETSON_JETPACK == "UNKNOWN" ] ; then sudo ./scripts/getKernelSources.sh else + echo "Setting the kernel URL for L4T $KERNEL_TAG" + echo "Getting kernel sources" # Note: New Method for getting kernel source. # For older method, following can be used, but decided to come up with more efficient mode: From 9619507118ba95f5467e4801dc5ab6cd50c42131 Mon Sep 17 00:00:00 2001 From: Shreeyak Date: Tue, 26 Jun 2018 20:11:35 +0530 Subject: [PATCH 7/9] corrected kernel_tag not being passes --- scripts/getKernelSources.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/getKernelSources.sh b/scripts/getKernelSources.sh index 5547934..5efcea8 100755 --- a/scripts/getKernelSources.sh +++ b/scripts/getKernelSources.sh @@ -41,14 +41,15 @@ else JETSON_JETPACK="UNKNOWN" fi + +echo "Setting the kernel URL for L4T $KERNEL_TAG" +echo "Getting kernel sources" + if [ $JETSON_JETPACK == "UNKNOWN" ] ; then echo "An unsupported version of the board or L4T detected! " sudo ./scripts/getKernelSources.sh else - echo "Setting the kernel URL for L4T $KERNEL_TAG" - echo "Getting kernel sources" - # Note: New Method for getting kernel source. # For older method, following can be used, but decided to come up with more efficient mode: # wget -N "https://developer.download.nvidia.com/embedded/L4T/r28_Release_v2.1/public_sources.tbz2?YoszKxkjC1hGlemo-Y1ErDXXvPUeDepDcd8KBvWL29Re9YNC8HZyClKNEEqvIB2r_pxl7GJyusN7ucO-DhysxFqkqLUOyPRpB2qvvefsf7CcJpOnrb0imN2Lkpa8C3K_ItZ0cl3yneR7VQb9L-_wmw" From 0944ac3394d87f0178f1b93551db45c969f6a282 Mon Sep 17 00:00:00 2001 From: Shreeyak Date: Tue, 26 Jun 2018 20:15:40 +0530 Subject: [PATCH 8/9] corrected kernel_tag not shown --- scripts/getKernelSources.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/getKernelSources.sh b/scripts/getKernelSources.sh index 5efcea8..c3f8f85 100755 --- a/scripts/getKernelSources.sh +++ b/scripts/getKernelSources.sh @@ -4,6 +4,8 @@ apt-get update apt-get install qt5-default pkg-config -y cd /usr/src +# Install the kernel source for L4T +source scripts/jetson_variables.sh # Set kernel tag to to the version of L4T in system. Reference: http://nv-tegra.nvidia.com/gitweb/?p=linux-t18x.git;a=summary # Possible kernel tags for TX2: From a3e71f2134ce1f3fd6e48ba9fb05e7d43357b5bf Mon Sep 17 00:00:00 2001 From: shreeyak Date: Tue, 26 Jun 2018 15:20:19 +0000 Subject: [PATCH 9/9] fixed bugs inside scripts folder --- scripts/getKernelSources.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/getKernelSources.sh b/scripts/getKernelSources.sh index c3f8f85..a7dd3c3 100755 --- a/scripts/getKernelSources.sh +++ b/scripts/getKernelSources.sh @@ -1,11 +1,18 @@ #!/bin/bash +source jetson_variables.sh + apt-add-repository universe apt-get update apt-get install qt5-default pkg-config -y cd /usr/src # Install the kernel source for L4T -source scripts/jetson_variables.sh + +#Print Jetson version +echo "$JETSON_DESCRIPTION" + +#Pring Jetpack Version +echo "Jetpack $JETSON_JETPACK [L4T $JETSON_L4T]" # Set kernel tag to to the version of L4T in system. Reference: http://nv-tegra.nvidia.com/gitweb/?p=linux-t18x.git;a=summary # Possible kernel tags for TX2: @@ -14,7 +21,8 @@ source scripts/jetson_variables.sh # tegra-l4t-r28.2-rc # tegra-l4t-r28.1 # tegra-l4t-r27.1 -KERNEL_TAG=0 +#KERNEL_TAG=0 +echo "Jetson L4T is $JETSON_L4T" if [ "$JETSON_BOARD" = "TX2i" ] ; then case $JETSON_L4T in @@ -36,18 +44,18 @@ elif [ "$JETSON_BOARD" = "TX2" ] ; then "27.1") KERNEL_TAG="tegra-l4t-r27.1" ;; *) - JETSON_JETPACK="UNKNOWN" ;; + KERNEL_TAG="UNKNOWN" ;; esac else # Unknown board - JETSON_JETPACK="UNKNOWN" + KERNEL_TAG="UNKNOWN" fi echo "Setting the kernel URL for L4T $KERNEL_TAG" echo "Getting kernel sources" -if [ $JETSON_JETPACK == "UNKNOWN" ] ; then +if [ $KERNEL_TAG == "UNKNOWN" ] ; then echo "An unsupported version of the board or L4T detected! " sudo ./scripts/getKernelSources.sh else