]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[efi] Use zero for PCI vendor/device IDs when no applicable ID exists
authorMichael Brown <mcb30@ipxe.org>
Mon, 26 Jul 2021 14:42:00 +0000 (15:42 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 26 Jul 2021 14:47:47 +0000 (15:47 +0100)
When building an EFI ROM image for which no PCI vendor/device ID is
applicable (e.g. bin-x86_64-efi/ipxe.efirom), the build process will
currently construct a command such as

  ./util/efirom -v -d -c bin-x86_64-efi/ipxe.efidrv \
                         bin-x86_64-efi/ipxe.efirom

which gets interpreted as a vendor ID of "-0xd" (i.e. 0xfff3, after
truncation to 16 bits).

Fix by using an explicit zero ID when no applicable ID exists, as is
already done when constructing BIOS ROM images.

Reported-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/Makefile.efi

index 11e29dd5861288d10ff4cea99c1cde6440c54308..bd479b3da65919617212ece2b3325293c194f2e5 100644 (file)
@@ -43,7 +43,8 @@ $(BIN)/%.drv.efi : $(BIN)/%.efidrv
 
 $(BIN)/%.efirom : $(BIN)/%.efidrv $(EFIROM)
        $(QM)$(ECHO) "  [FINISH] $@"
-       $(Q)$(EFIROM) -v $(TGT_PCI_VENDOR) -d $(TGT_PCI_DEVICE) -c $< $@
+       $(Q)$(EFIROM) -v $(firstword $(TGT_PCI_VENDOR) 0) \
+                     -d $(firstword $(TGT_PCI_DEVICE) 0) -c $< $@
 
 $(BIN)/efidrv.cab : $(BIN)/alldrv.efis # $(ALL_drv.efi) is not yet defined
        $(QM)$(ECHO) "  [CAB] $@"