Proper way for building kernel in jetpack6 and jetson linux 36.3 for gadgetfs

Hello everyone,

I followed the Kernel customization guide to build a custom kernel with GadgetFS enabled in Menuconfig. Although I successfully built the kernel, I noticed that the changes I made are not reflected in the .config files. Below are the build logs:

Could anyone suggest how to enable GadgetFS properly or what steps to take after enabling it in Menuconfig? Thank you!

Hi,
Do you use Orin Nano or Jetson Nano? The topic is created in Jetson Nano category.

sorry my bad its for orin nano

Hi,
Please try this:
Building the kernel from kernel source jetpack 6 , jetson orin nx 16GB - #5 by DaneLLL

The default path needs root permission, so yo may not build it with correct toolchain. May try to create another non-root-permission path to build it, and then copy to Linux_for_Tegra folder. And please build nvidia-oot along with upstream kernel.

Hello, thanks for the reply!

I’m fairly new to this, so I hope I don’t say anything wrong. Are you suggesting that I should extract the BSP source code to a directory where I don’t need root permissions? Or do I need to move my cross-compiler, which I currently have located at:

/home/sreeja/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-

to a non-root directory instead?

Hi,
Please extract the source code to non-root directory.

Hello @DaneLLL

I have attempted the first procedure you suggested, running it with sudo, but unfortunately, it did not resolve the issue, as I am still seeing the default settings in the configuration file. I will now try your other suggestion of placing the build in a non-root directory and building it there.

In the meantime, I have a few questions:

  1. After building the kernel with custom menuconfig settings, is it necessary to flash the entire system, or is there an alternative way to avoid reflashing? In the future, if we need to enable additional options in menuconfig, reflashing might become a cumbersome process, especially considering the built environment would already be configured.

  2. If reflashing is the only option, are there any additional steps beyond what’s mentioned in the documentation that we should be aware of when building and flashing the kernel?

I believe these questions would be helpful for beginners like myself.

Hi,
It is supposed to take effect by overwriting kernel image. Since you mention it doesn’t take effect, we suggest re-flash the whole system for a try.

There are some kernel-customization use-cases in

Jetson/L4T/r36.3.x patches - eLinux.org

You may try these as validation. The steps in developer guide is well tested. It should work fine if you follow the instructions one by one.

Hello! As you suggested, I extracted the source code in the Downloads directory, specifically in the kernel_src folder, using the command:

tar xf kernel_src.tbz2

After that, I navigated to the source directory and ran:

./generic_rt_build.sh "enable"

Next, I entered the kernel_jammy_source directory and executed the make menuconfig command. I enabled gadgetfs as built-in and saved it to the .config file. Then, I returned to the source directory and set the CROSS_COMPILE environment variable as follows:

export CROSS_COMPILE=~/l4t-gcc/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-

Following that, I ran:

make -C kernel

However, after building the kernel, I checked the .config file again and found that GADGETFS is not set.

image

below is .config before building
image

Hi,
Please modify defconfig to enable the kernel configs.

Hi,
As you suggested, I navigated to the ‘kernel_jammy_source’ directory and ran the ‘make defconfig’ command. After that, I enabled ‘gadgetfs’ in the ‘menuconfig’ and saved the changes to the ‘.config’ file.
Next, I executed the ‘savedefconfig’ command. I then built the kernel using the command: ‘make -j$(nproc)’.
After building, I replaced the kernel image in the ‘boot’ directory of the Orin Nano. However, upon rebooting the device, it did not reflect the updated configurations

Hello @DaneLLL

we have tried another approach as stated in this Topic have implemented all commnads except we put

LOCALVERSION=-tegra

when we tried to flash using below command

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
  -c tools/kernel_flash/flash_l4t_t234_nvme.xml -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" \
  --showlogs --network usb0 jetson-orin-nano-devkit internal

we are getting stucked at below point

as suggested in terminal we retrived Serial logs
seriallogs.txt (134.4 KB)

Hi,
Probably the config is deprecated in K5.15. Are you able to enable other configs for a try?

Hi,
I just wanted to confirm my understanding. Are you saying that the GadgetFS config could have been deprecated in K5.15? and if that is the case why is the option available in the menuconfig?

Hi,
Yes, we suspect the config may b deprecated. Other customizations in the elinux page work by following the developer guide. A bit strange this config does not work as expected.

Hi,
After booting the kernel image with default configuration, we enabled gadgetfs and rebuilt the kernel. The device booted up with new custom kernel image and gadgetfs has been installed as a module and then loaded it to the kernel using modprobe, As you can see in the images below. however we were unable to mount it. could you please suggest me how to mount gadgetfs?
I am using jetson orin nano(jetpack 6)




Unable to mount gadgetfs - Developer Tools / Nsight Compute - NVIDIA Developer Forums