+ trycache = (0 == (gBootMode & kBootModeSafe))
+ && (gBootKernelCacheFile[0] != 0);
+
+ if (trycache && (gBootFileType == kBlockDeviceType)) do {
+
+ // if we haven't found the kernel yet, don't use the cache
+ ret = GetFileInfo(NULL, gBootFile, &flags, &time);
+ if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)) {
+ trycache = 0;
+ break;
+ }
+ ret = GetFileInfo(NULL, gBootKernelCacheFile, &flags, &cachetime);
+ if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)
+ || (cachetime < time)) {
+ trycache = 0;
+ break;
+ }
+ ret = GetFileInfo(gExtensionsSpec, "Extensions", &flags, &time);
+ if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)
+ && (cachetime < time)) {
+ trycache = 0;
+ break;
+ }
+ } while (0);
+
+ if (trycache) {
+ ret = LoadFile(gBootKernelCacheFile);
+ if (ret != -1) {
+ ret = DecodeKernel();
+ if (ret != -1) break;
+ }
+ }