Author: rharabien Date: Sat Sep 24 19:59:56 2011 New Revision: 53844
URL: http://svn.reactos.org/svn/reactos?rev=53844&view=rev Log: [MKHIVE] - Get all INF files from command line instead of using hardcoded names [CMAKE] - Use new mkhive syntax and fix livecd hives dependences [RBUILD] - Use new mkhive syntax
Modified: trunk/reactos/boot/bootdata/CMakeLists.txt trunk/reactos/tools/mkhive/mkhive.c trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
Modified: trunk/reactos/boot/bootdata/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/CMakeLists.tx... ============================================================================== --- trunk/reactos/boot/bootdata/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/CMakeLists.txt [iso-8859-1] Sat Sep 24 19:59:56 2011 @@ -9,8 +9,12 @@
# livecd hives list(APPEND CD_HIVES + ${CMAKE_CURRENT_SOURCE_DIR}/hivecls_${ARCH}.inf + ${CMAKE_CURRENT_SOURCE_DIR}/hivedef_${ARCH}.inf + ${CMAKE_CURRENT_SOURCE_DIR}/hivesft_${ARCH}.inf + ${CMAKE_CURRENT_SOURCE_DIR}/hivesys_${ARCH}.inf ${CMAKE_CURRENT_SOURCE_DIR}/livecd.inf - ${CMAKE_CURRENT_SOURCE_DIR}/hiveinst_${ARCH}.inf) + ${CMAKE_CURRENT_SOURCE_DIR}/hiveinst_${ARCH}.inf)
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sam @@ -18,7 +22,7 @@ ${CMAKE_CURRENT_BINARY_DIR}/security ${CMAKE_CURRENT_BINARY_DIR}/software ${CMAKE_CURRENT_BINARY_DIR}/system - COMMAND native-mkhive ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${ARCH} ${CD_HIVES} + COMMAND native-mkhive ${CMAKE_CURRENT_BINARY_DIR} ${CD_HIVES} DEPENDS native-mkhive ${CD_HIVES})
add_custom_target(livecd_hives
Modified: trunk/reactos/tools/mkhive/mkhive.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/mkhive.c?rev=5... ============================================================================== --- trunk/reactos/tools/mkhive/mkhive.c [iso-8859-1] (original) +++ trunk/reactos/tools/mkhive/mkhive.c [iso-8859-1] Sat Sep 24 19:59:56 2011 @@ -49,11 +49,9 @@
void usage (void) { - printf ("Usage: mkhive <srcdir> <dstdir> <arch> [addinf]\n\n"); - printf (" srcdir - inf files are read from this directory\n"); - printf (" dstdir - binary hive files are created in this directory\n"); - printf (" arch - architecture\n"); - printf (" addinf - additional inf files with full path\n"); + printf ("Usage: mkhive <dstdir> <inffiles>\n\n"); + printf (" dstdir - binary hive files are created in this directory\n"); + printf (" inffiles - inf files with full path\n"); }
void convert_path(char *dst, char *src) @@ -87,53 +85,25 @@ int main (int argc, char *argv[]) { char FileName[PATH_MAX]; - int Param; + int i;
- if (argc < 4) + if (argc < 3) { usage (); return 1; }
- printf ("Binary hive maker: %s\n", argv[3]); + printf ("Binary hive maker\n");
RegInitializeRegistry ();
- convert_path (FileName, argv[1]); - strcat (FileName, DIR_SEPARATOR_STRING); - strcat (FileName, "hivesys_"); - strcat (FileName, argv[3]); - strcat (FileName, ".inf"); - ImportRegistryFile (FileName); - - convert_path (FileName, argv[1]); - strcat (FileName, DIR_SEPARATOR_STRING); - strcat (FileName, "hivecls_"); - strcat (FileName, argv[3]); - strcat (FileName, ".inf"); - ImportRegistryFile (FileName); - - convert_path (FileName, argv[1]); - strcat (FileName, DIR_SEPARATOR_STRING); - strcat (FileName, "hivesft_"); - strcat (FileName, argv[3]); - strcat (FileName, ".inf"); - ImportRegistryFile (FileName); - - convert_path (FileName, argv[1]); - strcat (FileName, DIR_SEPARATOR_STRING); - strcat (FileName, "hivedef_"); - strcat (FileName, argv[3]); - strcat (FileName, ".inf"); - ImportRegistryFile (FileName); - - for (Param = 4; Param < argc; Param++) + for (i = 2; i < argc; i++) { - convert_path (FileName, argv[Param]); + convert_path (FileName, argv[i]); ImportRegistryFile (FileName); }
- convert_path (FileName, argv[2]); + convert_path (FileName, argv[1]); strcat (FileName, DIR_SEPARATOR_STRING); strcat (FileName, "default"); if (!ExportBinaryHive (FileName, &DefaultHive)) @@ -141,7 +111,7 @@ return 1; }
- convert_path (FileName, argv[2]); + convert_path (FileName, argv[1]); strcat (FileName, DIR_SEPARATOR_STRING); strcat (FileName, "sam"); if (!ExportBinaryHive (FileName, &SamHive)) @@ -149,7 +119,7 @@ return 1; }
- convert_path (FileName, argv[2]); + convert_path (FileName, argv[1]); strcat (FileName, DIR_SEPARATOR_STRING); strcat (FileName, "security"); if (!ExportBinaryHive (FileName, &SecurityHive)) @@ -157,7 +127,7 @@ return 1; }
- convert_path (FileName, argv[2]); + convert_path (FileName, argv[1]); strcat (FileName, DIR_SEPARATOR_STRING); strcat (FileName, "software"); if (!ExportBinaryHive (FileName, &SoftwareHive)) @@ -165,7 +135,7 @@ return 1; }
- convert_path (FileName, argv[2]); + convert_path (FileName, argv[1]); strcat (FileName, DIR_SEPARATOR_STRING); strcat (FileName, "system"); if (!ExportBinaryHive (FileName, &SystemHive))
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw/... ============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] Sat Sep 24 19:59:56 2011 @@ -1252,17 +1252,17 @@ }
string -MingwBackend::GetRegistrySourceFiles () -{ - return "boot" + sSep + "bootdata" + sSep + "hivecls_" + Environment::GetArch() + ".inf " - "boot" + sSep + "bootdata" + sSep + "hivedef_" + Environment::GetArch() + ".inf " - "boot" + sSep + "bootdata" + sSep + "hiveinst_" + Environment::GetArch() + ".inf " - "boot" + sSep + "bootdata" + sSep + "hivesft_" + Environment::GetArch() + ".inf " - "boot" + sSep + "bootdata" + sSep + "hivesys_" + Environment::GetArch() + ".inf "; +MingwBackend::GetRegistrySourceFiles () const +{ + return "boot" + sSep + "bootdata" + sSep + "hivecls_$(ARCH).inf " + "boot" + sSep + "bootdata" + sSep + "hivedef_$(ARCH).inf " + "boot" + sSep + "bootdata" + sSep + "hivesft_$(ARCH).inf " + "boot" + sSep + "bootdata" + sSep + "hivesys_$(ARCH).inf " + "boot" + sSep + "bootdata" + sSep + "hiveinst_$(ARCH).inf "; }
string -MingwBackend::GetRegistryTargetFiles () +MingwBackend::GetRegistryTargetFiles () const { string system32ConfigDirectory = "system32" + sSep + "config"; FileLocation system32 ( InstallDirectory, system32ConfigDirectory, "" ); @@ -1295,9 +1295,9 @@ fprintf ( fMakefile, "\t$(ECHO_MKHIVE)\n" ); fprintf ( fMakefile, - "\t$(mkhive_TARGET) boot%cbootdata %s $(ARCH) boot%cbootdata%chiveinst_$(ARCH).inf\n", - cSep, GetFullPath ( system32 ).c_str (), - cSep, cSep ); + "\t$(mkhive_TARGET) %s %s\n", + GetFullPath ( system32 ).c_str (), + registrySourceFiles.c_str() ); fprintf ( fMakefile, "\n" ); }
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw/... ============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] Sat Sep 24 19:59:56 2011 @@ -2917,6 +2917,7 @@ void MingwLiveIsoModuleHandler::OutputRegistryCommands ( string& livecdDirectory ) { + string registrySourceFiles = backend->GetRegistrySourceFiles (); fprintf ( fMakefile, "# REGISTRY COMMANDS\n" ); FileLocation reactosSystem32ConfigDirectory ( OutputDirectory, livecdDirectory + sSep + "reactos" + sSep + "system32" + sSep + "config", @@ -2924,9 +2925,10 @@ fprintf ( fMakefile, "\t$(ECHO_MKHIVE)\n" ); fprintf ( fMakefile, - "\t$(mkhive_TARGET) boot%cbootdata %s $(ARCH) boot%cbootdata%clivecd.inf boot%cbootdata%chiveinst_$(ARCH).inf\n", - cSep, backend->GetFullPath ( reactosSystem32ConfigDirectory ).c_str (), - cSep, cSep, cSep, cSep ); + "\t$(mkhive_TARGET) %s %s boot%cbootdata%clivecd.inf\n", + backend->GetFullPath ( reactosSystem32ConfigDirectory ).c_str (), + registrySourceFiles.c_str(), + cSep, cSep ); }
void