Thank you for the help! I managed to get it working over the weekend. I didn’t manage to make my sata ssd available as a boot option but I used the usb drive to boot then mount the rootfs to the sata ssd so everything runs from there.
Here are the steps I done:
get the standard kernel configuration from a vanilla jetson linux install.
-
install the jetson linux normally following the Quick Start guide
-
Once the vanilla install is up and running get the current kernel config
cp /proc/config.gz .
gunzip config.gz
- get the standard kernel configuration to your host pc ( if you’re cross compiling)
cp config $KERNEL_OUT/.config
Cross compile on host pc
-
get the kernel sources and toolchain from Kernel Customization
-
export environment variables modify these according to your setup
export CROSS_COMPILE=$HOME/jetpack/l4t-gcc/bin/aarch64-buildroot-linux-gnu-
export KERNEL_SRC=$HOME/jetpack/Linux_for_Tegra/source/public/kernel/kernel-5.10
export KERNEL_OUT=$HOME/jetpack/kernel_out/images
export KERNEL_MODULES_OUT=$HOME/jetpack/kernel_out/modules
mkdir -p $KERNEL_OUT
mkdir -p $KERNEL_MODULES_OUT
- Modify what drivers should be build into the kernel Edit the kernel configuration copied earlier by placing the .config in $KERNEL_OUT
cd $KERNEL_SRC
make -C $KERNEL_SRC ARCH=arm64 O=$KERNEL_OUT menuconfig
For my case I wanted to build the driver for my ASMedia Technology Inc. ASM1061 SATA IDE Controller
Looking online, I found I need these 2 configs to be set in the .config
file
CONFIG_ATA=y
CONFIG_SATA_AHCI=y
I modified the items in menuconfig
to have these 2 options in my .config
file
- build the kernel
make ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=$CROSS_COMPILE -j{nproc} Image
make ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=$CROSS_COMPILE -j{nproc} modules
make ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=$CROSS_COMPILE -j{nproc} dtbs
-
copy the files to the locations in steps 5-7 here Build the kernel copy them to the sample rootfs and BSP downloaded here
-
apply the binaries
cd Linux_for_Tegra && sudo ./apply_binaries.sh
- create default user
sudo ./tools/l4t_create_default_user.sh -u myuser -p mypassword --accept-license
Flash the sata ssd first
- plug in a USB drive then flash it using initrd flash
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device sda1 \
-c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internal
- take out the USB and plug in the sata ssd then flash it
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device sda1 \
-c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internal
this time it won’t boot because the UEFI can’t use the ASMedia Technology Inc. ASM1061 SATA IDE Controller
on my board.
- plug in the USB then reboot and it works