Allow HAL choice during first stage setup

svn path=/trunk/; revision=13698
This commit is contained in:
Hervé Poussineau 2005-02-20 22:40:30 +00:00
parent c0cf3a6c0a
commit 96969f6dc7
6 changed files with 84 additions and 14 deletions

View file

@ -22,7 +22,6 @@ cdrom.sys = 3
class2.sys = 3 class2.sys = 3
disk.sys = 3 disk.sys = 3
floppy.sys = 3 floppy.sys = 3
hal.dll = 2
keyboard.sys = 3 keyboard.sys = 3
l_intl.nls = 2 l_intl.nls = 2
ntfs.sys = 3 ntfs.sys = 3
@ -48,6 +47,15 @@ DefaultLayout = 00000409
[Computer] [Computer]
pci_up = "Standard-PC" pci_up = "Standard-PC"
pci_mp = "Standard-PC Multiprocessor"
[Files.pci_up]
; <filename> = <directory_id>,<new name>
hal.dll = 2
[Files.pci_mp]
; <filename> = <directory_id>,<new name>
halmp.dll = 2,hal.dll
[Display] [Display]
;<id> = <user friendly name>,<spare>,<service key name> ;<id> = <user friendly name>,<spare>,<service key name>

View file

@ -1294,7 +1294,7 @@ InfGetLineCount(HINF InfHandle,
/* Iterate through list of sections */ /* Iterate through list of sections */
CacheSection = Cache->FirstSection; CacheSection = Cache->FirstSection;
while (Section != NULL) while (CacheSection != NULL)
{ {
DPRINT("Comparing '%S' and '%S'\n", CacheSection->Name, Section); DPRINT("Comparing '%S' and '%S'\n", CacheSection->Name, Section);

View file

@ -29,6 +29,7 @@
#include "precomp.h" #include "precomp.h"
#include <ntdll/rtl.h> #include <ntdll/rtl.h>
#include <ntos/minmax.h> #include <ntos/minmax.h>
#include <rosrtl/string.h>
#include "usetup.h" #include "usetup.h"
#include "infcache.h" #include "infcache.h"
@ -352,6 +353,28 @@ CreateDisplayDriverList(HINF InfFile)
return List; 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 BOOLEAN
ProcessDisplayRegistry(HINF InfFile, PGENERIC_LIST List) ProcessDisplayRegistry(HINF InfFile, PGENERIC_LIST List)

View file

@ -33,6 +33,11 @@ CreateComputerTypeList(HINF InfFile);
PGENERIC_LIST PGENERIC_LIST
CreateDisplayDriverList(HINF InfFile); CreateDisplayDriverList(HINF InfFile);
BOOLEAN
ProcessComputerFiles(HINF InfFile,
PGENERIC_LIST List,
PWCHAR* AdditionalSectionName);
BOOLEAN BOOLEAN
ProcessDisplayRegistry(HINF InfFile, ProcessDisplayRegistry(HINF InfFile,
PGENERIC_LIST List); PGENERIC_LIST List);

View file

@ -2301,6 +2301,7 @@ FormatPartitionPage (PINPUT_RECORD Ir)
#ifndef NDEBUG #ifndef NDEBUG
ULONG Line; ULONG Line;
ULONG i; ULONG i;
PLIST_ENTRY Entry;
#endif #endif
@ -2761,27 +2762,24 @@ InstallDirectoryPage(PINPUT_RECORD Ir)
static BOOLEAN static BOOLEAN
PrepareCopyPageInfFile(HINF InfFile, AddSectionToCopyQueue(HINF InfFile,
PWCHAR SectionName,
PWCHAR SourceCabinet, PWCHAR SourceCabinet,
PINPUT_RECORD Ir) PINPUT_RECORD Ir)
{ {
WCHAR PathBuffer[MAX_PATH];
INFCONTEXT FilesContext; INFCONTEXT FilesContext;
INFCONTEXT DirContext; INFCONTEXT DirContext;
PWCHAR KeyValue;
ULONG Length;
NTSTATUS Status;
PWCHAR FileKeyName; PWCHAR FileKeyName;
PWCHAR FileKeyValue; PWCHAR FileKeyValue;
PWCHAR DirKeyValue; PWCHAR DirKeyValue;
PWCHAR TargetFileName; PWCHAR TargetFileName;
/* Search for the 'SourceFiles' section */ /* Search for the SectionName section */
if (!InfFindFirstLine (InfFile, L"SourceFiles", NULL, &FilesContext)) if (!InfFindFirstLine (InfFile, SectionName, NULL, &FilesContext))
{ {
PopupError("Setup failed to find the 'SourceFiles' section\n" char Buffer[128];
"in TXTSETUP.SIF.\n", // FIXME sprintf(Buffer, "Setup failed to find the '%S' section\nin TXTSETUP.SIF.\n", SectionName);
"ENTER = Reboot computer"); PopupError(Buffer, "ENTER = Reboot computer");
while(TRUE) 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. * and add them to the file queue.
*/ */
do do
@ -2842,8 +2840,38 @@ PrepareCopyPageInfFile(HINF InfFile,
} }
} }
while (InfFindNextLine(&FilesContext, &FilesContext)); 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 */ /* Create directories */
/* /*

View file

@ -295,6 +295,12 @@ ifeq ($(TARGET_TYPE),hal)
MK_RES_BASE := $(TARGET_NAME) MK_RES_BASE := $(TARGET_NAME)
MK_INSTALL_BASENAME := hal MK_INSTALL_BASENAME := hal
MK_INSTALL_FULLNAME := hal.dll 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 endif
ifeq ($(TARGET_TYPE),bootpgm) ifeq ($(TARGET_TYPE),bootpgm)