From a3fb45d38eb57cb6a582dd4f6ac3dd96d334854e Mon Sep 17 00:00:00 2001 From: Joachim Henze Date: Mon, 17 Jun 2024 22:59:49 +0200 Subject: [PATCH] [0.4.11] Backport: more flexibility for placing inf files Main goal of this backport is to be able to place infs outside of media/inf and instead next to their (drivers) implementation. Specifically this ports back: 0.4.15-dev-8227-g 32d615fc10e183094f9e01e9cf8889a20b8aa28a [DD] Keep the network drivers infs 8.3 like on MS Windows (#7007) 0.4.15-dev-2763-g 6924b8ff3985224a2d094ce509e4b843f387ab32 [NE2000] Combine two INF files into one for ISA and PCI cards 0.4.15-dev-122-g f4e37f936347fef84ff2df4599892bc5ad14402d [CMAKE] Support file lists in add_cd_file for all cases. Addendum to 6b48d54 0.4.15-dev-121-g 6b48d54c393a7a38730235a609f5cfc0a8987893 [CMAKE] Fix driver inf files generation for livecd CORE-16975. Addendum to 019f21e partially 0.4.15-dev-52-g 019f21ee1d764dff8586acc847a299714e83977a [MEDIA][CMAKE] Create add_driver_inf cmake function *.inf files for drivers can now be placed along with the driver code Left out for now the moving of cdrom.inf, disk.inf, fdc.inf and usbstor.inf (because there are *_new for those due to the new storage stack) - I compiled that for testing with RosBE2.1.6 GCCwin4.7.2 dbg+rls, MSVC2010dbg+rls, and for all 4 configs I created bootcd, livecd, hybridcd and bootcdregtest on each release-branch. All of them succeeded and all files were placed where they belong within the isos. - I also tested installing with releases/0.4.14 bootcd onto a BTRFS partition, and then accessing that partition from a releases/0.4.7 livecd. Worked. --- drivers/bus/acpi/CMakeLists.txt | 1 + {media/inf => drivers/bus/acpi}/acpi.inf | 0 drivers/network/dd/ne2000/CMakeLists.txt | 1 + .../network/dd/ne2000/netne.inf | 31 +++-- drivers/network/dd/pcnet/CMakeLists.txt | 1 + .../network/dd/pcnet}/netamd.inf | 0 drivers/network/dd/rtl8139/CMakeLists.txt | 1 + .../network/dd/rtl8139}/netrtl.inf | 0 drivers/processor/processr/CMakeLists.txt | 1 + .../processor/processr}/cpu.inf | 0 drivers/wdm/audio/hdaudbus/CMakeLists.txt | 1 + .../wdm/audio/hdaudbus}/hdaudbus.inf | 0 media/inf/CMakeLists.txt | 23 +--- media/inf/netisa.inf | 111 ------------------ sdk/cmake/CMakeMacros.cmake | 29 ++++- .../drivers/miniport/xboxvmp/CMakeLists.txt | 1 + .../drivers/miniport/xboxvmp}/xboxdisp.inf | 0 17 files changed, 56 insertions(+), 145 deletions(-) rename {media/inf => drivers/bus/acpi}/acpi.inf (100%) rename media/inf/netrtpnt.inf => drivers/network/dd/ne2000/netne.inf (55%) rename {media/inf => drivers/network/dd/pcnet}/netamd.inf (100%) rename {media/inf => drivers/network/dd/rtl8139}/netrtl.inf (100%) rename {media/inf => drivers/processor/processr}/cpu.inf (100%) rename {media/inf => drivers/wdm/audio/hdaudbus}/hdaudbus.inf (100%) delete mode 100644 media/inf/netisa.inf rename {media/inf => win32ss/drivers/miniport/xboxvmp}/xboxdisp.inf (100%) diff --git a/drivers/bus/acpi/CMakeLists.txt b/drivers/bus/acpi/CMakeLists.txt index 0473748a4a3..2a7738a5ee4 100644 --- a/drivers/bus/acpi/CMakeLists.txt +++ b/drivers/bus/acpi/CMakeLists.txt @@ -203,6 +203,7 @@ target_link_libraries(acpi wdmguid acpica memcmp strtol ${PSEH_LIB}) add_importlibs(acpi ntoskrnl hal) add_pch(acpi precomp.h ACPI_SOURCE) add_cd_file(TARGET acpi DESTINATION reactos/system32/drivers NO_CAB FOR all) +add_driver_inf(acpi acpi.inf) add_subdirectory(cmbatt) add_subdirectory(compbatt) diff --git a/media/inf/acpi.inf b/drivers/bus/acpi/acpi.inf similarity index 100% rename from media/inf/acpi.inf rename to drivers/bus/acpi/acpi.inf diff --git a/drivers/network/dd/ne2000/CMakeLists.txt b/drivers/network/dd/ne2000/CMakeLists.txt index f11974f37c9..1abe818013d 100644 --- a/drivers/network/dd/ne2000/CMakeLists.txt +++ b/drivers/network/dd/ne2000/CMakeLists.txt @@ -11,3 +11,4 @@ add_pch(ne2000 include/ne2000.h SOURCE) set_module_type(ne2000 kernelmodedriver) add_importlibs(ne2000 ndis ntoskrnl hal) add_cd_file(TARGET ne2000 DESTINATION reactos/system32/drivers FOR all) +add_driver_inf(ne2000 netne.inf) diff --git a/media/inf/netrtpnt.inf b/drivers/network/dd/ne2000/netne.inf similarity index 55% rename from media/inf/netrtpnt.inf rename to drivers/network/dd/ne2000/netne.inf index b5f87bf4e44..37f5c82357f 100644 --- a/media/inf/netrtpnt.inf +++ b/drivers/network/dd/ne2000/netne.inf @@ -1,6 +1,6 @@ -; NETRTPNT.INF +; NETNE.INF -; Installation file for 8029 compatible netcards +; Installation file for NE2000-compatible network cards [Version] Signature = "$Windows NT$" @@ -9,20 +9,31 @@ LayoutFile = layout.inf Class = Net ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318} Provider = %ReactOS% -DriverVer = 02/15/2007,1.01 +DriverVer = 02/15/2007,1.02 [DestinationDirs] DefaultDestDir = 12 [Manufacturer] +%GenericMfg% = GenericMfg %RealtekMfg% = RealtekMfg +[GenericMfg] +%*PNP80D6.DeviceDesc% = NE2000_Inst_Isa.ndi,*PNP80D6 + [RealtekMfg] -%PCI\VEN_10EC&DEV_8029.DeviceDesc% = NE2000_Inst.ndi,PCI\VEN_10EC&DEV_8029 +%*RTL8019.DeviceDesc% = NE2000_Inst_Isa.ndi,*RTL8019 +%PCI\VEN_10EC&DEV_8029.DeviceDesc% = NE2000_Inst_Pci.ndi,PCI\VEN_10EC&DEV_8029 ;---------------------------- NE2000 DRIVER ----------------------------- -[NE2000_Inst.ndi.NT] +[NE2000_Inst_Isa.ndi.NT] +Characteristics = 0x4 ; NCF_PHYSICAL +BusType = 14 ; PNPIsaBus +AddReg = NE2000_AddReg.NT +CopyFiles = NE2000_CopyFiles.NT + +[NE2000_Inst_Pci.ndi.NT] Characteristics = 0x4 ; NCF_PHYSICAL BusType = 5 ; PCIBus AddReg = NE2000_AddReg.NT @@ -31,12 +42,14 @@ CopyFiles = NE2000_CopyFiles.NT [NE2000_AddReg.NT] HKR,,Port,0x00000000,"c100" HKR,,Irq,0x00000000,"B" -HKR,,NetworkAddress,0x00000000,"001122334455" [NE2000_CopyFiles.NT] ne2000.sys -[NE2000_Inst.ndi.NT.Services] +[NE2000_Inst_Isa.ndi.NT.Services] +AddService = ne2000, 0x00000002, ne2000_Service_Inst + +[NE2000_Inst_Pci.ndi.NT.Services] AddService = ne2000, 0x00000002, ne2000_Service_Inst [ne2000_Service_Inst] @@ -51,5 +64,5 @@ LoadOrderGroup = NDIS [Strings] ReactOS = "ReactOS Team" -RealtekMfg = "Realtek Semiconductor Co., Ltd." -PCI\VEN_10EC&DEV_8029.DeviceDesc = "RTL-8029(AS)" +GenericMfg = "(Generic network cards)" +*PNP80D6.DeviceDesc = "NE2000 compatible" diff --git a/drivers/network/dd/pcnet/CMakeLists.txt b/drivers/network/dd/pcnet/CMakeLists.txt index 0e78bf34e4a..4fd0c3f8a94 100644 --- a/drivers/network/dd/pcnet/CMakeLists.txt +++ b/drivers/network/dd/pcnet/CMakeLists.txt @@ -15,3 +15,4 @@ add_pch(pcnet pcnet.h SOURCE) set_module_type(pcnet kernelmodedriver) add_importlibs(pcnet ndis ntoskrnl hal) add_cd_file(TARGET pcnet DESTINATION reactos/system32/drivers FOR all) +add_driver_inf(pcnet netamd.inf) diff --git a/media/inf/netamd.inf b/drivers/network/dd/pcnet/netamd.inf similarity index 100% rename from media/inf/netamd.inf rename to drivers/network/dd/pcnet/netamd.inf diff --git a/drivers/network/dd/rtl8139/CMakeLists.txt b/drivers/network/dd/rtl8139/CMakeLists.txt index 9a6a975621d..d3e4ff50e56 100644 --- a/drivers/network/dd/rtl8139/CMakeLists.txt +++ b/drivers/network/dd/rtl8139/CMakeLists.txt @@ -16,3 +16,4 @@ add_pch(rtl8139 nic.h SOURCE) set_module_type(rtl8139 kernelmodedriver) add_importlibs(rtl8139 ndis ntoskrnl hal) add_cd_file(TARGET rtl8139 DESTINATION reactos/system32/drivers FOR all) +add_driver_inf(rtl8139 netrtl.inf) diff --git a/media/inf/netrtl.inf b/drivers/network/dd/rtl8139/netrtl.inf similarity index 100% rename from media/inf/netrtl.inf rename to drivers/network/dd/rtl8139/netrtl.inf diff --git a/drivers/processor/processr/CMakeLists.txt b/drivers/processor/processr/CMakeLists.txt index e034231b056..617a6e50b4f 100644 --- a/drivers/processor/processr/CMakeLists.txt +++ b/drivers/processor/processr/CMakeLists.txt @@ -10,3 +10,4 @@ set_module_type(processr kernelmodedriver) add_importlibs(processr hal ntoskrnl) add_pch(processr processr.h SOURCE) add_cd_file(TARGET processr DESTINATION reactos/system32/drivers FOR all) +add_driver_inf(processr cpu.inf) diff --git a/media/inf/cpu.inf b/drivers/processor/processr/cpu.inf similarity index 100% rename from media/inf/cpu.inf rename to drivers/processor/processr/cpu.inf diff --git a/drivers/wdm/audio/hdaudbus/CMakeLists.txt b/drivers/wdm/audio/hdaudbus/CMakeLists.txt index 1b7c02e6e70..d5ab639d190 100644 --- a/drivers/wdm/audio/hdaudbus/CMakeLists.txt +++ b/drivers/wdm/audio/hdaudbus/CMakeLists.txt @@ -15,3 +15,4 @@ set_module_type(hdaudbus kernelmodedriver) target_link_libraries(hdaudbus libcntpr ${PSEH_LIB}) add_importlibs(hdaudbus ntoskrnl hal) add_cd_file(TARGET hdaudbus DESTINATION reactos/system32/drivers FOR all) +add_driver_inf(hdaudbus hdaudbus.inf) diff --git a/media/inf/hdaudbus.inf b/drivers/wdm/audio/hdaudbus/hdaudbus.inf similarity index 100% rename from media/inf/hdaudbus.inf rename to drivers/wdm/audio/hdaudbus/hdaudbus.inf diff --git a/media/inf/CMakeLists.txt b/media/inf/CMakeLists.txt index d84ffff5393..d1c54810ec6 100644 --- a/media/inf/CMakeLists.txt +++ b/media/inf/CMakeLists.txt @@ -1,19 +1,16 @@ list(APPEND INF_FILES - acpi.inf audio.inf battery.inf bda.inf bth.inf c_image.inf cdrom.inf - cpu.inf disk.inf display.inf fdc.inf flpydisk.inf hal.inf - hdaudbus.inf hdc.inf input.inf keyboard.inf @@ -24,10 +21,6 @@ list(APPEND INF_FILES monitor.inf msmouse.inf NET_NIC.inf - netamd.inf - netisa.inf - netrtl.inf - netrtpnt.inf nettcpip.inf ports.inf scsi.inf @@ -37,8 +30,7 @@ list(APPEND INF_FILES usbport.inf usbstor.inf wdmaudio.inf - wmiacpi.inf - xboxdisp.inf) + wmiacpi.inf) list(APPEND UTF8_INF_FILES defltws.inf @@ -46,17 +38,8 @@ list(APPEND UTF8_INF_FILES intl.inf layout.inf) -foreach(item ${INF_FILES}) - set(_converted_item ${CMAKE_CURRENT_BINARY_DIR}/${item}) - set(_source_item ${CMAKE_CURRENT_SOURCE_DIR}/${item}) - add_custom_command(OUTPUT "${_converted_item}" - COMMAND native-utf16le "${_source_item}" "${_converted_item}" - DEPENDS native-utf16le "${_source_item}") - add_cd_file(TARGET converted_inf_files FILE ${_converted_item} DESTINATION reactos/inf FOR all) - list(APPEND _converted_inf_files ${_converted_item}) -endforeach(item) - -add_custom_target(converted_inf_files DEPENDS ${_converted_inf_files}) +# module name is used for a custom target creation, so we can put any unique name here +add_driver_inf(media_inf ${INF_FILES}) foreach(item ${UTF8_INF_FILES}) add_cd_file(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${item}" DESTINATION reactos/inf FOR all) diff --git a/media/inf/netisa.inf b/media/inf/netisa.inf deleted file mode 100644 index 58e7095b1e3..00000000000 --- a/media/inf/netisa.inf +++ /dev/null @@ -1,111 +0,0 @@ -; NETISA.INF - -; Installation file for ISA network cards - -[Version] -Signature = "$Windows NT$" -;Signature = "$ReactOS$" -LayoutFile = layout.inf -Class = Net -ClassGUID = {4D36E972-E325-11CE-BFC1-08002BE10318} -Provider = %ReactOS% -DriverVer = 02/15/2007,1.02 - -[DestinationDirs] -DefaultDestDir = 12 - -[Manufacturer] -%GenericMfg% = GenericMfg - -[GenericMfg] -%*PNP80D6.DeviceDesc% = NE2000_Inst.ndi,*PNP80D6 - -;---------------------------- NE2000 DRIVER ----------------------------- - -[NE2000_Inst.ndi.NT] -Characteristics = 0x4 ; NCF_PHYSICAL -BusType = 14 ; PNPIsaBus -AddReg = NE2000_AddReg.NT -CopyFiles = NE2000_CopyFiles.NT - -[NE2000_AddReg.NT] -HKR,,Port,0x00000000,"c100" -HKR,,Irq,0x00000000,"B" -HKR,,NetworkAddress,0x00000000,"001122334455" - -[NE2000_CopyFiles.NT] -ne2000.sys - -[NE2000_Inst.ndi.NT.Services] -AddService = ne2000, 0x00000002, ne2000_Service_Inst - -[ne2000_Service_Inst] -ServiceType = 1 -StartType = 3 -ErrorControl = 1 -ServiceBinary = %12%\ne2000.sys -LoadOrderGroup = NDIS - -;-------------------------------- STRINGS ------------------------------- - -[Strings] -ReactOS = "ReactOS Team" - -GenericMfg = "(Generic network cards)" -*PNP80D6.DeviceDesc = "NE2000 Compatible" - -[Strings.0405] -GenericMfg = "(Generické síťové karty)" -*PNP80D6.DeviceDesc = "NE2000 kompatibilní síťová karta" - -[Strings.0407] -GenericMfg = "(Generische Netzwerkkarten)" -*PNP80D6.DeviceDesc = "NE2000 kompatible Netzwerkkarte" - -[Strings.0a] -GenericMfg = "(Tarjeta de red estándar)" -*PNP80D6.DeviceDesc = "Compatible con NE2000" - -[Strings.040C] -GenericMfg = "(Cartes réseau génériques)" -*PNP80D6.DeviceDesc = "Carte réseau compatible NE2000" - -[Strings.0411] -GenericMfg = "(標準 ネットワーク カード)" -*PNP80D6.DeviceDesc = "NE2000 互換" - -[Strings.0415] -GenericMfg = "(Standardowe karty sieciowe)" -*PNP80D6.DeviceDesc = "Kompatybilna z NE2000" - -[Strings.0416] -GenericMfg = "(Adaptadores de rede padrão)" -*PNP80D6.DeviceDesc = "Compatível com NE2000" - -[Strings.0418] -GenericMfg = "(placă de rețea generică)" -*PNP80D6.DeviceDesc = "Compatibile cu NE2000" - -[Strings.0419] -GenericMfg = "(Стандартные сетевые адаптеры)" -*PNP80D6.DeviceDesc = "NE2000-совместимые" - -[Strings.041B] -GenericMfg = "(Generické sieťové karty)" -*PNP80D6.DeviceDesc = "NE2000 kompatibilná sieťová karta" - -[Strings.041f] -GenericMfg = "(Umûmî Ağ Kartları)" -*PNP80D6.DeviceDesc = "NE2000 Uyumlu" - -[Strings.0422] -GenericMfg = "(Стандартні мережеві адаптери)" -*PNP80D6.DeviceDesc = "NE2000-сумісні" - -[Strings.0427] -GenericMfg = "(Standartinės tinklo plokštės)" -*PNP80D6.DeviceDesc = "Su NE2000 suderinama tinklo plokštė" - -[Strings.0804] -GenericMfg = "(通用网卡)" -*PNP80D6.DeviceDesc = "NE2000 兼容" diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake index c2e15e9d57c..9b3d7a7c4b5 100644 --- a/sdk/cmake/CMakeMacros.cmake +++ b/sdk/cmake/CMakeMacros.cmake @@ -356,15 +356,19 @@ function(add_cd_file) add_dependencies(bootcd ${_CD_TARGET} registry_inf) endif() else() - # add it in reactos.cab dir_to_num(${_CD_DESTINATION} _num) - file(APPEND ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff.cmake "\"${_CD_FILE}\" ${_num}\n") + foreach(item ${_CD_FILE}) + # add it in reactos.cab + file(APPEND ${REACTOS_BINARY_DIR}/boot/bootdata/packages/reactos.dff.cmake "\"${item}\" ${_num}\n") + + # manage dependency - file level + set_property(GLOBAL APPEND PROPERTY REACTOS_CAB_DEPENDS ${item}) + endforeach() + # manage dependency - target level if(_CD_TARGET) add_dependencies(reactos_cab_inf ${_CD_TARGET}) endif() - # manage dependency - file level - set_property(GLOBAL APPEND PROPERTY REACTOS_CAB_DEPENDS ${_CD_FILE}) endif() endif() #end bootcd @@ -622,7 +626,7 @@ function(set_module_type MODULE TYPE) endif() # Set the PE image version numbers from the NT OS version ReactOS is based on - if (MSVC) + if(MSVC) add_target_link_flags(${MODULE} "/VERSION:5.01") else() add_target_link_flags(${MODULE} "-Wl,--major-image-version,5 -Wl,--minor-image-version,01") @@ -877,6 +881,21 @@ function(create_registry_hives) endfunction() +function(add_driver_inf _module) + # Add to the inf files list + foreach(_file ${ARGN}) + set(_converted_item ${CMAKE_CURRENT_BINARY_DIR}/${_file}) + set(_source_item ${CMAKE_CURRENT_SOURCE_DIR}/${_file}) + add_custom_command(OUTPUT "${_converted_item}" + COMMAND native-utf16le "${_source_item}" "${_converted_item}" + DEPENDS native-utf16le "${_source_item}") + list(APPEND _converted_inf_files ${_converted_item}) + endforeach() + + add_custom_target(${_module}_inf_files DEPENDS ${_converted_inf_files}) + add_cd_file(FILE ${_converted_inf_files} TARGET ${_module}_inf_files DESTINATION reactos/inf FOR all) +endfunction() + if(KDBG) set(ROSSYM_LIB "rossym") else() diff --git a/win32ss/drivers/miniport/xboxvmp/CMakeLists.txt b/win32ss/drivers/miniport/xboxvmp/CMakeLists.txt index b42841a53ad..b76cb298da1 100644 --- a/win32ss/drivers/miniport/xboxvmp/CMakeLists.txt +++ b/win32ss/drivers/miniport/xboxvmp/CMakeLists.txt @@ -2,3 +2,4 @@ add_library(xboxvmp SHARED xboxvmp.c xboxvmp.rc) set_module_type(xboxvmp kernelmodedriver) add_importlibs(xboxvmp ntoskrnl videoprt) +add_driver_inf(xboxvmp xboxdisp.inf) diff --git a/media/inf/xboxdisp.inf b/win32ss/drivers/miniport/xboxvmp/xboxdisp.inf similarity index 100% rename from media/inf/xboxdisp.inf rename to win32ss/drivers/miniport/xboxvmp/xboxdisp.inf