mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Allow hybrid install/live CD by providing special FreeLdr OS type that gets
used only on the bootcd, for calling setupldr. Also added bootcd.ini which becomes freeldr.ini on the bootcd. My previous attempt omitted this, so bootcd broke. I have tested bootcd and livecd successfully. Also made it easier to specify a different path in IopApplyRosCdromArcHack. svn path=/trunk/; revision=39004
This commit is contained in:
parent
f368fdbf9a
commit
fc53f8c890
9 changed files with 55 additions and 12 deletions
26
reactos/boot/bootdata/bootcd.ini
Normal file
26
reactos/boot/bootdata/bootcd.ini
Normal file
|
@ -0,0 +1,26 @@
|
|||
[FREELOADER]
|
||||
DefaultOS=Setup
|
||||
Timeout=0
|
||||
|
||||
[Display]
|
||||
TitleText=ReactOS Setup
|
||||
StatusBarColor=Cyan
|
||||
StatusBarTextColor=Black
|
||||
BackdropTextColor=White
|
||||
BackdropColor=Blue
|
||||
BackdropFillStyle=Medium
|
||||
TitleBoxTextColor=White
|
||||
TitleBoxColor=Red
|
||||
MessageBoxTextColor=White
|
||||
MessageBoxColor=Blue
|
||||
MenuTextColor=White
|
||||
MenuColor=Blue
|
||||
TextColor=Yellow
|
||||
SelectedTextColor=Black
|
||||
SelectedColor=Gray
|
||||
|
||||
[Operating Systems]
|
||||
Setup="Setup"
|
||||
|
||||
[Setup]
|
||||
BootType=ReactOSSetup
|
|
@ -4,6 +4,7 @@
|
|||
<cdfile>autorun.inf</cdfile>
|
||||
<cdfile>icon.ico</cdfile>
|
||||
<cdfile>readme.txt</cdfile>
|
||||
<cdfile nameoncd="freeldr.ini">bootcd.ini</cdfile>
|
||||
|
||||
<cdfile installbase="$(CDOUTPUT)" nameoncd="hivecls.inf">hivecls_$(ARCH).inf</cdfile>
|
||||
<cdfile installbase="$(CDOUTPUT)" nameoncd="hivedef.inf">hivedef_$(ARCH).inf</cdfile>
|
||||
|
|
|
@ -115,6 +115,14 @@ VOID RunLoader(VOID)
|
|||
{
|
||||
LoadAndBootReactOS(OperatingSystemSectionNames[SelectedOperatingSystem]);
|
||||
}
|
||||
#ifdef FREELDR_REACTOS_SETUP
|
||||
else if (_stricmp(SettingValue, "ReactOSSetup") == 0)
|
||||
{
|
||||
// In future we could pass the selected OS details through this
|
||||
// to have different install methods, etc.
|
||||
LoadReactOSSetup();
|
||||
}
|
||||
#endif
|
||||
#ifdef __i386__
|
||||
else if (_stricmp(SettingValue, "WindowsNT40") == 0)
|
||||
{
|
||||
|
|
|
@ -80,4 +80,10 @@
|
|||
<directory name="include">
|
||||
<pch>freeldr.h</pch>
|
||||
</directory>
|
||||
<file>drivemap.c</file>
|
||||
<file>miscboot.c</file>
|
||||
<file>options.c</file>
|
||||
<file>linuxboot.c</file>
|
||||
<file>oslist.c</file>
|
||||
<file>custom.c</file>
|
||||
</module>
|
||||
|
|
|
@ -7,10 +7,4 @@
|
|||
<compilerflag>-fno-inline</compilerflag>
|
||||
<compilerflag>-fno-zero-initialized-in-bss</compilerflag>
|
||||
<file>bootmgr.c</file>
|
||||
<file>drivemap.c</file>
|
||||
<file>miscboot.c</file>
|
||||
<file>options.c</file>
|
||||
<file>linuxboot.c</file>
|
||||
<file>oslist.c</file>
|
||||
<file>custom.c</file>
|
||||
</module>
|
||||
|
|
|
@ -108,4 +108,7 @@
|
|||
VOID BootMain(LPSTR CmdLine);
|
||||
VOID RunLoader(VOID);
|
||||
|
||||
/* Special hack for ReactOS setup OS type */
|
||||
VOID LoadReactOSSetup(VOID);
|
||||
|
||||
#endif // defined __FREELDR_H
|
||||
|
|
|
@ -42,7 +42,7 @@ extern BOOLEAN FrLdrLoadNlsFile(PCSTR szFileName, PCSTR szModuleName);
|
|||
|
||||
#define USE_UI
|
||||
|
||||
VOID RunLoader(VOID)
|
||||
VOID LoadReactOSSetup(VOID)
|
||||
{
|
||||
ULONG i;
|
||||
LPCSTR SourcePath;
|
||||
|
|
|
@ -4,11 +4,13 @@
|
|||
<include base="setupldr_main">include</include>
|
||||
<include base="ntoskrnl">include</include>
|
||||
<define name="_NTHAL_" />
|
||||
<define name="FREELDR_REACTOS_SETUP" />
|
||||
<compilerflag>-ffreestanding</compilerflag>
|
||||
<compilerflag>-fno-builtin</compilerflag>
|
||||
<compilerflag>-fno-inline</compilerflag>
|
||||
<compilerflag>-fno-zero-initialized-in-bss</compilerflag>
|
||||
<compilerflag>-Os</compilerflag>
|
||||
<file>bootmgr.c</file>
|
||||
<directory name="inffile">
|
||||
<file>inffile.c</file>
|
||||
</directory>
|
||||
|
|
|
@ -29,19 +29,22 @@ IopApplyRosCdromArcHack(IN ULONG i)
|
|||
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||
ANSI_STRING InstallName;
|
||||
UNICODE_STRING DeviceName;
|
||||
CHAR Buffer[128];
|
||||
CHAR Buffer[128], RosSysPath[16];
|
||||
FILE_BASIC_INFORMATION FileInfo;
|
||||
NTSTATUS Status;
|
||||
PCHAR p, q;
|
||||
PCONFIGURATION_INFORMATION ConfigInfo = IoGetConfigurationInformation();
|
||||
extern BOOLEAN InitIsWinPEMode, ExpInTextModeSetup;
|
||||
|
||||
/* Change this if you want ROS to boot properly from another directory */
|
||||
sprintf(RosSysPath, "%s", "reactos");
|
||||
|
||||
/* Only ARC Name left - Build full ARC Name */
|
||||
p = strstr(KeLoaderBlock->ArcBootDeviceName, "cdrom");
|
||||
if (p)
|
||||
{
|
||||
/* Build installer name */
|
||||
sprintf(Buffer, "\\Device\\CdRom%lu\\reactos\\ntoskrnl.exe", i);
|
||||
sprintf(Buffer, "\\Device\\CdRom%lu\\%s\\ntoskrnl.exe", i, RosSysPath);
|
||||
RtlInitAnsiString(&InstallName, Buffer);
|
||||
Status = RtlAnsiStringToUnicodeString(&DeviceName, &InstallName, TRUE);
|
||||
if (!NT_SUCCESS(Status)) return FALSE;
|
||||
|
@ -67,8 +70,8 @@ IopApplyRosCdromArcHack(IN ULONG i)
|
|||
{
|
||||
/* Build live CD kernel name */
|
||||
sprintf(Buffer,
|
||||
"\\Device\\CdRom%lu\\reactos\\system32\\ntoskrnl.exe",
|
||||
i);
|
||||
"\\Device\\CdRom%lu\\%s\\system32\\ntoskrnl.exe",
|
||||
i, RosSysPath);
|
||||
RtlInitAnsiString(&InstallName, Buffer);
|
||||
Status = RtlAnsiStringToUnicodeString(&DeviceName,
|
||||
&InstallName,
|
||||
|
@ -112,7 +115,7 @@ IopApplyRosCdromArcHack(IN ULONG i)
|
|||
if ((InitIsWinPEMode) || (ExpInTextModeSetup))
|
||||
{
|
||||
/* Hack until IoAssignDriveLetters is fixed */
|
||||
swprintf(SharedUserData->NtSystemRoot, L"%c:\\reactos", 'C' + DeviceNumber);
|
||||
swprintf(SharedUserData->NtSystemRoot, L"%c:\\%hs", 'C' + DeviceNumber, RosSysPath);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue