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
This commit is contained in:
Hervé Poussineau 2007-03-18 14:33:17 +00:00
parent b0385e2a41
commit 87bde6d032
34 changed files with 136 additions and 57 deletions

View file

@ -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)

View file

@ -1,5 +1,5 @@
<module name="reactos" type="win32gui">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<include base="reactos">.</include>
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>

View file

@ -2,12 +2,12 @@
<cdfile>autorun.inf</cdfile>
<cdfile>icon.ico</cdfile>
<cdfile>readme.txt</cdfile>
<cdfile base="reactos">hivecls.inf</cdfile>
<cdfile base="reactos">hivedef.inf</cdfile>
<cdfile base="reactos">hivesft.inf</cdfile>
<cdfile base="reactos">hivesys.inf</cdfile>
<cdfile base="reactos">txtsetup.sif</cdfile>
<!--<cdfile base="reactos">unattend.inf</cdfile>-->
<cdfile base="$(CDOUTPUT)">hivecls.inf</cdfile>
<cdfile base="$(CDOUTPUT)">hivedef.inf</cdfile>
<cdfile base="$(CDOUTPUT)">hivesft.inf</cdfile>
<cdfile base="$(CDOUTPUT)">hivesys.inf</cdfile>
<cdfile base="$(CDOUTPUT)">txtsetup.sif</cdfile>
<!--<cdfile base="$(CDOUTPUT)">unattend.inf</cdfile>-->
<directory name="bootcd">
<xi:include href="bootcd/bootcd.rbuild" />
</directory>

View file

@ -1,5 +1,5 @@
<module name="ntdll" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_NTDLL}" installbase="system32" installname="ntdll.dll">
<bootstrap base="reactos/system32" />
<bootstrap base="$(CDOUTPUT)/system32" />
<importlibrary definition="def/ntdll.def" />
<include base="ntdll">inc</include>
<include base="ReactOS">include/reactos/subsys</include>

View file

@ -1,6 +1,6 @@
<module name="blue" type="kernelmodedriver" installbase="system32/drivers" installname="blue.sys">
<bootstrap base="reactos" />
<define name="__USE_W32API" />
<bootstrap base="$(CDOUTPUT)" />
<define name="__USE_W32API" />
<include base="ReactOS">include/reactos/drivers</include>
<library>ntoskrnl</library>
<library>hal</library>

View file

@ -1,8 +1,8 @@
<module name="bootvid" type="kernelmodedll" entrypoint="DriverEntry@8" installbase="system32/drivers" installname="bootvid.dll">
<importlibrary definition="bootvid.def"></importlibrary>
<bootstrap base="reactos" nameoncd="bootvid.dll" />
<include base="bootvid">.</include>
<define name="__USE_W32API" />
<bootstrap base="$(CDOUTPUT)" nameoncd="bootvid.dll" />
<include base="bootvid">.</include>
<define name="__USE_W32API" />
<library>ntoskrnl</library>
<library>hal</library>
<file>bootvid.c</file>

View file

@ -1,9 +1,9 @@
<module name="kdcom" type="kernelmodedll" entrypoint="DriverEntry@8" installbase="system32/drivers" installname="kdcom.dll">
<importlibrary definition="kdcom.def"></importlibrary>
<bootstrap base="reactos" nameoncd="kdcom.dll" />
<include base="kdcom">.</include>
<define name="__USE_W32API" />
<bootstrap base="$(CDOUTPUT)" nameoncd="kdcom.dll" />
<include base="kdcom">.</include>
<define name="__USE_W32API" />
<library>ntoskrnl</library>
<library>hal</library>
<file>kdbg.c</file>
<file>kdbg.c</file>
</module>

View file

@ -1,5 +1,5 @@
<module name="cdfs" type="kernelmodedriver" installbase="system32/drivers" installname="cdfs.sys">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<include base="cdfs">.</include>
<define name="__USE_W32API" />
<library>ntoskrnl</library>

View file

@ -1,7 +1,7 @@
<module name="ntfs" type="kernelmodedriver" installbase="system32/drivers" installname="ntfs.sys">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<include base="ntfs">.</include>
<define name="__USE_W32API" />
<define name="__USE_W32API" />
<library>ntoskrnl</library>
<library>hal</library>
<file>attrib.c</file>

View file

@ -1,5 +1,5 @@
<module name="vfatfs" type="kernelmodedriver" installbase="system32/drivers" installname="vfatfs.sys">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<include base="vfatfs">.</include>
<define name="__USE_W32API" />
<linkerflag>-lgcc</linkerflag>

View file

@ -1,5 +1,5 @@
<module name="i8042prt" type="kernelmodedriver" installbase="system32/drivers" installname="i8042prt.sys">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<include base="i8042prt">.</include>
<define name="__USE_W32API" />
<define name="__REACTOS__" />

View file

@ -1,5 +1,5 @@
<module name="kbdclass" type="kernelmodedriver" installbase="system32/drivers" installname="kbdclass.sys">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<define name="__USE_W32API" />
<define name="NDEBUG" />
<library>pseh</library>

View file

@ -1,5 +1,5 @@
<module name="atapi" type="kernelmodedriver" installbase="system32/drivers" installname="atapi.sys">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<define name="__USE_W32API" />
<include base="atapi">.</include>
<library>ntoskrnl</library>

View file

@ -1,5 +1,5 @@
<module name="buslogic" type="kernelmodedriver" installbase="system32/drivers" installname="buslogic.sys">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<define name="__USE_W32API" />
<include base="buslogic">.</include>
<library>ntoskrnl</library>

