From 9b47f9fb33bc0efa22f12ee0ee858affbd288fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Fri, 26 Oct 2007 15:32:04 +0000 Subject: [PATCH] Add a SourceDiskFiles section in txtsetup.sif, instead of hardcoding a list of drivers in freeldr svn path=/trunk/; revision=29900 --- reactos/boot/bootdata/txtsetup.sif | 14 ++++ .../boot/freeldr/freeldr/reactos/setupldr.c | 72 ++++++------------- 2 files changed, 34 insertions(+), 52 deletions(-) diff --git a/reactos/boot/bootdata/txtsetup.sif b/reactos/boot/bootdata/txtsetup.sif index 17d3cfcc2be..52eaa03c8e1 100644 --- a/reactos/boot/bootdata/txtsetup.sif +++ b/reactos/boot/bootdata/txtsetup.sif @@ -11,6 +11,20 @@ Signature = "$ReactOS$" 6 = media\fonts 7 = bin +[SourceDiskFiles] +;acpi.sys=,,,,,,x +;isapnp.sys=,,,,,,x +;pci.sys=,,,,,,x +scsiport.sys=,,,,,,x +class2.sys=,,,,,,x +cdrom.sys=,,,,,,x +cdfs.sys=,,,,,,x +disk.sys=,,,,,,x +floppy.sys=,,,,,,x +i8042prt.sys=,,,,,,x +kbdclass.sys=,,,,,,x +blue.sys=,,,,,,x + [SourceFiles] ; = atapi.sys = 3 diff --git a/reactos/boot/freeldr/freeldr/reactos/setupldr.c b/reactos/boot/freeldr/freeldr/reactos/setupldr.c index 9396ebf4d70..243809e974e 100644 --- a/reactos/boot/freeldr/freeldr/reactos/setupldr.c +++ b/reactos/boot/freeldr/freeldr/reactos/setupldr.c @@ -448,28 +448,6 @@ for(;;); return; } -#if 0 - /* Load acpi.sys */ - if (!LoadDriver(SourcePath, "acpi.sys")) - return; -#endif - -#if 0 - /* Load isapnp.sys */ - if (!LoadDriver(SourcePath, "isapnp.sys")) - return; -#endif - -#if 0 - /* Load pci.sys */ - if (!LoadDriver(SourcePath, "pci.sys")) - return; -#endif - - /* Load scsiport.sys */ - if (!LoadDriver(SourcePath, "scsiport.sys")) - return; - /* Load atapi.sys (depends on hardware detection) */ if (!LoadDriver(SourcePath, "atapi.sys")) return; @@ -478,40 +456,30 @@ for(;;); if (!LoadDriver(SourcePath, "buslogic.sys")) return; - /* Load class2.sys */ - if (!LoadDriver(SourcePath, "class2.sys")) - return; - - /* Load cdrom.sys */ - if (!LoadDriver(SourcePath, "cdrom.sys")) - return; - - /* Load cdfs.sys */ - if (!LoadDriver(SourcePath, "cdfs.sys")) - return; - - /* Load disk.sys */ - if (!LoadDriver(SourcePath, "disk.sys")) - return; - - /* Load floppy.sys */ - if (!LoadDriver(SourcePath, "floppy.sys")) - return; - /* Load vfatfs.sys (could be loaded by the setup prog!) */ if (!LoadDriver(SourcePath, "vfatfs.sys")) return; - - /* Load keyboard driver */ - if (!LoadDriver(SourcePath, "i8042prt.sys")) - return; - if (!LoadDriver(SourcePath, "kbdclass.sys")) - return; - - /* Load screen driver */ - if (!LoadDriver(SourcePath, "blue.sys")) - return; + /* Load additional files specified in txtsetup.inf */ + if (InfFindFirstLine(InfHandle, + "SourceDiskFiles", + NULL, + &InfContext)) + { + do + { + LPCSTR Media, DriverName; + if (InfGetDataField(&InfContext, 7, &Media) && + InfGetDataField(&InfContext, 0, &DriverName)) + { + if (strcmp(Media, "x") == 0) + { + if (!LoadDriver(SourcePath, DriverName)) + return; + } + } + } while (InfFindNextLine(&InfContext, &InfContext)); + } #ifdef USE_UI UiUnInitialize("Booting ReactOS...");