準(zhǔn)備源碼和編譯器
編譯器
gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
內(nèi)核
Jetson_Linux_R32.5.1_aarch64.tbz2
https://developer.download.nvidia.cn/embedded/L4T/r32_Release_v5.2/T186/Jetson_Linux_R32.5.2_aarch64.tbz2?uobFhgLNHjkA5gGgWTdo5g4ige2UHmM0i1cSUZCpln_HWbs0VpiM3vHEXbNL6Y-4Nkh9IXjEN4OZm7Okj9tOUfoRyvJKhFJnauxdbXmI2WKu64ixfRY9LmH5CzRB9p8enxQdpN3QDaNPsES9dYvq3_nWDqd6nYb7Keksazfgiiw2nGE
public_sources.tbz2
https://developer.download.nvidia.cn/embedded/L4T/r32_Release_v5.2/sources/T186/public_sources.tbz2?_QOrN4-6EYrrfaYvE420W0Yxsqya_3JYgK0mO6N1bOvw-UBAFG3m5awD1b_eTzJmM5UwTgJM6SumgrjZ_vSPdySc96hye5dn3l22-0vwjUsdaQ2hkEmzZjFBAkMAq5SRna8BzvMv2B2TEr9c8vZP-gCS93_chVMZYBIOTK4
文件系統(tǒng)
Tegra_Linux_Sample-Root-Filesystem_R32.5.0_aarch64.tbz2
https://developer.download.nvidia.cn/embedded/L4T/r32_Release_v5.2/T186/Tegra_Linux_Sample-Root-Filesystem_R32.5.2_aarch64.tbz2?Ije4eojmvynhsLZ3MiT9j39loPqS4e9yBcuZ2W9tIWXeBlLwO01IIyVHm7f6qTF0jEOKq8yPPAZagdfreNoZygchvaSaD3RsXr00x-EdffxII7BSt9pQQlN39BxHrMXtwf1addKDmYZZAMtrUk3Pe7O_4APhmKSXGayJg2oF7S68WweQMxAgBPsn_3TDA4rjNQb4yWuCOMdE
源碼解壓,按照下面路徑配置
tar xvf public_sources.tbz2 -C ~/JetsonAGXKernel
tar xvf Tegra186_Linux_R32.5.0_aarch64.tbz2 ~/JetsonAGXKernel
tar xvf Tegra_Linux_Sample-Root-Filesystem_R32.5.0_aarch64.tbz -C ~/JetsonAGXKernel/Linux_for_Tegra/rootfs
cd ~/nvidia/Linux_for_Tegra/source/public
tar xvf kernel_src.tbz2 #這個(gè)是內(nèi)核源碼
配置交叉編譯環(huán)境
tar xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz -C ~/L4t_arm_compiler#路徑自行決定
環(huán)境變量配置周崭,配置到bash里柳譬,后面不用再刪除
export TEGRA_AGX_KERNEL_OUT=/home/fuhua/JetsonAGXKernel/Linux_for_Tegra/source/public/kernel/output#路徑可以自己定義,記住這個(gè)后面有用
export LOCALVERSION=-tegra
CROSS_TOOL_PATH=/home/fuhua/L4t_arm_compiler/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-#上面解壓出來(lái)的交叉編譯環(huán)境路徑
export PATH=$PATH:$CROSS_TOOL_PATH
編譯
生成配置文件
make ARCH=arm64 CROSS_COMPILE=$CROSS_TOOL_PATH O=$TEGRA_AGX_KERNEL_OUT tegra_defconfig
按需調(diào)整配置文件续镇,不需要不管
make ARCH=arm64 CROSS_COMPILE=$CROSS_TOOL_PATH O=$TEGRA_AGX_KERNEL_OUT menuconfig
編譯
make ARCH=arm64 CROSS_COMPILE=$CROSS_TOOL_PATH O=$TEGRA_AGX_KERNEL_OUT -j8
組成文件系統(tǒng)美澳,從output,也就是編譯好的文件路徑里拷貝以下內(nèi)容到指定路徑
cd $TEGRA_AGX_KERNEL_OUT
cp arch/arm64/boot/Image /home/fuhua/JetsonAGXKernel/Linux_for_Tegra/kernel/Image
cp arch/arm64/boot/dts/* /home/fuhua/JetsonAGXKernel/Linux_for_Tegra/kernel/dtb/
在output路徑下執(zhí)行
sudo make ARCH=arm64 modules_install INSTALL_MOD_PATH=$TOP_PATH/rootfs/
燒錄
cd /home/fuhua/JetsonAGXKernel/Linux_for_Tegra
1 關(guān)閉agx 所有電源
2 接好3個(gè)按鍵旁邊的typeC口到PC
3 接上電源
4 按下中間的Recovery按鍵不放
5 按一下電源按鍵摸航,燈亮
6 等待5秒中制跟,放開(kāi)中間的Recovery按鍵
7 查看是否進(jìn)入強(qiáng)制恢復(fù)模式
lsusb
顯示為nvidia corp設(shè)備即可,顯示為L(zhǎng)4T是正常連接酱虎,沒(méi)有進(jìn)入恢復(fù)模式
8 在pc上執(zhí)行
sudo ./flash.sh jetson-agx-xavier-devkit mmcblk0p1