how to build kernel source

Refer to the article[url]https://developer.ridgerun.com/wiki/index.php?title=Xavier/JetPack_4.1/Compiling_Code/Kernel[/url],building the kernel frome source.but after type command “sudo ./apply_binaries.sh”,show an error.
External Media

Looks like the image attached has some error. Could you try to paste it again?

[url]https://sunzhongmeng.github.io/resource/error.png[/url]

External Media

the reference article:[url]https://developer.ridgerun.com/wiki/index.php?title=Xavier/JetPack_4.1/Compiling_Code/Kernel[/url]

Could you confirm if “Linux_for_Tegra/rootfs” is a existing path? If you are using Jetpack, this file(passwd) should exist.

FYI, the sample rootfs unpacks there first (JetPack would have done this), and the the apply_binaries.sh should only add files without caring what is already there. On the other hand, if you ran out of disk space, perhaps something odd like that might occur.

From your “Linux_for_Tegra/rootfs/” subdirectory, what do you see with:

df -H -T .

after"df -H-T.",look like below
External Media

unpack the “Jetson_Linux_R31.1.0_aarch64.tbz2"get folder"Linux_for_Tegra”,but in folder “rootfs"just three files"README.txt”,“roup” and a folder named"lib"
External Media

Hi sunzhongmeng,

I think you forget to tar the “Tegra_Linux_Sample-Root-Filesystem_R31.1.0_aarch64.tbz2” file.
Please reference below steps:

Download Jetson_Linux_R31.1.0_aarch64.tbz2 and Tegra_Linux_Sample-Root-Filesystem_R31.1.0_aarch64.tbz2
$ tar xpvf Jetson_Linux_R31.1.0_aarch64.tbz2
$ tar xpvf Tegra_Linux_Sample-Root-Filesystem_R31.1.0_aarch64.tbz2 -C Linux_for_Tegra/rootfs/
$ cd Linux_for_Tegra/
$ sudo ./apply_binaries.sh

If you already install/flash your board with Jetpack once, rootfs should not be empty.
I guess you only followed the guide from “NVIDIA Xavier - Kernel” w/o running jetpack, didn’t you?

Also, you only have 25GB of free space…and you haven’t even unpacked the sample rootfs. Once that is unpacked (after which apply_binaries.sh should work), then actual flash will exceed the capacity of your file system.

The content of “rootfs/” is used to populate a file which is an exact match to the root partition of the Xavier. That file, all by itself, is close to 30GB. Then a “sparse” version is generated, and that is several gigabytes on top of that. There are a number of smaller file copies made which are not particularly significant, but flash will happily continue without telling you that you’ve run out of hard disk space. The flash will work, but boot will fail (depending on what truncated you may get to different stages of boot). If I were to do this I’d want about 40GB free.

thanks,The problem has been resolved.

Note that this step is technically incorrect:

tar xpvf Tegra_Linux_Sample-Root-Filesystem_R31.1.0_aarch64.tbz2 -C Linux_for_Tegra/rootfs/

The reason is that this also requires root permissions. So to be correct add “sudo”:

<b>sudo</b> tar xpvf Tegra_Linux_Sample-Root-Filesystem_R31.1.0_aarch64.tbz2 -C Linux_for_Tegra/rootfs/

Yes,it also requires root permission!