mirror of
https://github.com/reactos/reactos.git
synced 2024-06-27 16:31:30 +00:00
[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 svn path=/trunk/; revision=53844
This commit is contained in:
parent
951066d094
commit
cdbf35509d
|
@ -9,8 +9,12 @@ add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivesys_${ARCH}.inf DESTINATION rea
|
|||
|
||||
# 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 @@ add_custom_command(
|
|||
${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
|
||||
|
|
|
@ -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 @@ void convert_path(char *dst, char *src)
|
|||
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 @@ int main (int argc, char *argv[])
|
|||
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 @@ int main (int argc, char *argv[])
|
|||
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 @@ int main (int argc, char *argv[])
|
|||
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 @@ int main (int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
convert_path (FileName, argv[2]);
|
||||
convert_path (FileName, argv[1]);
|
||||
strcat (FileName, DIR_SEPARATOR_STRING);
|
||||
strcat (FileName, "system");
|
||||
if (!ExportBinaryHive (FileName, &SystemHive))
|
||||
|
|
|
@ -1252,17 +1252,17 @@ MingwBackend::OutputModuleInstallTargets ()
|
|||
}
|
||||
|
||||
string
|
||||
MingwBackend::GetRegistrySourceFiles ()
|
||||
MingwBackend::GetRegistrySourceFiles () const
|
||||
{
|
||||
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 ";
|
||||
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 @@ MingwBackend::OutputRegistryInstallTarget ()
|
|||
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" );
|
||||
}
|
||||
|
|
|
@ -2917,6 +2917,7 @@ MingwLiveIsoModuleHandler::OutputLoaderCommands ( string& livecdDirectory,
|
|||
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 @@ MingwLiveIsoModuleHandler::OutputRegistryCommands ( string& livecdDirectory )
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue