Chameleon

Chameleon Commit Details

Date:2010-08-10 07:57:44 (9 years 2 months ago)
Author:Azimutz
Commit:342
Parents: 341
Message:As you can see, there is a catch... a good one, i think! I did tried to keep /Extra path, though my real intention was to remove it, in favor of loading files only from booter volume and OS specific folders, providing we could keep the same functionality. That turned out to be true and as /Extra path kept giving me troubles, i removed it. Pros: simpler code that can be easily added any were needed (as mentioned on search_and_get_acpi_fd). Cons: none that i couldn't solve so far :) Just a note on ramdisks: when a rd is aliased as bt(0,0), all paths started by bt(0,0) (booter volume) will point to the rd and not to the volume were the booter is installed; meaning that, with this algo that only uses bt(0,0) paths, when using a rd aliased as bt, the rd will be the only volume searched!! This makes rd's aliased as bt, ideal to load full sets of files, like when using pre-boot discs, were the files need to be all loaded from the ramdisk into memory.
Changes:
M/branches/azimutz/CleanCut/i386/boot2/drivers.c

File differences

branches/azimutz/CleanCut/i386/boot2/drivers.c
198198
199199
200200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
201
202
203
220204
205
206
207
208
209
210
211
212
213
214
215
216
221217
222218
223219
224
220
225221
226222
227223
fd = FileLoadDrivers(dirSpecExtra, 0);
if (fd >= 0) goto success_fd;
// Next try to load Extra extensions from the selected root partition.
strcpy(dirSpecExtra, "/Extra/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
// If failed, then try to load Extra extensions from the boot partition
// in case we have a separate booter partition or a bt(0,0) aliased ramdisk.
if ( !(gBIOSBootVolume->biosdev == gBootVolume->biosdev && gBIOSBootVolume->part_no == gBootVolume->part_no)
|| (gRAMDiskVolume && gRAMDiskBTAliased) )
{
// Next try a specfic OS version folder ie 10.5
sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion);
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
// Next we'll try the base
strcpy(dirSpecExtra, "bt(0,0)/Extra/");
FileLoadDrivers(dirSpecExtra, 0);
}
}
}
// No need to specify (gRAMDiskVolume && gRAMDiskBTAliased); checking paths on a
// ramdisk aliased as bt(0,0) (rdbt), is the same as checking paths on booter volume.
// In this case the following two apply.
// Check booter volume/rdbt Extra for specific OS files, on specific OS folders.
sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion);
fd = FileLoadDrivers(dirSpecExtra, 0);
if (fd >= 0) goto success_fd;
// Removed /Extra path from search algo. If needed can be specified with override key!
// Check booter volume/rdbt Extra in case we don't keep specific OS folders.
strcpy(dirSpecExtra, "bt(0,0)/Extra/");
fd = FileLoadDrivers(dirSpecExtra, 0);
if (fd >= 0) goto success_fd;
// Also try to load Extensions from boot helper partitions.
if (gBootVolume->flags & kBVFlagBooter)
{
strcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/");
strcpy(dirSpecExtra, "/com.apple.boot.P/System/Library/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
strcpy(dirSpecExtra, "/com.apple.boot.R/System/Library/");

Archive Download the corresponding diff file

Revision: 342