From 87bde6d0320a310f45f3d8f925ed0c62a8342c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 18 Mar 2007 14:33:17 +0000 Subject: [PATCH] Add a variable to change the name of the ReactOS directory on bootcd. If a non default name is chosen, the cdrom is created, but it is unusable as freeldr doesn't find txtsetup.inf svn path=/trunk/; revision=26131 --- reactos/Makefile | 30 +++++++++++++++++-- reactos/base/setup/reactos/reactos.rbuild | 2 +- reactos/boot/bootdata/bootdata.rbuild | 12 ++++---- reactos/dll/ntdll/ntdll.rbuild | 2 +- reactos/drivers/base/blue/blue.rbuild | 4 +-- reactos/drivers/base/bootvid/bootvid.rbuild | 6 ++-- reactos/drivers/base/kdcom/kdcom.rbuild | 8 ++--- reactos/drivers/filesystems/cdfs/cdfs.rbuild | 2 +- reactos/drivers/filesystems/ntfs/ntfs.rbuild | 4 +-- .../drivers/filesystems/vfat/vfatfs.rbuild | 2 +- .../drivers/input/i8042prt/i8042prt.rbuild | 2 +- .../drivers/input/kbdclass/kbdclass.rbuild | 2 +- reactos/drivers/storage/atapi/atapi.rbuild | 2 +- .../drivers/storage/buslogic/buslogic.rbuild | 2 +- reactos/drivers/storage/cdrom/cdrom.rbuild | 2 +- reactos/drivers/storage/class2/class2.rbuild | 2 +- reactos/drivers/storage/disk/disk.rbuild | 2 +- .../drivers/storage/diskdump/diskdump.rbuild | 2 +- reactos/drivers/storage/floppy/floppy.rbuild | 2 +- .../drivers/storage/scsiport/scsiport.rbuild | 2 +- reactos/drivers/test/csqtest/csqtest.rbuild | 4 +-- reactos/drivers/test/kmtest/kmtest.rbuild | 4 +-- reactos/hal/halx86/generic/reboot.c | 4 +-- reactos/hal/halx86/mp/halmp.rbuild | 4 +-- reactos/hal/halx86/up/halup.rbuild | 4 +-- reactos/media/drivers/etc/etc.rbuild | 8 +++-- reactos/media/nls/nls.rbuild | 6 ++-- reactos/ntoskrnl/kd64/kddata.c | 8 +++++ reactos/ntoskrnl/ntoskrnl.rbuild | 2 +- .../rbuild/backend/mingw/modulehandler.cpp | 2 +- reactos/tools/rbuild/bootstrap.cpp | 14 ++++++++- reactos/tools/rbuild/cdfile.cpp | 14 ++++++++- reactos/tools/rbuild/project.cpp | 17 +++++++++-- reactos/tools/rbuild/rbuild.h | 10 ++++++- 34 files changed, 136 insertions(+), 57 deletions(-) diff --git a/reactos/Makefile b/reactos/Makefile index d04d828a215..2bf62e3c631 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -69,6 +69,11 @@ # Examples of output files include *.exe, *.dll, and *.sys. N.B. Don't # put a path separator at the end. The variable defaults to .\output-i386. # +# ROS_CDOUTPUT +# This variable controls the name of the ReactOS directory on cdrom. +# The variable defaults to reactos. +# Warning: setting this value may lead to a not bootable/installable cdrom. +# # ROS_TEMPORARY # This variable controls where to put temporary files. Temporary files # are (usually small) generated files that are needed to generate the @@ -321,17 +326,32 @@ endif ifneq ($(ROS_INTERMEDIATE),) INTERMEDIATE := $(ROS_INTERMEDIATE) else - INTERMEDIATE := obj-i386 + ifneq ($(ROS_CDOUTPUT),) + INTERMEDIATE := obj-$(ROS_CDOUTPUT) + else + INTERMEDIATE := obj-i386 + endif endif INTERMEDIATE_ := $(INTERMEDIATE)$(SEP) ifneq ($(ROS_OUTPUT),) OUTPUT := $(ROS_OUTPUT) else - OUTPUT := output-i386 + ifneq ($(ROS_CDOUTPUT),) + OUTPUT := output-$(ROS_CDOUTPUT) + else + OUTPUT := output-i386 + endif endif OUTPUT_ := $(OUTPUT)$(SEP) +ifneq ($(ROS_CDOUTPUT),) + CDOUTPUT := $(ROS_CDOUTPUT) +else + CDOUTPUT := reactos +endif +CDOUTPUT_ := $(CDOUTPUT)$(SEP) + ifneq ($(ROS_TEMPORARY),) TEMPORARY := $(ROS_TEMPORARY) else @@ -342,7 +362,11 @@ TEMPORARY_ := $(TEMPORARY)$(SEP) ifneq ($(ROS_INSTALL),) INSTALL := $(ROS_INSTALL) else - INSTALL := reactos + ifneq ($(ROS_CDOUTPUT),) + INSTALL := reactos.$(ROS_CDOUTPUT) + else + INSTALL := reactos + endif endif INSTALL_ := $(INSTALL)$(SEP) diff --git a/reactos/base/setup/reactos/reactos.rbuild b/reactos/base/setup/reactos/reactos.rbuild index 603c01c2b36..e213a5789a8 100644 --- a/reactos/base/setup/reactos/reactos.rbuild +++ b/reactos/base/setup/reactos/reactos.rbuild @@ -1,5 +1,5 @@ - + . 0x0501 0x0501 diff --git a/reactos/boot/bootdata/bootdata.rbuild b/reactos/boot/bootdata/bootdata.rbuild index 28da7d5a188..17054473c2b 100644 --- a/reactos/boot/bootdata/bootdata.rbuild +++ b/reactos/boot/bootdata/bootdata.rbuild @@ -2,12 +2,12 @@ autorun.inf icon.ico readme.txt -hivecls.inf -hivedef.inf -hivesft.inf -hivesys.inf -txtsetup.sif - +hivecls.inf +hivedef.inf +hivesft.inf +hivesys.inf +txtsetup.sif + diff --git a/reactos/dll/ntdll/ntdll.rbuild b/reactos/dll/ntdll/ntdll.rbuild index 24f0c5eb797..0661b0449d9 100644 --- a/reactos/dll/ntdll/ntdll.rbuild +++ b/reactos/dll/ntdll/ntdll.rbuild @@ -1,5 +1,5 @@ - + inc include/reactos/subsys diff --git a/reactos/drivers/base/blue/blue.rbuild b/reactos/drivers/base/blue/blue.rbuild index 9b46a48b629..6d8bcbaf211 100644 --- a/reactos/drivers/base/blue/blue.rbuild +++ b/reactos/drivers/base/blue/blue.rbuild @@ -1,6 +1,6 @@ - - + + include/reactos/drivers ntoskrnl hal diff --git a/reactos/drivers/base/bootvid/bootvid.rbuild b/reactos/drivers/base/bootvid/bootvid.rbuild index 0cf8be0c21b..085332de4e2 100644 --- a/reactos/drivers/base/bootvid/bootvid.rbuild +++ b/reactos/drivers/base/bootvid/bootvid.rbuild @@ -1,8 +1,8 @@ - - . - + + . + ntoskrnl hal bootvid.c diff --git a/reactos/drivers/base/kdcom/kdcom.rbuild b/reactos/drivers/base/kdcom/kdcom.rbuild index 553ec166760..7c0d2e893ec 100644 --- a/reactos/drivers/base/kdcom/kdcom.rbuild +++ b/reactos/drivers/base/kdcom/kdcom.rbuild @@ -1,9 +1,9 @@ - - . - + + . + ntoskrnl hal - kdbg.c + kdbg.c diff --git a/reactos/drivers/filesystems/cdfs/cdfs.rbuild b/reactos/drivers/filesystems/cdfs/cdfs.rbuild index 24382282c22..f61741feaca 100644 --- a/reactos/drivers/filesystems/cdfs/cdfs.rbuild +++ b/reactos/drivers/filesystems/cdfs/cdfs.rbuild @@ -1,5 +1,5 @@ - + . ntoskrnl diff --git a/reactos/drivers/filesystems/ntfs/ntfs.rbuild b/reactos/drivers/filesystems/ntfs/ntfs.rbuild index c7bc669b27a..ae39ea52699 100644 --- a/reactos/drivers/filesystems/ntfs/ntfs.rbuild +++ b/reactos/drivers/filesystems/ntfs/ntfs.rbuild @@ -1,7 +1,7 @@ - + . - + ntoskrnl hal attrib.c diff --git a/reactos/drivers/filesystems/vfat/vfatfs.rbuild b/reactos/drivers/filesystems/vfat/vfatfs.rbuild index 7122133a9a8..057e51b9919 100644 --- a/reactos/drivers/filesystems/vfat/vfatfs.rbuild +++ b/reactos/drivers/filesystems/vfat/vfatfs.rbuild @@ -1,5 +1,5 @@ - + . -lgcc diff --git a/reactos/drivers/input/i8042prt/i8042prt.rbuild b/reactos/drivers/input/i8042prt/i8042prt.rbuild index ca4085c16de..2068adf99d6 100644 --- a/reactos/drivers/input/i8042prt/i8042prt.rbuild +++ b/reactos/drivers/input/i8042prt/i8042prt.rbuild @@ -1,5 +1,5 @@ - + . diff --git a/reactos/drivers/input/kbdclass/kbdclass.rbuild b/reactos/drivers/input/kbdclass/kbdclass.rbuild index df0f774016d..4b581c4bc6f 100644 --- a/reactos/drivers/input/kbdclass/kbdclass.rbuild +++ b/reactos/drivers/input/kbdclass/kbdclass.rbuild @@ -1,5 +1,5 @@ - + pseh diff --git a/reactos/drivers/storage/atapi/atapi.rbuild b/reactos/drivers/storage/atapi/atapi.rbuild index 3011377685d..bde1e5dc86f 100644 --- a/reactos/drivers/storage/atapi/atapi.rbuild +++ b/reactos/drivers/storage/atapi/atapi.rbuild @@ -1,5 +1,5 @@ - + . ntoskrnl diff --git a/reactos/drivers/storage/buslogic/buslogic.rbuild b/reactos/drivers/storage/buslogic/buslogic.rbuild index 2387d3a97af..859204231c0 100644 --- a/reactos/drivers/storage/buslogic/buslogic.rbuild +++ b/reactos/drivers/storage/buslogic/buslogic.rbuild @@ -1,5 +1,5 @@ - + . ntoskrnl diff --git a/reactos/drivers/storage/cdrom/cdrom.rbuild b/reactos/drivers/storage/cdrom/cdrom.rbuild index 3ca7e033c6a..ca6074b4ffc 100644 --- a/reactos/drivers/storage/cdrom/cdrom.rbuild +++ b/reactos/drivers/storage/cdrom/cdrom.rbuild @@ -1,5 +1,5 @@ - + ntoskrnl hal diff --git a/reactos/drivers/storage/class2/class2.rbuild b/reactos/drivers/storage/class2/class2.rbuild index 3043be7df2b..324828f657d 100644 --- a/reactos/drivers/storage/class2/class2.rbuild +++ b/reactos/drivers/storage/class2/class2.rbuild @@ -1,5 +1,5 @@ - + ntoskrnl diff --git a/reactos/drivers/storage/disk/disk.rbuild b/reactos/drivers/storage/disk/disk.rbuild index 2b2a6385e7d..41a1ca04277 100644 --- a/reactos/drivers/storage/disk/disk.rbuild +++ b/reactos/drivers/storage/disk/disk.rbuild @@ -1,5 +1,5 @@ - + -lgcc ntoskrnl diff --git a/reactos/drivers/storage/diskdump/diskdump.rbuild b/reactos/drivers/storage/diskdump/diskdump.rbuild index 89995241b01..7f92679fef3 100644 --- a/reactos/drivers/storage/diskdump/diskdump.rbuild +++ b/reactos/drivers/storage/diskdump/diskdump.rbuild @@ -1,5 +1,5 @@ - + include/reactos/drivers diff --git a/reactos/drivers/storage/floppy/floppy.rbuild b/reactos/drivers/storage/floppy/floppy.rbuild index 7271de28d8b..8e4da6efe3e 100644 --- a/reactos/drivers/storage/floppy/floppy.rbuild +++ b/reactos/drivers/storage/floppy/floppy.rbuild @@ -1,5 +1,5 @@ - + . ntoskrnl diff --git a/reactos/drivers/storage/scsiport/scsiport.rbuild b/reactos/drivers/storage/scsiport/scsiport.rbuild index f1e019326d1..c84dce84d5d 100644 --- a/reactos/drivers/storage/scsiport/scsiport.rbuild +++ b/reactos/drivers/storage/scsiport/scsiport.rbuild @@ -1,5 +1,5 @@ - + diff --git a/reactos/drivers/test/csqtest/csqtest.rbuild b/reactos/drivers/test/csqtest/csqtest.rbuild index 4e75922112e..4dd069c942c 100644 --- a/reactos/drivers/test/csqtest/csqtest.rbuild +++ b/reactos/drivers/test/csqtest/csqtest.rbuild @@ -1,6 +1,6 @@ - - + + include/reactos/drivers ntoskrnl hal diff --git a/reactos/drivers/test/kmtest/kmtest.rbuild b/reactos/drivers/test/kmtest/kmtest.rbuild index 0e1f51a3c64..20c8a1d7f0c 100644 --- a/reactos/drivers/test/kmtest/kmtest.rbuild +++ b/reactos/drivers/test/kmtest/kmtest.rbuild @@ -1,6 +1,6 @@ - - + + include/reactos/drivers ntoskrnl hal diff --git a/reactos/hal/halx86/generic/reboot.c b/reactos/hal/halx86/generic/reboot.c index 5817a47abe4..bac0b4153ec 100644 --- a/reactos/hal/halx86/generic/reboot.c +++ b/reactos/hal/halx86/generic/reboot.c @@ -15,7 +15,7 @@ /* PRIVATE FUNCTIONS *********************************************************/ -VOID +static VOID NTAPI HalpWriteResetCommand(VOID) { @@ -23,7 +23,7 @@ HalpWriteResetCommand(VOID) WRITE_PORT_UCHAR((PUCHAR)0x64, 0xFE); }; -VOID +static VOID NTAPI HalpReboot(VOID) { diff --git a/reactos/hal/halx86/mp/halmp.rbuild b/reactos/hal/halx86/mp/halmp.rbuild index 00e0f8aecc3..1ad9998749a 100644 --- a/reactos/hal/halx86/mp/halmp.rbuild +++ b/reactos/hal/halx86/mp/halmp.rbuild @@ -1,6 +1,6 @@ - + ../include include @@ -11,7 +11,7 @@ hal_generic_pc ntoskrnl apic.c - halinit.c + halinit.c halinit_mp.c ioapic.c ipi_mp.c diff --git a/reactos/hal/halx86/up/halup.rbuild b/reactos/hal/halx86/up/halup.rbuild index 8a75ba3e762..394126f8a91 100644 --- a/reactos/hal/halx86/up/halup.rbuild +++ b/reactos/hal/halx86/up/halup.rbuild @@ -1,12 +1,12 @@ - + ../include include - -enable-stdcall-fixup + -enable-stdcall-fixup hal_generic hal_generic_up hal_generic_pc diff --git a/reactos/media/drivers/etc/etc.rbuild b/reactos/media/drivers/etc/etc.rbuild index 96d48c13460..fdafc2e290f 100644 --- a/reactos/media/drivers/etc/etc.rbuild +++ b/reactos/media/drivers/etc/etc.rbuild @@ -1,6 +1,8 @@ -services + +services services - KDBinit + KDBinit KDBinit - \ No newline at end of file + + \ No newline at end of file diff --git a/reactos/media/nls/nls.rbuild b/reactos/media/nls/nls.rbuild index b522e2394d6..2889a23e309 100644 --- a/reactos/media/nls/nls.rbuild +++ b/reactos/media/nls/nls.rbuild @@ -1,7 +1,7 @@ -c_437.nls -c_1252.nls -l_intl.nls +c_437.nls +c_1252.nls +l_intl.nls c_037.nls c_424.nls diff --git a/reactos/ntoskrnl/kd64/kddata.c b/reactos/ntoskrnl/kd64/kddata.c index ff48f2b57aa..746fe985e61 100644 --- a/reactos/ntoskrnl/kd64/kddata.c +++ b/reactos/ntoskrnl/kd64/kddata.c @@ -326,7 +326,15 @@ DBGKD_GET_VERSION64 KdVersionBlock = DBGKD_64BIT_PROTOCOL_VERSION2, KD_SECONDARY_VERSION_DEFAULT, DBGKD_VERS_FLAG_DATA, +#if defined(_M_IX86) IMAGE_FILE_MACHINE_I386, +#elif defined(_M_PPC) + IMAGE_FILE_MACHINE_POWERPC, +#elif defined(_M_MIPS) + IMAGE_FILE_MACHINE_R4000, +#else +#error Unknown platform +#endif PACKET_TYPE_MAX, 0, 0, diff --git a/reactos/ntoskrnl/ntoskrnl.rbuild b/reactos/ntoskrnl/ntoskrnl.rbuild index 7ebe847c5f2..1feaa572b4b 100644 --- a/reactos/ntoskrnl/ntoskrnl.rbuild +++ b/reactos/ntoskrnl/ntoskrnl.rbuild @@ -1,5 +1,5 @@ - + diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 3d904bd84ac..04aa79a4c16 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -3153,7 +3153,7 @@ MingwIsoModuleHandler::GenerateIsoModuleTarget () NormalizeFilename ( "boot" + sSep + "freeldr" + sSep + "bootsect" + sSep + bootloader.c_str() ), backend->outputDirectory ); - string bootcdReactosNoFixup = bootcdDirectory + sSep + "reactos"; + string bootcdReactosNoFixup = bootcdDirectory + sSep + Environment::GetCdOutputPath (); string bootcdReactos = PassThruCacheDirectory ( NormalizeFilename ( bootcdReactosNoFixup + sSep ), backend->outputDirectory ); diff --git a/reactos/tools/rbuild/bootstrap.cpp b/reactos/tools/rbuild/bootstrap.cpp index 7c00a32f6f2..727dde70e94 100644 --- a/reactos/tools/rbuild/bootstrap.cpp +++ b/reactos/tools/rbuild/bootstrap.cpp @@ -73,6 +73,18 @@ Bootstrap::IsSupportedModuleType ( ModuleType type ) __LINE__ ); } +string +Bootstrap::ReplaceVariable ( const string& name, + const string& value, + string path ) +{ + size_t i = path.find ( name ); + if ( i != string::npos ) + return path.replace ( i, name.length (), value ); + else + return path; +} + void Bootstrap::Initialize () { @@ -85,7 +97,7 @@ Bootstrap::Initialize () const XMLAttribute* att = node.GetAttribute ( "base", false ); if ( att != NULL ) - base = att->value; + base = ReplaceVariable ( "$(CDOUTPUT)", Environment::GetCdOutputPath (), att->value ); else base = ""; diff --git a/reactos/tools/rbuild/cdfile.cpp b/reactos/tools/rbuild/cdfile.cpp index 107a3375557..19a3f213dc1 100644 --- a/reactos/tools/rbuild/cdfile.cpp +++ b/reactos/tools/rbuild/cdfile.cpp @@ -22,6 +22,18 @@ using std::string; +string +CDFile::ReplaceVariable ( const string& name, + const string& value, + string path ) +{ + size_t i = path.find ( name ); + if ( i != string::npos ) + return path.replace ( i, name.length (), value ); + else + return path; +} + CDFile::CDFile ( const Project& project_, const XMLElement& cdfileNode, const string& path ) @@ -30,7 +42,7 @@ CDFile::CDFile ( const Project& project_, { const XMLAttribute* att = node.GetAttribute ( "base", false ); if ( att != NULL ) - base = att->value; + base = ReplaceVariable ( "$(CDOUTPUT)", Environment::GetCdOutputPath (), att->value ); else base = ""; diff --git a/reactos/tools/rbuild/project.cpp b/reactos/tools/rbuild/project.cpp index b38eee646ce..79aca79fca5 100644 --- a/reactos/tools/rbuild/project.cpp +++ b/reactos/tools/rbuild/project.cpp @@ -49,21 +49,34 @@ Environment::GetEnvironmentVariablePathOrDefault ( const string& name, /* static */ string Environment::GetIntermediatePath () { + string defaultIntermediate = + string( "obj-" ) + GetEnvironmentVariablePathOrDefault ( "ROS_CDOUTPUT", "i386" ); return GetEnvironmentVariablePathOrDefault ( "ROS_INTERMEDIATE", - "obj-i386" ); + defaultIntermediate ); } /* static */ string Environment::GetOutputPath () { + string defaultOutput = + string( "output-" ) + GetEnvironmentVariablePathOrDefault ( "ROS_CDOUTPUT", "i386" ); return GetEnvironmentVariablePathOrDefault ( "ROS_OUTPUT", - "output-i386" ); + defaultOutput ); } /* static */ string Environment::GetInstallPath () { + string defaultInstall = + string( "reactos." ) + GetEnvironmentVariablePathOrDefault ( "ROS_CDOUTPUT", "" ); return GetEnvironmentVariablePathOrDefault ( "ROS_INSTALL", + defaultInstall ); +} + +/* static */ string +Environment::GetCdOutputPath () +{ + return GetEnvironmentVariablePathOrDefault ( "ROS_CDOUTPUT", "reactos" ); } diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index ee204ca8a1d..41a462d6ded 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -155,6 +155,7 @@ public: static std::string GetVariable ( const std::string& name ); static std::string GetIntermediatePath (); static std::string GetOutputPath (); + static std::string GetCdOutputPath (); static std::string GetInstallPath (); static std::string GetEnvironmentVariablePathOrDefault ( const std::string& name, const std::string& defaultValue ); @@ -296,7 +297,7 @@ public: ImportLibrary* importLibrary; bool mangledSymbols; bool isUnicode; - bool isDefaultEntryPoint; + bool isDefaultEntryPoint; Bootstrap* bootstrap; AutoRegister* autoRegister; IfableData non_if_data; @@ -761,6 +762,9 @@ public: private: bool IsSupportedModuleType ( ModuleType type ); void Initialize(); + static std::string ReplaceVariable ( const std::string& name, + const std::string& value, + std::string path ); }; @@ -780,6 +784,10 @@ public: ~CDFile (); void ProcessXML(); std::string GetPath () const; +private: + static std::string ReplaceVariable ( const std::string& name, + const std::string& value, + std::string path ); };