
-----Original Message----- From: Trent Piepho tpiepho@impinj.com Sent: Tuesday, July 17, 2018 10:24 AM To: Henry Beberman Henry.Beberman@microsoft.com; u- boot@lists.denx.de Cc: trini@konsulko.com; fabio.estevam@nxp.com Subject: Re: [U-Boot] [PATCH 01/11] imx: Add bootcmd to load and run UEFI from mmc
On Mon, 2018-07-16 at 23:56 +0000, Henry Beberman wrote:
I need to revise the commit message for this patch. The script is not fixed
to the first partition of the selected MMC, it scans the disk for partitions marked bootable, then checks each one of those until it finds the imxboard_efi.fd binary.
That is indeed very different from first FAT partition. Does bootable only apply legacy MBR partition tables? I didn't think bootable was typically used with GPT tables. There is a bit, but it's not
used to mark EFI partitions.
Which brings me back to the partition type. Isn't that the right way to find the EFI?
The is_bootable function in disk/part_efi.c marks a partition as bootable if
the partition_type_guid on disk matches the EFI PARTITION_SYSTEM_GUID.
The part command with the -bootable flag will return the EFI partition on both GPT and MBR partition schemes. This method is also used by config_distro_bootcmd.h
But it also finds any partitions with the legacy bios bootable flag set in a GPT table or the active partition bit set in a MBR table, or any future reason a partition might be considered bootable. Someone trying to add a new type of bootable partition to distro bootcmd will be forced to deal with your windows nt boot command as it tries to boot any bootable partition, even ones it can't boot.
The distro boot command is designed to boot anything, so it searches for partitions beyond EFI. But what you've done is just for EFI. That's why it's different.
It doesn’t matter if someone adds a new type of bootable partition in the future, the UEFI boot command will fail to find the imxboard_efi.fd binary then move along to check the next bootable partition.
Adding this boot command will not increase maintenance on config_distro_bootcmd.h. The UEFI boot command is only used when the defconfig selects CONFIG_UEFI_BOOT, and the board's include/configs header has been modified to include config_uefi_bootcmd.h instead of config_distro_bootcmd.h when the config is set.