Yes, I just modify the /etc/grub.d/40_custom as follows:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'Jetson Linux' {
echo "Booting Jetson Linux..."
linux /boot/Image root=PARTUUID=${ACTIVE_ROOTFS_PARTUUID} rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0 bl_prof_dataptr=2031616@0x171E10000 bl_prof_ro_ptr=65536@0x171E00000
initrd /boot/initrd
}
menuentry "System restart" {
echo "System rebooting..."
reboot
}
And then using commands to apply:
sudo su -c "grub-mkconfig > /boot/grub/grub.cfg"
sudo su -c "update-grub"
After that, it can be work(because it use the default UEFI dtb, not mine dtb).
But if I modify /etc/grub.d/40_custom as follows:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'Jetson Linux' {
echo "Booting Jetson Linux..."
linux /boot/Image root=PARTUUID=${ACTIVE_ROOTFS_PARTUUID} rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nospectre_bhb video=efifb:off console=tty0 bl_prof_dataptr=2031616@0x171E10000 bl_prof_ro_ptr=65536@0x171E00000
initrd /boot/initrd
devicetree /boot/dtb/kernel_tegra234-p3768-0000+p3767-0004-nv.dtb
}
menuentry "System restart" {
echo "System rebooting..."
reboot
}
it can not start normally, and the error shown in the figure above occurred.
Note: The /boot/dtb/kernel_tegra234-p3768-0000+p3767-0004-nv.dtb file exists in the root file system and uses the same device tree file as the native file.
So I’m wondering how can I make it work properly if I use my own dtb?
But I use grub instead of l4tlauncher, do I need to add FDT entries in extlinux.conf? Do I also need to add devicetree entries in the grub configuration file?
I refer this topic to set up my GRUB configuration file, but when I added the device tree entry, the system failed to boot. If I removed the device tree, it could boot normally.
@WayneWWW@DavidDDD Could you please help me find out why the devicetree configuration in grub cannot start normally? The device tree is /boot/dtb/kernel_tegra234-p3768-0000+p3767-0004-nv.dtb
Processing "Tegra234 p3768-0000+p3767-xxxx Dynamic Overlay" DTB overlay
Failed to apply device tree overlay. Error Code = -3
UpdatePcieControllersWithGpuDevice: failed to enumerate GPU device handles: Not Found
LocateChildGopHandle: failed to enumerate graphics output device handles: Not Found
fdt_check_header: Entry. FDT address: 258140000
fdt_check_header: Checking magic... Magic: 0xFFFFFFFF
fdt_check_header: Entry. FDT address: 258140000
fdt_check_header: Checking magic... Magic: 0xFFFFFFFF
EFI stub: Booting Linux Kernel...
EFI stub: ERROR: Invalid header detected on UEFI supplied FDT, ignoring ...
EFI stub: Generating empty DTB
EFI stub: Exiting boot services...
Link didn't transition to L2 state
Link didn't go to detect state as well
PROGRESS CODE: V03101019 I0 D6A2CB7F-6A18-4E2F-B43B-9920A733700A
From above log, it seems it has been passed to kernel.
[ 0.000000] Unknown kernel command line parameters "BOOT_IMAGE=/boot/Image mminit_loglevel=4 bl_prof_dataptr=2031616@0x171E10000 bl_prof_ro_ptr=65536@0x171E00000 devicetree=/boot/dtb/kernel_tegra234-p3768-0000+p3767-0004-nv.dtb", will be passed to user space.
But the kernel image can not recognize this devicetree option so that it skip to load the dtb.
I can reproduce the similar issue as yours.
I’ve also used debug UEFI binary to debug further.
fdt_check_header: Entry. FDT address: 258140000
fdt_check_header: Checking magic... Magic: 0xFFFFFFFF
fdt_check_header: Entry. FDT address: 258140000
fdt_check_header: Checking magic... Magic: 0xFFFFFFFF
EFI stub: Booting Linux Kernel...
EFI stub: ERROR: Invalid header detected on UEFI supplied FDT, ignoring ...
EFI stub: Generating empty DTB
EFI stub: Exiting boot services...
Link didn't transition to L2 state
Link didn't go to detect state as well
PROGRESS CODE: V03101019 I0 D6A2CB7F-6A18-4E2F-B43B-9920A733700A
The magic number is not expected, which may be caused from the compatibility issue for using grub on Jetson. If you want to load dtb from rootfs, we would suggest using L4TLauncher with FDT, OVERLAYS specified in extlinux.conf.