mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:36:11 +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
4 changed files with 34 additions and 58 deletions
|
@ -9,8 +9,12 @@ add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/hivesys_${ARCH}.inf DESTINATION rea
|
||||||
|
|
||||||
# livecd hives
|
# livecd hives
|
||||||
list(APPEND CD_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}/livecd.inf
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/hiveinst_${ARCH}.inf)
|
${CMAKE_CURRENT_SOURCE_DIR}/hiveinst_${ARCH}.inf)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sam
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sam
|
||||||
|
@ -18,7 +22,7 @@ add_custom_command(
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/security
|
${CMAKE_CURRENT_BINARY_DIR}/security
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/software
|
${CMAKE_CURRENT_BINARY_DIR}/software
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/system
|
${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})
|
DEPENDS native-mkhive ${CD_HIVES})
|
||||||
|
|
||||||
add_custom_target(livecd_hives
|
add_custom_target(livecd_hives
|
||||||
|
|
|
@ -49,11 +49,9 @@
|
||||||
|
|
||||||
void usage (void)
|
void usage (void)
|
||||||
{
|
{
|
||||||
printf ("Usage: mkhive <srcdir> <dstdir> <arch> [addinf]\n\n");
|
printf ("Usage: mkhive <dstdir> <inffiles>\n\n");
|
||||||
printf (" srcdir - inf files are read from this directory\n");
|
printf (" dstdir - binary hive files are created in this directory\n");
|
||||||
printf (" dstdir - binary hive files are created in this directory\n");
|
printf (" inffiles - inf files with full path\n");
|
||||||
printf (" arch - architecture\n");
|
|
||||||
printf (" addinf - additional inf files with full path\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void convert_path(char *dst, char *src)
|
void convert_path(char *dst, char *src)
|
||||||
|
@ -87,53 +85,25 @@ void convert_path(char *dst, char *src)
|
||||||
int main (int argc, char *argv[])
|
int main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char FileName[PATH_MAX];
|
char FileName[PATH_MAX];
|
||||||
int Param;
|
int i;
|
||||||
|
|
||||||
if (argc < 4)
|
if (argc < 3)
|
||||||
{
|
{
|
||||||
usage ();
|
usage ();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf ("Binary hive maker: %s\n", argv[3]);
|
printf ("Binary hive maker\n");
|
||||||
|
|
||||||
RegInitializeRegistry ();
|
RegInitializeRegistry ();
|
||||||
|
|
||||||
convert_path (FileName, argv[1]);
|
for (i = 2; i < argc; i++)
|
||||||
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++)
|
|
||||||
{
|
{
|
||||||
convert_path (FileName, argv[Param]);
|
convert_path (FileName, argv[i]);
|
||||||
ImportRegistryFile (FileName);
|
ImportRegistryFile (FileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
convert_path (FileName, argv[2]);
|
convert_path (FileName, argv[1]);
|
||||||
strcat (FileName, DIR_SEPARATOR_STRING);
|
strcat (FileName, DIR_SEPARATOR_STRING);
|
||||||
strcat (FileName, "default");
|
strcat (FileName, "default");
|
||||||
if (!ExportBinaryHive (FileName, &DefaultHive))
|
if (!ExportBinaryHive (FileName, &DefaultHive))
|
||||||
|
@ -141,7 +111,7 @@ int main (int argc, char *argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
convert_path (FileName, argv[2]);
|
convert_path (FileName, argv[1]);
|
||||||
strcat (FileName, DIR_SEPARATOR_STRING);
|
strcat (FileName, DIR_SEPARATOR_STRING);
|
||||||
strcat (FileName, "sam");
|
strcat (FileName, "sam");
|
||||||
if (!ExportBinaryHive (FileName, &SamHive))
|
if (!ExportBinaryHive (FileName, &SamHive))
|
||||||
|
@ -149,7 +119,7 @@ int main (int argc, char *argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
convert_path (FileName, argv[2]);
|
convert_path (FileName, argv[1]);
|
||||||
strcat (FileName, DIR_SEPARATOR_STRING);
|
strcat (FileName, DIR_SEPARATOR_STRING);
|
||||||
strcat (FileName, "security");
|
strcat (FileName, "security");
|
||||||
if (!ExportBinaryHive (FileName, &SecurityHive))
|
if (!ExportBinaryHive (FileName, &SecurityHive))
|
||||||
|
@ -157,7 +127,7 @@ int main (int argc, char *argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
convert_path (FileName, argv[2]);
|
convert_path (FileName, argv[1]);
|
||||||
strcat (FileName, DIR_SEPARATOR_STRING);
|
strcat (FileName, DIR_SEPARATOR_STRING);
|
||||||
strcat (FileName, "software");
|
strcat (FileName, "software");
|
||||||
if (!ExportBinaryHive (FileName, &SoftwareHive))
|
if (!ExportBinaryHive (FileName, &SoftwareHive))
|
||||||
|
@ -165,7 +135,7 @@ int main (int argc, char *argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
convert_path (FileName, argv[2]);
|
convert_path (FileName, argv[1]);
|
||||||
strcat (FileName, DIR_SEPARATOR_STRING);
|
strcat (FileName, DIR_SEPARATOR_STRING);
|
||||||
strcat (FileName, "system");
|
strcat (FileName, "system");
|
||||||
if (!ExportBinaryHive (FileName, &SystemHive))
|
if (!ExportBinaryHive (FileName, &SystemHive))
|
||||||
|
|
|
@ -1252,17 +1252,17 @@ MingwBackend::OutputModuleInstallTargets ()
|
||||||
}
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
MingwBackend::GetRegistrySourceFiles ()
|
MingwBackend::GetRegistrySourceFiles () const
|
||||||
{
|
{
|
||||||
return "boot" + sSep + "bootdata" + sSep + "hivecls_" + Environment::GetArch() + ".inf "
|
return "boot" + sSep + "bootdata" + sSep + "hivecls_$(ARCH).inf "
|
||||||
"boot" + sSep + "bootdata" + sSep + "hivedef_" + Environment::GetArch() + ".inf "
|
"boot" + sSep + "bootdata" + sSep + "hivedef_$(ARCH).inf "
|
||||||
"boot" + sSep + "bootdata" + sSep + "hiveinst_" + Environment::GetArch() + ".inf "
|
"boot" + sSep + "bootdata" + sSep + "hivesft_$(ARCH).inf "
|
||||||
"boot" + sSep + "bootdata" + sSep + "hivesft_" + Environment::GetArch() + ".inf "
|
"boot" + sSep + "bootdata" + sSep + "hivesys_$(ARCH).inf "
|
||||||
"boot" + sSep + "bootdata" + sSep + "hivesys_" + Environment::GetArch() + ".inf ";
|
"boot" + sSep + "bootdata" + sSep + "hiveinst_$(ARCH).inf ";
|
||||||
}
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
MingwBackend::GetRegistryTargetFiles ()
|
MingwBackend::GetRegistryTargetFiles () const
|
||||||
{
|
{
|
||||||
string system32ConfigDirectory = "system32" + sSep + "config";
|
string system32ConfigDirectory = "system32" + sSep + "config";
|
||||||
FileLocation system32 ( InstallDirectory, system32ConfigDirectory, "" );
|
FileLocation system32 ( InstallDirectory, system32ConfigDirectory, "" );
|
||||||
|
@ -1295,9 +1295,9 @@ MingwBackend::OutputRegistryInstallTarget ()
|
||||||
fprintf ( fMakefile,
|
fprintf ( fMakefile,
|
||||||
"\t$(ECHO_MKHIVE)\n" );
|
"\t$(ECHO_MKHIVE)\n" );
|
||||||
fprintf ( fMakefile,
|
fprintf ( fMakefile,
|
||||||
"\t$(mkhive_TARGET) boot%cbootdata %s $(ARCH) boot%cbootdata%chiveinst_$(ARCH).inf\n",
|
"\t$(mkhive_TARGET) %s %s\n",
|
||||||
cSep, GetFullPath ( system32 ).c_str (),
|
GetFullPath ( system32 ).c_str (),
|
||||||
cSep, cSep );
|
registrySourceFiles.c_str() );
|
||||||
fprintf ( fMakefile,
|
fprintf ( fMakefile,
|
||||||
"\n" );
|
"\n" );
|
||||||
}
|
}
|
||||||
|
|
|
@ -2917,6 +2917,7 @@ MingwLiveIsoModuleHandler::OutputLoaderCommands ( string& livecdDirectory,
|
||||||
void
|
void
|
||||||
MingwLiveIsoModuleHandler::OutputRegistryCommands ( string& livecdDirectory )
|
MingwLiveIsoModuleHandler::OutputRegistryCommands ( string& livecdDirectory )
|
||||||
{
|
{
|
||||||
|
string registrySourceFiles = backend->GetRegistrySourceFiles ();
|
||||||
fprintf ( fMakefile, "# REGISTRY COMMANDS\n" );
|
fprintf ( fMakefile, "# REGISTRY COMMANDS\n" );
|
||||||
FileLocation reactosSystem32ConfigDirectory ( OutputDirectory,
|
FileLocation reactosSystem32ConfigDirectory ( OutputDirectory,
|
||||||
livecdDirectory + sSep + "reactos" + sSep + "system32" + sSep + "config",
|
livecdDirectory + sSep + "reactos" + sSep + "system32" + sSep + "config",
|
||||||
|
@ -2924,9 +2925,10 @@ MingwLiveIsoModuleHandler::OutputRegistryCommands ( string& livecdDirectory )
|
||||||
fprintf ( fMakefile,
|
fprintf ( fMakefile,
|
||||||
"\t$(ECHO_MKHIVE)\n" );
|
"\t$(ECHO_MKHIVE)\n" );
|
||||||
fprintf ( fMakefile,
|
fprintf ( fMakefile,
|
||||||
"\t$(mkhive_TARGET) boot%cbootdata %s $(ARCH) boot%cbootdata%clivecd.inf boot%cbootdata%chiveinst_$(ARCH).inf\n",
|
"\t$(mkhive_TARGET) %s %s boot%cbootdata%clivecd.inf\n",
|
||||||
cSep, backend->GetFullPath ( reactosSystem32ConfigDirectory ).c_str (),
|
backend->GetFullPath ( reactosSystem32ConfigDirectory ).c_str (),
|
||||||
cSep, cSep, cSep, cSep );
|
registrySourceFiles.c_str(),
|
||||||
|
cSep, cSep );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue