Author: silverblade Date: Wed Jan 21 13:45:08 2009 New Revision: 39004
URL: http://svn.reactos.org/svn/reactos?rev=39004&view=rev Log: 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.
Added: trunk/reactos/boot/bootdata/bootcd.ini (with props) Modified: trunk/reactos/boot/bootdata/bootdata.rbuild trunk/reactos/boot/freeldr/freeldr/bootmgr.c trunk/reactos/boot/freeldr/freeldr/freeldr_base.rbuild trunk/reactos/boot/freeldr/freeldr/freeldr_main.rbuild trunk/reactos/boot/freeldr/freeldr/include/freeldr.h trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c trunk/reactos/boot/freeldr/freeldr/setupldr_main.rbuild trunk/reactos/ntoskrnl/io/iomgr/arcname.c
Added: trunk/reactos/boot/bootdata/bootcd.ini URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/bootcd.ini?re... ============================================================================== --- trunk/reactos/boot/bootdata/bootcd.ini (added) +++ trunk/reactos/boot/bootdata/bootcd.ini [iso-8859-1] Wed Jan 21 13:45:08 2009 @@ -1,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
Propchange: trunk/reactos/boot/bootdata/bootcd.ini ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/reactos/boot/bootdata/bootdata.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/bootdata.rbui... ============================================================================== --- trunk/reactos/boot/bootdata/bootdata.rbuild [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/bootdata.rbuild [iso-8859-1] Wed Jan 21 13:45:08 2009 @@ -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>
Modified: trunk/reactos/boot/freeldr/freeldr/bootmgr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/bootmg... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/bootmgr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/bootmgr.c [iso-8859-1] Wed Jan 21 13:45:08 2009 @@ -115,6 +115,14 @@ { 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) {
Modified: trunk/reactos/boot/freeldr/freeldr/freeldr_base.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freeld... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/freeldr_base.rbuild [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/freeldr_base.rbuild [iso-8859-1] Wed Jan 21 13:45:08 2009 @@ -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>
Modified: trunk/reactos/boot/freeldr/freeldr/freeldr_main.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freeld... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/freeldr_main.rbuild [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/freeldr_main.rbuild [iso-8859-1] Wed Jan 21 13:45:08 2009 @@ -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>
Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] Wed Jan 21 13:45:08 2009 @@ -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
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/reacto... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c [iso-8859-1] Wed Jan 21 13:45:08 2009 @@ -42,7 +42,7 @@
#define USE_UI
-VOID RunLoader(VOID) +VOID LoadReactOSSetup(VOID) { ULONG i; LPCSTR SourcePath;
Modified: trunk/reactos/boot/freeldr/freeldr/setupldr_main.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/setupl... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/setupldr_main.rbuild [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/setupldr_main.rbuild [iso-8859-1] Wed Jan 21 13:45:08 2009 @@ -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>
Modified: trunk/reactos/ntoskrnl/io/iomgr/arcname.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/arcname.c... ============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/arcname.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/arcname.c [iso-8859-1] Wed Jan 21 13:45:08 2009 @@ -29,19 +29,22 @@ 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 @@ { /* 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 @@ 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; }