Grub2 on top of U-boot on TX2

Hello,

I am trying to build a grub2 image which will be loaded through pxe on TX2 on top of the u-boot running on it.

Since grub2’s current open source code supports u-boot only on ARM (not ARM64), I was wondering if anyone has tried to load an ARM(32-bit) grub2 image on TX2 with/without U-boot. Preferably, I would like to load it on top on U-boot as a second chain of bootloader.

Currently, my setup is such that my boot script expects a grub2 command prompt in order to proceed further and hence I am interested in running grub2 image on TX2.

If I try to load generated grub2 image on U-boot of TX2, I get below error:

Tegra186 (P2771-0000-500) # tftpboot $loadaddr $serverip:grub/arm-uboot/core.img
ethernet@2490000 Waiting for PHY auto negotiation to complete… done
Using ethernet@2490000 device
TFTP from server 10.134.30.138; our IP address is 10.134.30.6
Filename ‘grub/arm-uboot/core.img’.
Load address: 0x80080000
Loading: ######
         3.4 MiB/s
done
Bytes transferred = 74676 (123b4 hex)
Tegra186 (P2771-0000-500) # bootm $loadaddr

Booting kernel from Legacy Image at 80080000 …

Image Name:   
   Image Type:   ARM Linux Kernel Image (no loading done) (uncompressed)
   Data Size:    74612 Bytes = 72.9 KiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum … OK
Unsupported Architecture 0x2
ERROR: can’t get kernel image!

which is expected, I guess because U-boot might be expecting an ARM64 image.

Please let me know if grub2 ARM image can be loaded on TX2 U-boot or if there’s an alternative source code or any other input. Greatly appreciate it.

GRUB requires a standard BIOS or UEFI. Embedded systems do not have this…there is zero possibility of using GRUB on a Jetson (even with lots of work).

Thanks for the reply, linxudev.

I am hoping that someone either from grub2-devel community or independent would take up the work to port u-boot support for ARM64 since it already is available for ARM. Since Jetson is one of the most popular ARM64 boards it would be worth the effort to do that.

Let’s see :)

Perhaps better knowledge of what you are actually trying to accomplish would help. If you ignore the use of GRUB, what exactly is the end result you want?

Hi linuxdev,

We currently have an infrastructure to run nightly tests on systems (x86_64 and arm64). The automated test startup script expects an grub2 prompt in order to proceed.

So, in order to get TX2 to run nightly tests with minimal changes to test startup script, I was looking for a grub2 image on top of u-boot on arm64 system. I had hoped to find it since arm 32-bit is supported and assumed that many would switch over to arm64 embedded boards.

For now I have gotten around the test script modifying it to not expect grub2 prompt. So, a workaround is implemented. But I will keep an eye out there for this.

Thank you for replying to the post and showing interest. Appreciate it.

If your app uses a pipe perhaps something like “gawk” would be able to rewrite the pipe for compatibility. In comparison to adjusting a script for U-Boot messages instead of GRUB messages an actual modification of the Jetson to use GRUB would be extreme. By what method does your test talk to the booting system?

I agree to that. But the functionality of the test is much more. Test startup is just one of its many functionalities.

I have modified the script to workaround this and I am good to go.