Support 'make livecd' Modified: branches/xmlbuildsystem/reactos/ReactOS.xml Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h Modified: branches/xmlbuildsystem/reactos/tools/rbuild/bootstrap.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h _____
Modified: branches/xmlbuildsystem/reactos/ReactOS.xml --- branches/xmlbuildsystem/reactos/ReactOS.xml 2005-04-19 17:13:34 UTC (rev 14704) +++ branches/xmlbuildsystem/reactos/ReactOS.xml 2005-04-19 20:52:49 UTC (rev 14705) @@ -62,4 +62,8 @@
<module name="bootcd" type="iso"> </module> + + <module name="livecd" type="liveiso"> + </module> + </project> _____
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-04-19 17:13:34 UTC (rev 14704) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-04-19 20:52:49 UTC (rev 14705) @@ -434,6 +434,8 @@
return false; if ( module.type == Iso ) return false; + if ( module.type == LiveIso ) + return false; if ( module.type == Test ) return false; return true; _____
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-04-19 17:13:34 UTC (rev 14704) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .cpp 2005-04-19 20:52:49 UTC (rev 14705) @@ -195,6 +195,9 @@
case Iso: handler = new MingwIsoModuleHandler ( module ); break; + case LiveIso: + handler = new MingwLiveIsoModuleHandler ( module ); + break; case Test: handler = new MingwTestModuleHandler ( module ); break; @@ -2538,7 +2541,7 @@ backend->outputDirectory ); string bootcdReactosNoFixup = bootcdDirectory + SSEP "reactos"; string bootcdReactos = PassThruCacheDirectory ( - NormalizeFilename ( bootcdReactosNoFixup ), + NormalizeFilename ( bootcdReactosNoFixup ) + SSEP, backend->outputDirectory ); CLEAN_FILE ( bootcdReactos ); string reactosInf = PassThruCacheDirectory ( @@ -2584,6 +2587,158 @@ }
+MingwLiveIsoModuleHandler::MingwLiveIsoModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwLiveIsoModuleHandler::Process () +{ + GenerateLiveIsoModuleTarget (); +} + +void +MingwLiveIsoModuleHandler::CreateDirectory ( const string& directory ) +{ + string normalizedDirectory = MingwModuleHandler::PassThruCacheDirectory ( + NormalizeFilename ( directory ) + SSEP, + backend->outputDirectory ); +} + +void +MingwLiveIsoModuleHandler::OutputCopyCommand ( const string& sourceFilename, + const string& targetFilename, + const string& targetDirectory ) +{ + string normalizedTargetFilename = MingwModuleHandler::PassThruCacheDirectory ( + NormalizeFilename ( targetDirectory + SSEP + targetFilename ), + backend->outputDirectory ); + fprintf ( fMakefile, + "\t$(ECHO_CP)\n" ); + fprintf ( fMakefile, + "\t${cp} %s %s 1>$(NUL)\n", + sourceFilename.c_str (), + normalizedTargetFilename.c_str () ); +} + +void +MingwLiveIsoModuleHandler::OutputModuleCopyCommands ( string& livecdDirectory, + string& reactosDirectory ) +{ + for ( size_t i = 0; i < module.project.modules.size (); i++ ) + { + const Module& m = *module.project.modules[i]; + if ( m.installName.length () > 0 ) + { + string sourceFilename = MingwModuleHandler::PassThruCacheDirectory ( + NormalizeFilename ( m.GetPath () ), + backend->outputDirectory ); + OutputCopyCommand ( sourceFilename, + m.installName, + livecdDirectory + SSEP + reactosDirectory + SSEP + m.installBase ); + } + } +} + +void +MingwLiveIsoModuleHandler::OutputNonModuleCopyCommands ( string& livecdDirectory, + string& reactosDirectory ) +{ + for ( size_t i = 0; i < module.project.installfiles.size (); i++ ) + { + const InstallFile& installfile = *module.project.installfiles[i]; + OutputCopyCommand ( installfile.GetPath (), + installfile.newname, + livecdDirectory + SSEP + reactosDirectory + SSEP + installfile.base ); + } +} + +void +MingwLiveIsoModuleHandler::OutputProfilesDirectoryCommands ( string& livecdDirectory ) +{ + CreateDirectory ( livecdDirectory + SSEP "Profiles" ); + CreateDirectory ( livecdDirectory + SSEP "Profiles" SSEP "All Users") ; + CreateDirectory ( livecdDirectory + SSEP "Profiles" SSEP "All Users" SSEP "Desktop" ); + CreateDirectory ( livecdDirectory + SSEP "Profiles" SSEP "Default User" ); + CreateDirectory ( livecdDirectory + SSEP "Profiles" SSEP "Default User" SSEP "Desktop" ); + CreateDirectory ( livecdDirectory + SSEP "Profiles" SSEP "Default User" SSEP "My Documents" ); + + string livecdIni = "bootdata" SSEP "livecd.ini"; + OutputCopyCommand ( livecdIni, + "freeldr.ini", + livecdDirectory ); +} + +void +MingwLiveIsoModuleHandler::OutputLoaderCommands ( string& livecdDirectory ) +{ + string setupldr = PassThruCacheDirectory ( + NormalizeFilename ( "boot" SSEP "freeldr" SSEP "freeldr" SSEP "setupldr.sys" ), + backend->outputDirectory ); + CreateDirectory ( livecdDirectory + SSEP "loader" ); + OutputCopyCommand ( setupldr, + "setupldr.sys", + livecdDirectory + SSEP + "loader" ); +} + +void +MingwLiveIsoModuleHandler::OutputRegistryCommands ( string& livecdDirectory ) +{ + string system32ConfigDirectory = NormalizeFilename ( + MingwModuleHandler::PassThruCacheDirectory ( + livecdDirectory + SSEP "system32" SSEP "config" SSEP, + backend->outputDirectory ) ); + fprintf ( fMakefile, + "\t$(ECHO_MKHIVE)\n" ); + fprintf ( fMakefile, + "\t$(MKHIVE_TARGET) bootdata %s bootdata" SSEP "livecd.inf bootdata" SSEP "hiveinst.inf\n", + system32ConfigDirectory.c_str () ); +} + +void +MingwLiveIsoModuleHandler::GenerateLiveIsoModuleTarget () +{ + string livecdDirectory = "livecd"; + string livecd = PassThruCacheDirectory ( + NormalizeFilename ( livecdDirectory + SSEP ), + backend->outputDirectory ); + string isoboot = PassThruCacheDirectory ( + NormalizeFilename ( "boot" SSEP "freeldr" SSEP "bootsect" SSEP "isoboot.o" ), + backend->outputDirectory ); + string reactosDirectory = "reactos"; + string livecdReactosNoFixup = livecdDirectory + SSEP + reactosDirectory; + string livecdReactos = NormalizeFilename ( PassThruCacheDirectory ( + NormalizeFilename ( livecdReactosNoFixup + SSEP ), + backend->outputDirectory ) ); + CLEAN_FILE ( livecdReactos ); + + fprintf ( fMakefile, ".PHONY: %s\n\n", + module.name.c_str ()); + fprintf ( fMakefile, + "%s: all %s %s $(MKHIVE_TARGET) $(CDMAKE_TARGET)\n", + module.name.c_str (), + isoboot.c_str (), + livecdReactos.c_str () ); + OutputModuleCopyCommands ( livecdDirectory, + reactosDirectory ); + OutputNonModuleCopyCommands ( livecdDirectory, + reactosDirectory ); + OutputProfilesDirectoryCommands ( livecdDirectory ); + OutputLoaderCommands ( livecdDirectory ); + OutputRegistryCommands ( livecdDirectory ); + fprintf ( fMakefile, "\t$(ECHO_CDMAKE)\n" ); + fprintf ( fMakefile, + "\t$(Q)$(CDMAKE_TARGET) -v -m -j -b %s %s REACTOS ReactOS-LiveCD.iso\n", + isoboot.c_str (), + livecd.c_str () ); + fprintf ( fMakefile, + "\n" ); +} + + MingwTestModuleHandler::MingwTestModuleHandler ( const Module& module_ )
_____
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-04-19 17:13:34 UTC (rev 14704) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler .h 2005-04-19 20:52:49 UTC (rev 14705) @@ -345,6 +345,28 @@
};
+class MingwLiveIsoModuleHandler : public MingwModuleHandler +{ +public: + MingwLiveIsoModuleHandler ( const Module& module ); + virtual HostType DefaultHost() { return HostFalse; } + virtual void Process (); +private: + void GenerateLiveIsoModuleTarget (); + void CreateDirectory ( const std::string& directory ); + void OutputCopyCommand ( const std::string& sourceFilename, + const std::string& targetFilename, + const std::string& targetDirectory ); + void OutputModuleCopyCommands ( std::string& livecdDirectory, + std::string& livecdReactos ); + void OutputNonModuleCopyCommands ( std::string& livecdDirectory, + std::string& livecdReactos ); + void OutputProfilesDirectoryCommands ( std::string& livecdDirectory ); + void OutputLoaderCommands ( std::string& livecdDirectory ); + void OutputRegistryCommands ( std::string& livecdDirectory ); +}; + + class MingwTestModuleHandler : public MingwModuleHandler { public: _____
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/bootstrap.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/bootstrap.cpp 2005-04-19 17:13:34 UTC (rev 14704) +++ branches/xmlbuildsystem/reactos/tools/rbuild/bootstrap.cpp 2005-04-19 20:52:49 UTC (rev 14705) @@ -39,6 +39,7 @@
case StaticLibrary: case ObjectLibrary: case Iso: + case LiveIso: case Test: case RpcServer: case RpcClient: _____
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-04-19 17:13:34 UTC (rev 14704) +++ branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-04-19 20:52:49 UTC (rev 14705) @@ -462,6 +462,8 @@
return BootSector; if ( attribute.value == "iso" ) return Iso; + if ( attribute.value == "liveiso" ) + return LiveIso; if ( attribute.value == "test" ) return Test; if ( attribute.value == "rpcserver" ) @@ -499,6 +501,7 @@ case BootSector: return ".o"; case Iso: + case LiveIso: return ".iso"; case Test: return ".exe"; @@ -539,6 +542,7 @@ case BootLoader: case BootSector: case Iso: + case LiveIso: case RpcServer: case RpcClient: return ""; @@ -575,6 +579,7 @@ case BootLoader: case BootSector: case Iso: + case LiveIso: case RpcServer: case RpcClient: return ""; _____
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h --- branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-04-19 17:13:34 UTC (rev 14704) +++ branches/xmlbuildsystem/reactos/tools/rbuild/rbuild.h 2005-04-19 20:52:49 UTC (rev 14705) @@ -137,6 +137,7 @@
BootLoader, BootSector, Iso, + LiveIso, Test, RpcServer, RpcClient