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:
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.
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:
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:
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.
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.
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:
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
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)
Hello, we were able to solve the problem using a native method and by disabling configfs. However, I still don’t understand why the flashing method isn’t working. No matter what we try, it keeps showing “waiting for bootup!”
I think you missed a step when updating the defconfig. After you have made changes to the .config file (e.g. through menuconfig etc.) you should do this:
make ARCH=arm64 savedefconfig
cp defconfig arch/arm64/configs/defconfig
Then when you run the kernel build and install scripts it will configure the kernel using your updated configuration. Once you have have built and installed the kernel, make sure you update the initrd image as well.
Thank you for your guidance. I followed your steps, but unfortunately, I’m still encountering the same boot issue. Here’s a detailed breakdown of what I did:
Downloaded and Set Up BSP, Rootfs, and Source Code:
Re-downloaded the BSP package, sample root filesystem, and source code.
Extracted public_sources.tbz2 within the Linux_for_Tegra directory, as per the Kernel Customization Guide.
Commands for extraction:
cd WORKSPACE/
tar xvf Jetson_Linux_R36.3.0_aarch64.tbz2
sudo tar xvpf Tegra_Linux_Sample-Root-Filesystem_R36.3.0_aarch64.tbz2 -C Linux_for_Tegra/rootfs/
cd Linux_for_Tegra/
sudo ./tools/l4t_flash_prerequisites.sh
sudo ./apply_binaries.sh
cd ..
tar xvf public_sources.tbz2 -C Linux_for_Tegra/..
cd Linux_for_Tegra/source
tar xvf kernel_src.tbz2
tar xvf nvidia_kernel_display_driver_source.tbz2
tar xvf kernel_oot_modules_src.tbz2
Kernel Configuration:
Navigated to kernel/kernel-jammy-src/.
Ran the following commands to configure:
make ARCH=arm64 defconfig
make ARCH=arm64 menuconfig # Disabled configfs, enabled gadgetfs
make ARCH=arm64 savedefconfig
cp defconfig arch/arm64/configs/defconfig
Cross Compilation Setup and Kernel Build:
Set up the cross-compilation environment and initiated the build:
export CROSS_COMPILE=~/Downloads/aarch64--glibc--stable-2022.08-1/bin/aarch64-buildroot-linux-gnu-
make -C kernel
Kernel compiled without errors, as shown in the output snippet provided.
Module Installation and Image Copy:
Set INSTALL_MOD_PATH and ran installation commands, then copied the kernel image:
You missed a crucial step. You need to regenerate the initrd image.
sudo ./tools/l4t_update_initrd.sh
If you have enabled any new modules that are needed prior to mounting the complete rootfs, then you will need to add those modules to the initrd by adding a line in rootfs/etc/nv-update-initrd/modules prior to running the update script.