View file

@ -1,5 +1,5 @@
<module name="cdrom" type="kernelmodedriver" installbase="system32/drivers" installname="cdrom.sys">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<define name="__USE_W32API" />
<library>ntoskrnl</library>
<library>hal</library>

View file

@ -1,5 +1,5 @@
<module name="class2" type="exportdriver" installbase="system32/drivers" installname="class2.sys">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<define name="__USE_W32API" />
<importlibrary definition="class2.def" />
<library>ntoskrnl</library>

View file

@ -1,5 +1,5 @@
<module name="disk" type="kernelmodedriver" installbase="system32/drivers" installname="disk.sys" allowwarnings="true">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<define name="__USE_W32API" />
<linkerflag>-lgcc</linkerflag>
<library>ntoskrnl</library>

View file

@ -1,5 +1,5 @@
<module name="diskdump" type="exportdriver" installbase="system32/drivers" installname="diskdump.sys">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<define name="__USE_W32API" />
<include base="ReactOS">include/reactos/drivers</include>
<library definition="diskdump.def" />

View file

@ -1,5 +1,5 @@
<module name="floppy" type="kernelmodedriver" installbase="system32/drivers" installname="floppy.sys">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<define name="__USE_W32API" />
<include base="floppy">.</include>
<library>ntoskrnl</library>

View file

@ -1,5 +1,5 @@
<module name="scsiport" type="exportdriver" installbase="system32/drivers" installname="scsiport.sys">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<define name="__USE_W32API" />
<define name="_SCSIPORT_" />
<importlibrary definition="scsiport.def" />

View file

@ -1,6 +1,6 @@
<module name="csqtest" type="kernelmodedriver" installbase="system32/drivers" installname="csqtest.sys">
<bootstrap base="reactos" />
<define name="__USE_W32API" />
<bootstrap base="$(CDOUTPUT)" />
<define name="__USE_W32API" />
<include base="ReactOS">include/reactos/drivers</include>
<library>ntoskrnl</library>
<library>hal</library>

View file

@ -1,6 +1,6 @@
<module name="kmtest" type="kernelmodedriver" installbase="system32/drivers" installname="kmtest.sys">
<bootstrap base="reactos" />
<define name="__USE_W32API" />
<bootstrap base="$(CDOUTPUT)" />
<define name="__USE_W32API" />
<include base="ReactOS">include/reactos/drivers</include>
<library>ntoskrnl</library>
<library>hal</library>

View file

@ -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)
{

View file

@ -1,6 +1,6 @@
<module name="halmp" type="kernelmodedll" entrypoint="0">
<importlibrary definition="../../hal/hal.def" />
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<include base="hal_generic">../include</include>
<include base="ntoskrnl">include</include>
<define name="_DISABLE_TIDENTS" />
@ -11,7 +11,7 @@
<library>hal_generic_pc</library>
<library>ntoskrnl</library>
<file>apic.c</file>
<file>halinit.c</file>
<file>halinit.c</file>
<file>halinit_mp.c</file>
<file>ioapic.c</file>
<file>ipi_mp.c</file>

View file

@ -1,12 +1,12 @@
<module name="halup" type="kernelmodedll" entrypoint="0">
<importlibrary definition="../../hal/hal.def" />
<bootstrap base="reactos" nameoncd="hal.dll" />
<bootstrap base="$(CDOUTPUT)" nameoncd="hal.dll" />
<include base="hal_generic">../include</include>
<include base="ntoskrnl">include</include>
<define name="_DISABLE_TIDENTS" />
<define name="__USE_W32API" />
<define name="_NTHAL_" />
<linkerflag>-enable-stdcall-fixup</linkerflag>
<linkerflag>-enable-stdcall-fixup</linkerflag>
<library>hal_generic</library>
<library>hal_generic_up</library>
<library>hal_generic_pc</library>

View file

@ -1,6 +1,8 @@
<cdfile base="reactos">services</cdfile>
<group>
<cdfile base="$(CDOUTPUT)">services</cdfile>
<installfile base="system32/drivers/etc">services</installfile>
<if property="KDBG" value="1">
<cdfile base="reactos">KDBinit</cdfile>
<cdfile base="$(CDOUTPUT)">KDBinit</cdfile>
<installfile base="system32/drivers/etc">KDBinit</installfile>
</if>
</if>
</group>

View file

@ -1,7 +1,7 @@
<group>
<cdfile base="reactos">c_437.nls</cdfile>
<cdfile base="reactos">c_1252.nls</cdfile>
<cdfile base="reactos">l_intl.nls</cdfile>
<cdfile base="$(CDOUTPUT)">c_437.nls</cdfile>
<cdfile base="$(CDOUTPUT)">c_1252.nls</cdfile>
<cdfile base="$(CDOUTPUT)">l_intl.nls</cdfile>
<installfile base="system32">c_037.nls</installfile>
<installfile base="system32">c_424.nls</installfile>

View file

@ -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,

View file

@ -1,5 +1,5 @@
<module name="ntoskrnl" type="kernel" installbase="system32" installname="ntoskrnl.exe">
<bootstrap base="reactos" />
<bootstrap base="$(CDOUTPUT)" />
<importlibrary definition="ntoskrnl.def" />
<define name="_SEH_NO_NATIVE_NLG" />
<define name="_DISABLE_TIDENTS" />

View file

@ -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 );

View file

@ -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 = "";

View file

@ -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 = "";

View file

@ -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" );
}

View file

@ -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 );
};