Skip to content
Permalink
Browse files

Tool to generate serial numbers in config.plist

  • Loading branch information...
linusyang committed Dec 7, 2018
1 parent 44143b2 commit 147203e4b0fdb2207077b85ee40b3a5d0efb6411
@@ -1,2 +1,7 @@
*.DS_Store
*.swp
EFI/CLOVER/config.plist*
*.o
tools/src/confgen.exe
tools/src/confgen
tools/src/confgen-linux
@@ -277,7 +277,7 @@
<key>Arguments</key>
<string>dart=0 nv_disable=1 bpr_probedelay=200 bpr_initialdelay=400 bpr_postresetdelay=400</string>
<key>DefaultVolume</key>
<string></string>
<string>MacintoshHD</string>
<key>Legacy</key>
<string>PBR</string>
<key>NeverHibernate</key>
@@ -542,48 +542,6 @@
<string>Part Component</string>
<key>Manufacturer</key>
<string>Apple Inc.</string>
<key>Memory</key>
<dict>
<key>Channels</key>
<integer>2</integer>
<key>Modules</key>
<array>
<dict>
<key>Frequency</key>
<integer>2400</integer>
<key>Part</key>
<string>M471A1K43BB1-CRC</string>
<key>Serial</key>
<string>0000000000000001</string>
<key>Size</key>
<integer>8192</integer>
<key>Slot</key>
<integer>1</integer>
<key>Type</key>
<string>DDR4</string>
<key>Vendor</key>
<string>Samsung</string>
</dict>
<dict>
<key>Frequency</key>
<integer>2400</integer>
<key>Part</key>
<string>CT8G4SFS824A.C8FBD</string>
<key>Serial</key>
<string>0000000000000002</string>
<key>Size</key>
<integer>8192</integer>
<key>Slot</key>
<integer>2</integer>
<key>Type</key>
<string>DDR4</string>
<key>Vendor</key>
<string>Crucial Technology</string>
</dict>
</array>
<key>SlotCount</key>
<integer>2</integer>
</dict>
<key>Mobile</key>
<true/>
<key>ProductName</key>
@@ -592,8 +550,6 @@
<string>C02ZZZZZHV29</string>
<key>SmUUID</key>
<string>C086C2BE-504A-4E56-88CC-FAC078470AC4</string>
<key>Trust</key>
<true/>
<key>Version</key>
<string>1.0</string>
</dict>
@@ -36,11 +36,9 @@ This repository contains a sample configuration to run macOS (Currently Mojave `

## Preparation

* (**Important**) Copy `EFI/CLOVER/config.example.plist` to `config.plist`. Edit SMBIOS entry in `config.plist` to work properly:
- `BoardSerialNumber`: Change any `Z` to random letters or numbers, or simply use [macserial][macserial]
- `Memory -> Modules`: Fill in the correct size for your RAM in `Size`, e.g. `4096` for 4GB, `8192` for 8GB
- `SerialNumber`: Change any `Z` to random letters or numbers, or simply use [macserial][macserial]
- `SmUUID`: Generate a unique UUID by `uuidgen` or simply using an [online service][uuid]
* (**Important**) You need to generate a proper `config.plist` with unique serial numbers:
- Run `./tools/gen.sh` (macOS) or "tools\gen.bat" (Windows) to generate `config.plist`.
- Add `-f` or `--force` flag to forcibly regenerating `config.plist` with new serial numbers.
* All SSDT hotpatches are located at `EFI/CLOVER/ACPI/dsl`. You can update the compiled `.aml` binaries by running `update.sh` (macOS) or `update.bat` (Windows).
* The `SSDT-KBD.aml` is tuned for `ApplePS2SmartTouchPad.kext`. If you want to switch to `VoodooPS2Controller.kext`, use `SSDT-KBD.aml` in `backup` folder instead.

BIN +314 KB tools/bin/confgen
Binary file not shown.
Binary file not shown.
BIN +299 KB tools/bin/confgen.exe
Binary file not shown.
@@ -0,0 +1,26 @@
@echo off
pushd %~dp0

set confgen=bin\confgen.exe
set target=..\EFI\CLOVER\config.plist
set example=..\EFI\CLOVER\config.example.plist
set force=false
set hasrun=false

if "%1"=="-f" set force=true
if "%1"=="--force" set force=true

if exist %target% (
if "%force%"=="false" (
%confgen% -t %example% -i %target% -o %target%
set hasrun=true
)
)
if "%hasrun%"=="false" (
if "%force%"=="true" (
echo Force overwriting config.plist.
)
%confgen% -t %example% -o %target%
)

pause
@@ -0,0 +1,25 @@
#!/bin/bash

cd "$(dirname "$0")"

TOP="$PWD"

confgen="$TOP/bin/confgen"
target="$TOP/../EFI/CLOVER/config.plist"
example="$TOP/../EFI/CLOVER/config.example.plist"
force=false

if [[ "$1" == "-f" ]] || [[ "$1" == "--force" ]]; then
force=true
fi

if [[ "$(uname)" == "Linux" ]]; then
confgen="$confgen-linux"
fi

if [ -f "$target" ] && [[ "$force" == "false" ]]; then
"$confgen" -t "$example" -i "$target" -o "$target"
else
$force && echo "Force overwriting config.plist."
"$confgen" -t "$example" -o "$target"
fi
@@ -0,0 +1,47 @@
CC = gcc
CXX = g++
CFLAGS = -O2 -g0 -Wall -Werror
CXXFLAGS =
MACOS = -mmacosx-version-min=10.9

PREFIX = i686-w64-mingw32
WIN_CC = $(PREFIX)-gcc
WIN_CXX = $(PREFIX)-g++

all: confgen confgen.exe

confgen: confgen.cxx.o macserial.c.o tinyxml2.cxx.o
$(CXX) $^ -s $(MACOS) -o $@ -framework IOKit -framework CoreFoundation

%.c.o: %.c
$(CC) $(CFLAGS) $(MACOS) -c $^ -o $@

%.cxx.o: %.cpp
$(CXX) $(CFLAGS) $(CXXFLAGS) $(MACOS) -c $^ -o $@

confgen-linux: confgen.linux.o macserial.linuxc.o arc4random.linuxc.o tinyxml2.linux.o
$(CXX) $^ -s -static -o $@

%.linuxc.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@

%.linux.o: %.cpp
$(CXX) $(CFLAGS) $(CXXFLAGS) -c $^ -o $@

confgen.exe: confgen.win.o macserial.winc.o arc4random.winc.o tinyxml2.win.o
$(WIN_CXX) $^ -s -o $@ -lole32 -static

%.winc.o: %.c
$(WIN_CC) $(CFLAGS) -c $^ -o $@

%.win.o: %.cpp
$(WIN_CXX) $(CFLAGS) $(CXXFLAGS) -c $^ -o $@

install: all
cp confgen confgen.exe ../bin/

clean:
rm -f *.o
rm -f confgen confgen.exe confgen-linux

.PHONY: clean all install
Oops, something went wrong.

0 comments on commit 147203e

Please sign in to comment.
You can’t perform that action at this time.