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
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]
; <filename> = <directory_id>,<new name>
hal.dll = 2
[Files.pci_mp]
; <filename> = <directory_id>,<new name>
halmp.dll = 2,hal.dll
[Display]
;<id> = <user friendly name>,<spare>,<service key name>

View file

@ -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);

View file

@ -29,6 +29,7 @@
#include "precomp.h"
#include <ntdll/rtl.h>
#include <ntos/minmax.h>
#include <rosrtl/string.h>
#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)

View file

@ -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);

View file

@ -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 */
/*

View file

@ -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)