Author: hpoussin
Date: Tue Oct 2 16:23:40 2007
New Revision: 29353
URL:
http://svn.reactos.org/svn/reactos?rev=29353&view=rev
Log:
Support "i386" as an alternative name for cdrom directory
Modified:
trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/setupldr.c Tue Oct 2 16:23:40 2007
@@ -167,9 +167,20 @@
VOID RunLoader(VOID)
{
ULONG_PTR Base;
- ULONG Size;
+ ULONG Size, i;
const char *SourcePath;
const char *LoadOptions = "", *DbgLoadOptions = "";
+ const char *sourcePaths[] = {
+ "", /* Only for floppy boot */
+#if defined(_M_IX86)
+ "\\I386",
+#elif defined(_M_MPPC)
+ "\\PPC",
+#elif defined(_M_MRX000)
+ "\\MIPS",
+#endif
+ "\\reactos",
+ NULL };
char szKernelName[256];
HINF InfHandle;
@@ -246,13 +257,21 @@
}
/* Open 'txtsetup.sif' */
- if (!InfOpenFile (&InfHandle,
- MachDiskBootingFromFloppy() ? "\\txtsetup.sif" :
"\\reactos\\txtsetup.sif",
- &ErrorLine))
+ for (i = MachDiskBootingFromFloppy() ? 0 : 1; ; i++)
+ {
+ SourcePath = sourcePaths[i];
+ if (!SourcePath)
{
printf("Failed to open 'txtsetup.sif'\n");
return;
}
+ strcpy(szKernelName, SourcePath);
+ strcat(szKernelName, "\\txtsetup.sif");
+ if (InfOpenFile (&InfHandle, szKernelName, &ErrorLine))
+ break;
+ }
+ if (!*SourcePath)
+ SourcePath = "\\";
#ifdef DBG
/* Get load options */
@@ -284,17 +303,6 @@
#if 0
printf("LoadOptions: '%s'\n", LoadOptions);
#endif
-
- if (MachDiskBootingFromFloppy())
- {
- /* Boot from floppy disk */
- SourcePath = "\\";
- }
- else
- {
- /* Boot from cdrom */
- SourcePath = "\\reactos";
- }
/* Set kernel command line */
MachDiskGetBootPath(reactos_kernel_cmdline, sizeof(reactos_kernel_cmdline));