From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=66.187.233.73; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 719D82228352A for ; Sat, 10 Mar 2018 17:43:18 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B0918182D1E; Sun, 11 Mar 2018 01:49:36 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-240.rdu2.redhat.com [10.10.120.240]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B186202322A; Sun, 11 Mar 2018 01:49:31 +0000 (UTC) From: Laszlo Ersek To: edk2-devel-01 Cc: Anthony Perard , Ard Biesheuvel , Brijesh Singh , Jordan Justen , Julien Grall , Phil Dennis-Jordan Date: Sun, 11 Mar 2018 02:48:41 +0100 Message-Id: <20180311014926.3049-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sun, 11 Mar 2018 01:49:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Sun, 11 Mar 2018 01:49:36 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lersek@redhat.com' RCPT:'' Subject: [PATCH 00/45] ArmVirtPkg, OvmfPkg: list module-internal headers in INF files X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 01:43:19 -0000 Repo: https://github.com/lersek/edk2.git Branch: hdr_inf_cleanup In , Mike explained why it's a good idea to list module-internal *.h files in the [Sources*] sections of the INF files: On 11/23/15 21:28, Kinney, Michael D wrote: > There are 2 reasons to list all source files used in a module build in > the [Sources] section. > > 1) Support incremental builds. If a change to the .h file is made, > then the module may not be rebuilt if the .h file is not listed in > [Sources] > 2) Support of UEFI Distribution Package distribution format. The UPT > tools that creates UDP packages uses the [Sources] section for the > inventory of files. If a file is missing, then it will not be > included in the UDP file. In only two years and three-four months, I've finally come around addressing (1) under ArmVirtPkg and OvmfPkg. The affected *.inf and *.h files were located with the following crude script: > #!/bin/bash > > export LC_ALL=C > > find ArmVirtPkg/ OvmfPkg/ -type f -name '*.inf' \ > | sort \ > | while read INF; do > INF_D=$(dirname -- "$INF") > INF_F=$(basename -- "$INF") > ( > cd "$INF_D" > find -type f -name '*.h' \ > | cut -c 3- \ > | sort \ > | while read REL_H; do > if ! grep -q -F -e " $REL_H" -- "$INF_F"; then > printf '%s: %s\n' "$INF" "$REL_H" > fi > done > ) > done This patch set brings the output down to nil, from the following 45 lines (note that the patch count equaling 45 is a coincidence): > ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf: PlatformBm.h > ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf: PrePi.h > OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf: AcpiPlatform.h > OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf: QemuLoader.h > OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf: AcpiPlatform.h > OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf: QemuLoader.h > OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf: BlockIo.h > OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf: CsmSupportLib.h > OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf: LegacyInterrupt.h > OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf: LegacyPlatform.h > OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf: LegacyRegion.h > OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf: Fvb.h > OvmfPkg/IoMmuDxe/IoMmuDxe.inf: AmdSevIoMmu.h > OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf: AcpiTimerLib.h > OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf: AcpiTimerLib.h > OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf: AcpiTimerLib.h > OvmfPkg/Library/BaseMemEncryptSevLib/BaseMemEncryptSevLib.inf: X64/VirtualMemory.h > OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf: LoadLinuxLib.h > OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf: LockBoxLib.h > OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf: LockBoxLib.h > OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.inf: NvVarsFileLib.h > OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf: DebugLibDetect.h > OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf: DebugLibDetect.h > OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf: ExtraRootBusMap.h > OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf: SerializeVariablesLib.h > OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf: VirtioMmioDevice.h > OvmfPkg/PlatformDxe/Platform.inf: Platform.h > OvmfPkg/PlatformDxe/Platform.inf: PlatformConfig.h > OvmfPkg/PlatformPei/PlatformPei.inf: Cmos.h > OvmfPkg/PlatformPei/PlatformPei.inf: Platform.h > OvmfPkg/PlatformPei/PlatformPei.inf: Xen.h > OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf: FwBlockService.h > OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf: QemuFlash.h > OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf: FwBlockService.h > OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf: QemuFlash.h > OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf: Qemu.h > OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf: UnalignedIoInternal.h > OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf: VbeShim.h > OvmfPkg/Virtio10Dxe/Virtio10.inf: Virtio10.h > OvmfPkg/VirtioBlkDxe/VirtioBlk.inf: VirtioBlk.h > OvmfPkg/VirtioNetDxe/VirtioNet.inf: VirtioNet.h > OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf: VirtioPciDevice.h > OvmfPkg/VirtioRngDxe/VirtioRng.inf: VirtioRng.h > OvmfPkg/VirtioScsiDxe/VirtioScsi.inf: VirtioScsi.h > OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf: DriverBinding.h In the future, we shall ask for patches to be respun unless they (a) keep the [Sources*] sections sorted and (b) list any new module-internal header files there. Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Brijesh Singh Cc: Jordan Justen Cc: Julien Grall Cc: Phil Dennis-Jordan Thanks, Laszlo Laszlo Ersek (45): ArmVirtPkg/PlatformBootManagerLib: list "PlatformBm.h" in INF file ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: sort [Sources*] sections in INF ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: list "PrePi.h" in INF file OvmfPkg/AcpiPlatformDxe: sort [Sources*] sections in the INF files OvmfPkg/AcpiPlatformDxe: list "AcpiPlatform.h" in the INF files OvmfPkg/AcpiPlatformDxe: don't #include "QemuLoader.h" in "Qemu.c" OvmfPkg/AcpiPlatformDxe: list "QemuLoader.h" in the INF files OvmfPkg/BlockMmioToBlockIoDxe: list "BlockIo.h" in the INF file OvmfPkg/CsmSupportLib: sort [Sources*] sections in the INF file OvmfPkg/CsmSupportLib: list "CsmSupportLib.h" in the INF file OvmfPkg/CsmSupportLib: list "LegacyInterrupt.h" in the INF file OvmfPkg/CsmSupportLib: list "LegacyPlatform.h" in the INF file OvmfPkg/CsmSupportLib: list "LegacyRegion.h" in the INF file OvmfPkg/EmuVariableFvbRuntimeDxe: list "Fvb.h" in the INF file OvmfPkg/IoMmuDxe: list "AmdSevIoMmu.h" in the INF file OvmfPkg/AcpiTimerLib: list "AcpiTimerLib.h" in the INF files OvmfPkg/BaseMemEncryptSevLib: list "X64/VirtualMemory.h" in the INF file OvmfPkg/LoadLinuxLib: list "LoadLinuxLib.h" in the INF file OvmfPkg/LockBoxLib: list "LockBoxLib.h" in the INF files OvmfPkg/NvVarsFileLib: list "NvVarsFileLib.h" in the INF file OvmfPkg/PlatformDebugLibIoPort: list "DebugLibDetect.h" in the INF files OvmfPkg/QemuBootOrderLib: sort [Sources*] sections in the INF file OvmfPkg/QemuBootOrderLib: list "ExtraRootBusMap.h" in the INF file OvmfPkg/SerializeVariablesLib: list "SerializeVariablesLib.h" in INF file OvmfPkg/VirtioMmioDeviceLib: list "VirtioMmioDevice.h" in the INF file OvmfPkg/VirtioMmioDeviceLib: improve style of mMmioDeviceProtocolTemplate OvmfPkg/PlatformDxe: list "Platform.h" in the INF file OvmfPkg/PlatformDxe: list "PlatformConfig.h" in the INF file OvmfPkg/PlatformPei: list "Cmos.h" in the INF file OvmfPkg/PlatformPei: list "Platform.h" in the INF file OvmfPkg/PlatformPei: list "Xen.h" in the INF file OvmfPkg/QemuFlashFvbServicesRuntimeDxe: list "FwBlockService.h" in INFs OvmfPkg/QemuFlashFvbServicesRuntimeDxe: list "QemuFlash.h" in INF files OvmfPkg/QemuVideoDxe: sort [Sources*] sections in the INF file OvmfPkg/QemuVideoDxe: list "Qemu.h" in the INF file OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the INF file OvmfPkg/QemuVideoDxe: list "VbeShim.h" in the INF file OvmfPkg/Virtio10Dxe: list "Virtio10.h" in the INF file OvmfPkg/VirtioBlkDxe: list "VirtioBlk.h" in the INF file OvmfPkg/VirtioNetDxe: list "VirtioNet.h" in the INF file OvmfPkg/VirtioPciDeviceDxe: list "VirtioPciDevice.h" in the INF file OvmfPkg/VirtioRngDxe: list "VirtioRng.h" in the INF file OvmfPkg/VirtioScsiDxe: list "VirtioScsi.h" in the INF file OvmfPkg/XenPvBlkDxe: sort [Sources*] sections in the INF file OvmfPkg/XenPvBlkDxe: list "DriverBinding.h" in the INF file ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 1 + ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 3 ++- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 8 +++++--- OvmfPkg/AcpiPlatformDxe/Qemu.c | 1 - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf | 8 +++++--- OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf | 1 + OvmfPkg/Csm/CsmSupportLib/CsmSupportLib.inf | 6 +++++- OvmfPkg/EmuVariableFvbRuntimeDxe/Fvb.inf | 1 + OvmfPkg/IoMmuDxe/IoMmuDxe.inf | 1 + OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf | 1 + OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf | 1 + OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf | 1 + OvmfPkg/Library/BaseMemEncryptSevLib/BaseMemEncryptSevLib.inf | 1 + OvmfPkg/Library/LoadLinuxLib/LoadLinuxLib.inf | 1 + OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf | 1 + OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf | 1 + OvmfPkg/Library/NvVarsFileLib/NvVarsFileLib.inf | 1 + OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf | 1 + OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf | 1 + OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf | 3 ++- OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf | 1 + OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c | 2 +- OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf | 1 + OvmfPkg/PlatformDxe/Platform.inf | 2 ++ OvmfPkg/PlatformPei/PlatformPei.inf | 3 +++ OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf | 2 ++ OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf | 2 ++ OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf | 7 +++++-- OvmfPkg/Virtio10Dxe/Virtio10.inf | 1 + OvmfPkg/VirtioBlkDxe/VirtioBlk.inf | 1 + OvmfPkg/VirtioNetDxe/VirtioNet.inf | 1 + OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf | 1 + OvmfPkg/VirtioRngDxe/VirtioRng.inf | 1 + OvmfPkg/VirtioScsiDxe/VirtioScsi.inf | 1 + OvmfPkg/XenPvBlkDxe/XenPvBlkDxe.inf | 9 +++++---- 35 files changed, 61 insertions(+), 17 deletions(-) -- 2.14.1.3.gb7cf6e02401b