Index: branches/ErmaC/Enoch/i386/libsaio/disk.c =================================================================== --- branches/ErmaC/Enoch/i386/libsaio/disk.c (revision 2896) +++ branches/ErmaC/Enoch/i386/libsaio/disk.c (revision 2897) @@ -1712,6 +1712,7 @@ char *ECPattern = "Install%20OS%20X%20El%20Capitan"; char *SierraPattern = "Install%20macOS%20Sierra"; char *HSierraPattern = "Install%20macOS%20High%20Sierra"; + char *HSierraPatternB = "Install%20macOS%2010.13"; /* * Only look for OS Version on HFS+ @@ -1817,6 +1818,12 @@ fakeOSVersionInt = 13; valid = true; } + else if(strstr(val, HSierraPatternB)) + { + fakeOSVersion = "10.13"; + fakeOSVersionInt = 13; + valid = true; + } else { valid = false; @@ -1932,9 +1939,32 @@ strncpy( bvr->OSBuildVer, "UPGRADE", strlen("UPGRADE") ); return true; } - else + } + + if (!valid) + { + len = 0; val = 0; + /* + * Not valid? 10.13 and newer use "/macOS Install Data" folder.. + * and we have /macOS Install Data/Locked Files/Boot Files/SystemVersion.plist... thanks Apple! + * NOTE: the stage 2 of this installation is already bootable (aug 13 2017) + */ + snprintf(dirSpec, sizeof(dirSpec), + "hd(%d,%d)/macOS Install Data/Locked Files/Boot Files/SystemVersion.plist", + BIOS_DEV_UNIT(bvr), + bvr->part_no); + if (!loadConfigFile(dirSpec, &configFile)) { - valid = false; + if (getValueForKey(kProductVersion, &val, &len, &configFile)) + { + // Copy the complete value into OSFullVer + strncpy( bvr->OSFullVer, val, len ); + bvr->OSFullVer[len] = '\0'; /* null character manually added */ + + bvr->OSisOSXUpgrade = true; + strncpy( bvr->OSBuildVer, "UPGRADE", strlen("UPGRADE") ); + return true; + } } } Index: branches/ErmaC/Enoch/i386/boot2/drivers.c =================================================================== --- branches/ErmaC/Enoch/i386/boot2/drivers.c (revision 2896) +++ branches/ErmaC/Enoch/i386/boot2/drivers.c (revision 2897) @@ -1240,7 +1240,8 @@ required = XMLGetProperty(moduleDict, kPropOSBundleRequired); // if forceKextToLoad is true, the kext will be force to load even if OSBundleRequired has value set to "Safe Boot" instead of "Root" - if (!forceKextToLoad) { + if (!forceKextToLoad) + { if ( (required == 0) || (required->type != kTagTypeString) || !strncmp(required->string, "Safe Boot", sizeof("Safe Boot"))) { XMLFreeTag(moduleDict); Index: branches/ErmaC/Enoch/i386/boot2/boot.c =================================================================== --- branches/ErmaC/Enoch/i386/boot2/boot.c (revision 2896) +++ branches/ErmaC/Enoch/i386/boot2/boot.c (revision 2897) @@ -489,7 +489,20 @@ // for 10.10 and 10.11 if (isOSXUpgrade) { - snprintf(kernelCacheFile, sizeof(kernelCacheFile), "%sprelinkedkernel", "/OS X Install Data/"); + if ( MacOSVerCurrent >= MacOSVer2Int("10.13") ) + { + snprintf(kernelCacheFile, sizeof(kernelCacheFile), + "%sprelinkedkernel", + "/macOS Install Data/Locked Files/Boot Files/"); + } + else + { + snprintf(kernelCacheFile, + sizeof(kernelCacheFile), + "%sprelinkedkernel", + "/OS X Install Data/"); + } + } else if (isInstaller) { @@ -557,17 +570,25 @@ } else if (isOSXUpgrade) { - strncpy(kernelCachePath, "/OS X Install Data/prelinkedkernel", sizeof(kernelCachePath) ); + strncpy(kernelCachePath, + "/macOS Install Data/Locked Files/Boot Files/prelinkedkernel", + sizeof(kernelCachePath) ); ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); if ((ret == -1) || ((flags & kFileTypeMask) != kFileTypeFlat)) { - strncpy(kernelCachePath, "/OS X Install Data/kernelcache", sizeof(kernelCachePath) ); + strncpy(kernelCachePath, "/OS X Install Data/prelinkedkernel", sizeof(kernelCachePath) ); ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); - if ((flags & kFileTypeMask) != kFileTypeFlat) + if ((ret == -1) || ((flags & kFileTypeMask) != kFileTypeFlat)) { - ret = -1; + strncpy(kernelCachePath, "/OS X Install Data/kernelcache", sizeof(kernelCachePath) ); + ret = GetFileInfo(NULL, kernelCachePath, &flags, &cachetime); + + if ((flags & kFileTypeMask) != kFileTypeFlat) + { + ret = -1; + } } } } Index: branches/ErmaC/Enoch/i386/boot2/options.c =================================================================== --- branches/ErmaC/Enoch/i386/boot2/options.c (revision 2896) +++ branches/ErmaC/Enoch/i386/boot2/options.c (revision 2897) @@ -1401,7 +1401,10 @@ loadConfigFile(caBp, &ocBplist); rval = getStringForKey(kKernelFlagsKey, &ocBplist); - addBootArg(rval); + + if (rval) { + addBootArg(rval); + } } // Micky1979 (Vanilla Installer) @@ -1416,7 +1419,10 @@ loadConfigFile(caBp, &ocBplist); rval = getStringForKey(kKernelFlagsKey, &ocBplist); - addBootArg(rval); + + if (rval) { + addBootArg(rval); + } } // Micky1979 (old Vanilla upgrade) @@ -1430,21 +1436,41 @@ loadConfigFile(caBp, &ocBplist); rval = getStringForKey(kKernelFlagsKey, &ocBplist); - addBootArg(rval); + + if (rval) { + addBootArg(rval); + } } // Micky1979 (new Vanilla upgrade) - if (gBootVolume->OSisMacOSXUpgrade) + if (gBootVolume->OSisOSXUpgrade) { const char *rval = 0; config_file_t ocBplist; char caBp[2048]; + bool found = false; + snprintf(caBp, sizeof(caBp), "/macOS Install Data/Locked Files/Boot Files/com.apple.Boot.plist"); - snprintf(caBp, sizeof(caBp), "/OS X Install Data/com.apple.Boot.plist"); + if (!loadConfigFile(caBp, &ocBplist)) + { + found = true; + } - loadConfigFile(caBp, &ocBplist); - rval = getStringForKey(kKernelFlagsKey, &ocBplist); - addBootArg(rval); + if (!found) { + snprintf(caBp, sizeof(caBp), "/OS X Install Data/com.apple.Boot.plist"); + + if (!loadConfigFile(caBp, &ocBplist)) + { + found = true; + } + } + + if (found) { + rval = getStringForKey(kKernelFlagsKey, &ocBplist); + if (rval) { + addBootArg(rval); + } + } } cntRemaining = BOOT_STRING_LEN - 2; // save 1 for NULL, 1 for space