Chameleon

Chameleon Commit Details

Date:2018-10-14 20:45:22 (5 years 6 months ago)
Author:ErmaC
Commit:2919
Parents: 2918
Message:Recovery and Installer improvements (Credits to Micky1979)
Changes:
M/branches/ErmaC/Enoch/i386/boot2/options.c
M/trunk/i386/boot2/boot.h
M/trunk/i386/boot2/options.c
M/branches/ErmaC/Enoch/i386/boot2/boot.h

File differences

trunk/i386/boot2/boot.h
3030
3131
3232
33
3334
3435
3536
#include "libsaio.h"
// OS X Versions
#define MOJAVE checkOSVersion("10.14") // Mojave
#define HSIERRA checkOSVersion("10.13") // High Sierra
#define SIERRA checkOSVersion("10.12") // Sierra
#define ELCAPITAN checkOSVersion("10.11") // El Capitan
trunk/i386/boot2/options.c
3131
3232
3333
34
3435
3536
3637
......
13911392
13921393
13931394
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1395
1396
14551397
1456
1457
1458
1459
1460
1461
1462
1398
1399
14631400
1464
1465
1466
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
14671418
1468
1469
1470
1471
1419
1420
1421
1422
1423
14721424
14731425
14741426
#include "embedded.h"
#include "pci.h"
#include "modules.h"
#include "xml.h"
#if DEBUG
#define DBG(x...)printf(x)
addBootArg("kext-dev-mode=1");
}
// Micky1979 (Recovery HD)
if (gBootVolume->OSisRecovery)
{
const char*rval = 0;
config_file_t ocBplist;
char caBp[1024]; //too large ?. On El capitan is 365 bytes.. but we are testing
snprintf(caBp, sizeof(caBp), "/com.apple.recovery.boot/com.apple.Boot.plist");
loadConfigFile(caBp, &ocBplist);
rval = getStringForKey(kKernelFlagsKey, &ocBplist);
if (rval) {
addBootArg(rval);
}
}
// Micky1979 (Vanilla Installer)
if (gBootVolume->OSisInstaller)
{
const char*rval = 0;
config_file_t ocBplist;
char caBp[2048];
snprintf(caBp, sizeof(caBp), "/.IABootFiles/com.apple.Boot.plist");
loadConfigFile(caBp, &ocBplist);
rval = getStringForKey(kKernelFlagsKey, &ocBplist);
if (rval) {
addBootArg(rval);
}
}
// Micky1979 (old Vanilla upgrade)
if (gBootVolume->OSisMacOSXUpgrade)
{
const char*rval = 0;
config_file_t ocBplist;
char caBp[2048];
snprintf(caBp, sizeof(caBp), "/Mac OS X Install Data/com.apple.Boot.plist");
loadConfigFile(caBp, &ocBplist);
rval = getStringForKey(kKernelFlagsKey, &ocBplist);
if (rval) {
addBootArg(rval);
}
}
// Micky1979 (new Vanilla upgrade)
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");
if (!loadConfigFile(caBp, &ocBplist))
if (gBootVolume->OSisRecovery || gBootVolume->OSisInstaller || gBootVolume->OSisMacOSXUpgrade || gBootVolume->OSisOSXUpgrade) {
if (strlen(gBootVolume->comAppleBoot))
{
found = true;
}
if (!found) {
snprintf(caBp, sizeof(caBp), "/OS X Install Data/com.apple.Boot.plist");
if (!loadConfigFile(caBp, &ocBplist))
int fh = open(gBootVolume->comAppleBoot, 0);
if(fh >= 0)
{
found = true;
}
}
unsigned int plistSize = file_size(fh);
if (plistSize > 0)
{
char *plist = (char*) malloc(plistSize);
if (plistSize && read(fh, plist, plistSize) == plistSize)
{
TagPtr plistPtr, kf;
XMLParseFile(plist, &plistPtr);
kf = XMLGetProperty(plistPtr, kKernelFlagsKey);
if(kf != 0)
{
addBootArg(kf->string);
//printf("kf->string = %s\n", kf->string);
//printf("press any key to continue..\n");
//getchar();
}
}
if (found) {
rval = getStringForKey(kKernelFlagsKey, &ocBplist);
if (rval) {
addBootArg(rval);
if(plist)
{
free(plist);
}
}
}
}
}
branches/ErmaC/Enoch/i386/boot2/boot.h
3030
3131
3232
33
3334
3435
3536
#include "libsaio.h"
// OS X Versions
#define MOJAVE checkOSVersion("10.14") // Mojave
#define HSIERRA checkOSVersion("10.13") // High Sierra
#define SIERRA checkOSVersion("10.12") // Sierra
#define ELCAPITAN checkOSVersion("10.11") // El Capitan
branches/ErmaC/Enoch/i386/boot2/options.c
3131
3232
3333
34
3435
3536
3637
......
13911392
13921393
13931394
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1395
1396
14551397
1456
1457
1458
1459
1460
1461
1462
1398
1399
14631400
1464
1465
1466
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
14671418
1468
1469
1470
1471
1419
1420
1421
1422
1423
14721424
14731425
14741426
#include "embedded.h"
#include "pci.h"
#include "modules.h"
#include "xml.h"
#if DEBUG
#define DBG(x...)printf(x)
addBootArg("kext-dev-mode=1");
}
// Micky1979 (Recovery HD)
if (gBootVolume->OSisRecovery)
{
const char*rval = 0;
config_file_t ocBplist;
char caBp[1024]; //too large ?. On El capitan is 365 bytes.. but we are testing
snprintf(caBp, sizeof(caBp), "/com.apple.recovery.boot/com.apple.Boot.plist");
loadConfigFile(caBp, &ocBplist);
rval = getStringForKey(kKernelFlagsKey, &ocBplist);
if (rval) {
addBootArg(rval);
}
}
// Micky1979 (Vanilla Installer)
if (gBootVolume->OSisInstaller)
{
const char*rval = 0;
config_file_t ocBplist;
char caBp[2048];
snprintf(caBp, sizeof(caBp), "/.IABootFiles/com.apple.Boot.plist");
loadConfigFile(caBp, &ocBplist);
rval = getStringForKey(kKernelFlagsKey, &ocBplist);
if (rval) {
addBootArg(rval);
}
}
// Micky1979 (old Vanilla upgrade)
if (gBootVolume->OSisMacOSXUpgrade)
{
const char*rval = 0;
config_file_t ocBplist;
char caBp[2048];
snprintf(caBp, sizeof(caBp), "/Mac OS X Install Data/com.apple.Boot.plist");
loadConfigFile(caBp, &ocBplist);
rval = getStringForKey(kKernelFlagsKey, &ocBplist);
if (rval) {
addBootArg(rval);
}
}
// Micky1979 (new Vanilla upgrade)
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");
if (!loadConfigFile(caBp, &ocBplist))
if (gBootVolume->OSisRecovery || gBootVolume->OSisInstaller || gBootVolume->OSisMacOSXUpgrade || gBootVolume->OSisOSXUpgrade) {
if (strlen(gBootVolume->comAppleBoot))
{
found = true;
}
if (!found) {
snprintf(caBp, sizeof(caBp), "/OS X Install Data/com.apple.Boot.plist");
if (!loadConfigFile(caBp, &ocBplist))
int fh = open(gBootVolume->comAppleBoot, 0);
if(fh >= 0)
{
found = true;
}
}
unsigned int plistSize = file_size(fh);
if (plistSize > 0)
{
char *plist = (char*) malloc(plistSize);
if (plistSize && read(fh, plist, plistSize) == plistSize)
{
TagPtr plistPtr, kf;
XMLParseFile(plist, &plistPtr);
kf = XMLGetProperty(plistPtr, kKernelFlagsKey);
if(kf != 0)
{
addBootArg(kf->string);
//printf("kf->string = %s\n", kf->string);
//printf("press any key to continue..\n");
//getchar();
}
}
if (found) {
rval = getStringForKey(kKernelFlagsKey, &ocBplist);
if (rval) {
addBootArg(rval);
if(plist)
{
free(plist);
}
}
}
}
}

Archive Download the corresponding diff file

Revision: 2919