mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 02:43:38 +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>autorun.inf</cdfile>
|
||||||
<cdfile>icon.ico</cdfile>
|
<cdfile>icon.ico</cdfile>
|
||||||
<cdfile>readme.txt</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="hivecls.inf">hivecls_$(ARCH).inf</cdfile>
|
||||||
<cdfile installbase="$(CDOUTPUT)" nameoncd="hivedef.inf">hivedef_$(ARCH).inf</cdfile>
|
<cdfile installbase="$(CDOUTPUT)" nameoncd="hivedef.inf">hivedef_$(ARCH).inf</cdfile>
|
||||||
|
|
|
@ -115,6 +115,14 @@ VOID RunLoader(VOID)
|
||||||
{
|
{
|
||||||
LoadAndBootReactOS(OperatingSystemSectionNames[SelectedOperatingSystem]);
|
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__
|
#ifdef __i386__
|
||||||
else if (_stricmp(SettingValue, "WindowsNT40") == 0)
|
else if (_stricmp(SettingValue, "WindowsNT40") == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,4 +80,10 @@
|
||||||
<directory name="include">
|
<directory name="include">
|
||||||
<pch>freeldr.h</pch>
|
<pch>freeldr.h</pch>
|
||||||
</directory>
|
</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>
|
</module>
|
||||||
|
|
|
@ -7,10 +7,4 @@
|
||||||
<compilerflag>-fno-inline</compilerflag>
|
<compilerflag>-fno-inline</compilerflag>
|
||||||
<compilerflag>-fno-zero-initialized-in-bss</compilerflag>
|
<compilerflag>-fno-zero-initialized-in-bss</compilerflag>
|
||||||
<file>bootmgr.c</file>
|
<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>
|
</module>
|
||||||
|
|
|
@ -108,4 +108,7 @@
|
||||||
VOID BootMain(LPSTR CmdLine);
|
VOID BootMain(LPSTR CmdLine);
|
||||||
VOID RunLoader(VOID);
|
VOID RunLoader(VOID);
|
||||||
|
|
||||||
|
/* Special hack for ReactOS setup OS type */
|
||||||
|
VOID LoadReactOSSetup(VOID);
|
||||||
|
|
||||||
#endif // defined __FREELDR_H
|
#endif // defined __FREELDR_H
|
||||||
|
|
|
@ -42,7 +42,7 @@ extern BOOLEAN FrLdrLoadNlsFile(PCSTR szFileName, PCSTR szModuleName);
|
||||||
|
|
||||||
#define USE_UI
|
#define USE_UI
|
||||||
|
|
||||||
VOID RunLoader(VOID)
|
VOID LoadReactOSSetup(VOID)
|
||||||
{
|
{
|
||||||
ULONG i;
|
ULONG i;
|
||||||
LPCSTR SourcePath;
|
LPCSTR SourcePath;
|
||||||
|
|
|
@ -4,11 +4,13 @@
|
||||||
<include base="setupldr_main">include</include>
|
<include base="setupldr_main">include</include>
|
||||||
<include base="ntoskrnl">include</include>
|
<include base="ntoskrnl">include</include>
|
||||||
<define name="_NTHAL_" />
|
<define name="_NTHAL_" />
|
||||||
|
<define name="FREELDR_REACTOS_SETUP" />
|
||||||
<compilerflag>-ffreestanding</compilerflag>
|
<compilerflag>-ffreestanding</compilerflag>
|
||||||
<compilerflag>-fno-builtin</compilerflag>
|
<compilerflag>-fno-builtin</compilerflag>
|
||||||
<compilerflag>-fno-inline</compilerflag>
|
<compilerflag>-fno-inline</compilerflag>
|
||||||
<compilerflag>-fno-zero-initialized-in-bss</compilerflag>
|
<compilerflag>-fno-zero-initialized-in-bss</compilerflag>
|
||||||
<compilerflag>-Os</compilerflag>
|
<compilerflag>-Os</compilerflag>
|
||||||
|
<file>bootmgr.c</file>
|
||||||
<directory name="inffile">
|
<directory name="inffile">
|
||||||
<file>inffile.c</file>
|
<file>inffile.c</file>
|
||||||
</directory>
|
</directory>
|
||||||
|
|
|
@ -29,19 +29,22 @@ IopApplyRosCdromArcHack(IN ULONG i)
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
ANSI_STRING InstallName;
|
ANSI_STRING InstallName;
|
||||||
UNICODE_STRING DeviceName;
|
UNICODE_STRING DeviceName;
|
||||||
CHAR Buffer[128];
|
CHAR Buffer[128], RosSysPath[16];
|
||||||
FILE_BASIC_INFORMATION FileInfo;
|
FILE_BASIC_INFORMATION FileInfo;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PCHAR p, q;
|
PCHAR p, q;
|
||||||
PCONFIGURATION_INFORMATION ConfigInfo = IoGetConfigurationInformation();
|
PCONFIGURATION_INFORMATION ConfigInfo = IoGetConfigurationInformation();
|
||||||
extern BOOLEAN InitIsWinPEMode, ExpInTextModeSetup;
|
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 */
|
/* Only ARC Name left - Build full ARC Name */
|
||||||
p = strstr(KeLoaderBlock->ArcBootDeviceName, "cdrom");
|
p = strstr(KeLoaderBlock->ArcBootDeviceName, "cdrom");
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
/* Build installer name */
|
/* 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);
|
RtlInitAnsiString(&InstallName, Buffer);
|
||||||
Status = RtlAnsiStringToUnicodeString(&DeviceName, &InstallName, TRUE);
|
Status = RtlAnsiStringToUnicodeString(&DeviceName, &InstallName, TRUE);
|
||||||
if (!NT_SUCCESS(Status)) return FALSE;
|
if (!NT_SUCCESS(Status)) return FALSE;
|
||||||
|
@ -67,8 +70,8 @@ IopApplyRosCdromArcHack(IN ULONG i)
|
||||||
{
|
{
|
||||||
/* Build live CD kernel name */
|
/* Build live CD kernel name */
|
||||||
sprintf(Buffer,
|
sprintf(Buffer,
|
||||||
"\\Device\\CdRom%lu\\reactos\\system32\\ntoskrnl.exe",
|
"\\Device\\CdRom%lu\\%s\\system32\\ntoskrnl.exe",
|
||||||
i);
|
i, RosSysPath);
|
||||||
RtlInitAnsiString(&InstallName, Buffer);
|
RtlInitAnsiString(&InstallName, Buffer);
|
||||||
Status = RtlAnsiStringToUnicodeString(&DeviceName,
|
Status = RtlAnsiStringToUnicodeString(&DeviceName,
|
||||||
&InstallName,
|
&InstallName,
|
||||||
|
@ -112,7 +115,7 @@ IopApplyRosCdromArcHack(IN ULONG i)
|
||||||
if ((InitIsWinPEMode) || (ExpInTextModeSetup))
|
if ((InitIsWinPEMode) || (ExpInTextModeSetup))
|
||||||
{
|
{
|
||||||
/* Hack until IoAssignDriveLetters is fixed */
|
/* Hack until IoAssignDriveLetters is fixed */
|
||||||
swprintf(SharedUserData->NtSystemRoot, L"%c:\\reactos", 'C' + DeviceNumber);
|
swprintf(SharedUserData->NtSystemRoot, L"%c:\\%hs", 'C' + DeviceNumber, RosSysPath);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue