From 96969f6dc78d4ca94945d1b33a3bbc8da15e73f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sun, 20 Feb 2005 22:40:30 +0000 Subject: [PATCH] Allow HAL choice during first stage setup svn path=/trunk/; revision=13698 --- reactos/bootdata/txtsetup.sif | 10 ++++- reactos/subsys/system/usetup/infcache.c | 2 +- reactos/subsys/system/usetup/settings.c | 23 +++++++++++ reactos/subsys/system/usetup/settings.h | 5 +++ reactos/subsys/system/usetup/usetup.c | 52 +++++++++++++++++++------ reactos/tools/helper.mk | 6 +++ 6 files changed, 84 insertions(+), 14 deletions(-) diff --git a/reactos/bootdata/txtsetup.sif b/reactos/bootdata/txtsetup.sif index ba598083a4d..962438c9aed 100644 --- a/reactos/bootdata/txtsetup.sif +++ b/reactos/bootdata/txtsetup.sif @@ -22,7 +22,6 @@ cdrom.sys = 3 class2.sys = 3 disk.sys = 3 floppy.sys = 3 -hal.dll = 2 keyboard.sys = 3 l_intl.nls = 2 ntfs.sys = 3 @@ -48,6 +47,15 @@ DefaultLayout = 00000409 [Computer] pci_up = "Standard-PC" +pci_mp = "Standard-PC Multiprocessor" + +[Files.pci_up] +; = , +hal.dll = 2 + +[Files.pci_mp] +; = , +halmp.dll = 2,hal.dll [Display] ; = ,, diff --git a/reactos/subsys/system/usetup/infcache.c b/reactos/subsys/system/usetup/infcache.c index 3d02173dfb8..43e1280b0de 100644 --- a/reactos/subsys/system/usetup/infcache.c +++ b/reactos/subsys/system/usetup/infcache.c @@ -1294,7 +1294,7 @@ InfGetLineCount(HINF InfHandle, /* Iterate through list of sections */ CacheSection = Cache->FirstSection; - while (Section != NULL) + while (CacheSection != NULL) { DPRINT("Comparing '%S' and '%S'\n", CacheSection->Name, Section); diff --git a/reactos/subsys/system/usetup/settings.c b/reactos/subsys/system/usetup/settings.c index 56fa495db4f..c5944ee56b6 100644 --- a/reactos/subsys/system/usetup/settings.c +++ b/reactos/subsys/system/usetup/settings.c @@ -29,6 +29,7 @@ #include "precomp.h" #include #include +#include #include "usetup.h" #include "infcache.h" @@ -352,6 +353,28 @@ CreateDisplayDriverList(HINF InfFile) return List; } +BOOLEAN +ProcessComputerFiles(HINF InfFile, PGENERIC_LIST List, PWCHAR* AdditionalSectionName) +{ + PGENERIC_LIST_ENTRY Entry; + static WCHAR SectionName[128]; + + DPRINT("ProcessComputerFiles() called\n"); + + Entry = GetGenericListEntry(List); + if (Entry == NULL) + { + DPRINT("GetGenericListEntry() failed\n"); + return FALSE; + } + + wcscpy(SectionName, L"Files."); + wcscat(SectionName, Entry->UserData); + *AdditionalSectionName = SectionName; + + return TRUE; +} + BOOLEAN ProcessDisplayRegistry(HINF InfFile, PGENERIC_LIST List) diff --git a/reactos/subsys/system/usetup/settings.h b/reactos/subsys/system/usetup/settings.h index a4177fe69b2..86ee7dc0173 100644 --- a/reactos/subsys/system/usetup/settings.h +++ b/reactos/subsys/system/usetup/settings.h @@ -33,6 +33,11 @@ CreateComputerTypeList(HINF InfFile); PGENERIC_LIST CreateDisplayDriverList(HINF InfFile); +BOOLEAN +ProcessComputerFiles(HINF InfFile, + PGENERIC_LIST List, + PWCHAR* AdditionalSectionName); + BOOLEAN ProcessDisplayRegistry(HINF InfFile, PGENERIC_LIST List); diff --git a/reactos/subsys/system/usetup/usetup.c b/reactos/subsys/system/usetup/usetup.c index fc15bc73acf..512e86f54a7 100644 --- a/reactos/subsys/system/usetup/usetup.c +++ b/reactos/subsys/system/usetup/usetup.c @@ -2301,6 +2301,7 @@ FormatPartitionPage (PINPUT_RECORD Ir) #ifndef NDEBUG ULONG Line; ULONG i; + PLIST_ENTRY Entry; #endif @@ -2761,27 +2762,24 @@ InstallDirectoryPage(PINPUT_RECORD Ir) static BOOLEAN -PrepareCopyPageInfFile(HINF InfFile, +AddSectionToCopyQueue(HINF InfFile, + PWCHAR SectionName, PWCHAR SourceCabinet, PINPUT_RECORD Ir) { - WCHAR PathBuffer[MAX_PATH]; INFCONTEXT FilesContext; INFCONTEXT DirContext; - PWCHAR KeyValue; - ULONG Length; - NTSTATUS Status; PWCHAR FileKeyName; PWCHAR FileKeyValue; PWCHAR DirKeyValue; PWCHAR TargetFileName; - - /* Search for the 'SourceFiles' section */ - if (!InfFindFirstLine (InfFile, L"SourceFiles", NULL, &FilesContext)) + + /* Search for the SectionName section */ + if (!InfFindFirstLine (InfFile, SectionName, NULL, &FilesContext)) { - PopupError("Setup failed to find the 'SourceFiles' section\n" - "in TXTSETUP.SIF.\n", // FIXME - "ENTER = Reboot computer"); + char Buffer[128]; + sprintf(Buffer, "Setup failed to find the '%S' section\nin TXTSETUP.SIF.\n", SectionName); + PopupError(Buffer, "ENTER = Reboot computer"); while(TRUE) { @@ -2795,7 +2793,7 @@ PrepareCopyPageInfFile(HINF InfFile, } /* - * Enumerate the files in the 'SourceFiles' section + * Enumerate the files in the section * and add them to the file queue. */ do @@ -2842,8 +2840,38 @@ PrepareCopyPageInfFile(HINF InfFile, } } while (InfFindNextLine(&FilesContext, &FilesContext)); + + return TRUE; +} +static BOOLEAN +PrepareCopyPageInfFile(HINF InfFile, + PWCHAR SourceCabinet, + PINPUT_RECORD Ir) +{ + WCHAR PathBuffer[MAX_PATH]; + INFCONTEXT DirContext; + PWCHAR AdditionalSectionName; + PWCHAR KeyValue; + ULONG Length; + NTSTATUS Status; + /* Add common files */ + if (!AddSectionToCopyQueue(InfFile, L"SourceFiles", SourceCabinet, Ir)) + return FALSE; + + /* Add specific files depending of computer type */ + if (SourceCabinet == NULL) + { + if (!ProcessComputerFiles(InfFile, ComputerList, &AdditionalSectionName)) + return FALSE; + if (AdditionalSectionName) + { + if (!AddSectionToCopyQueue(InfFile, AdditionalSectionName, SourceCabinet, Ir)) + return FALSE; + } + } + /* Create directories */ /* diff --git a/reactos/tools/helper.mk b/reactos/tools/helper.mk index 575295d827b..6bded590b5f 100644 --- a/reactos/tools/helper.mk +++ b/reactos/tools/helper.mk @@ -295,6 +295,12 @@ ifeq ($(TARGET_TYPE),hal) MK_RES_BASE := $(TARGET_NAME) MK_INSTALL_BASENAME := hal MK_INSTALL_FULLNAME := hal.dll + ifeq ($(TARGET_BOOTSTRAP),yes) + TARGET_BOOTSTRAP_NAME := hal.dll + else + TARGET_BOOTSTRAP_NAME := $(TARGET_NAME)$(MK_DEFEXT) + endif + TARGET_BOOTSTRAP := yes endif ifeq ($(TARGET_TYPE),bootpgm)