]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Install our own disk I/O protocol and claim exclusive use of it
authorMichael Brown <mcb30@ipxe.org>
Mon, 14 Jul 2014 15:15:05 +0000 (16:15 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 14 Jul 2014 15:30:19 +0000 (16:30 +0100)
commit8a380987c16b5b7269ed98efa8d8055c01638047
treeec249e5fdbc5d71dde479fa4795df279bff94175
parentcff0103bd2a55cadff2a9aed6e3f8024baab368c
[efi] Install our own disk I/O protocol and claim exclusive use of it

The EFI FAT filesystem driver has a bug: if a block device contains no
FAT filesystem but does have an EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
instance, the FAT driver will assume that it must have previously
installed the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL.  This causes the FAT
driver to claim control of our device, and to refuse to stop driving
it, which prevents us from later uninstalling correctly.

Work around this bug by opening the disk I/O protocol ourselves,
thereby preventing the FAT driver from opening it.

Note that the alternative approach of opening the block I/O protocol
(and thereby in theory preventing DiskIo from attaching to the block
I/O protocol) causes an endless loop of calls to our DRIVER_STOP
method when starting the EFI shell.  I have no idea why this is.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/efi/Protocol/DiskIo.h [new file with mode: 0644]
src/interface/efi/efi_file.c