From 8f66d7bde31d15a63e9959f1d374f32d6bc9371c Mon Sep 17 00:00:00 2001 From: blacktop Date: Wed, 1 May 2024 17:26:43 -0600 Subject: [PATCH] feat: add 12.5 support credit: @fruitybagel --- README.md | 3 ++- build.sh | 10 ++++++++-- patches/iobuffermemd_monterey.patch | 13 +++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 patches/iobuffermemd_monterey.patch diff --git a/README.md b/README.md index d0a9fbd..b141528 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ | Version | Compiles | CodeQL | Boots *(arm64/x86_64)* | | ---------- | :------: | :---------------------------------------------------------------------------------------: | :--------------------: | +| macOS 12.5 | ✅ | ❔ | ❔ / ✅ | | macOS 13.0 | ✅ | [DB](https://github.com/blacktop/darwin-xnu-build/releases/download/v13.0/xnu-codeql.zip) | ❔ / ❔ | | macOS 13.1 | ✅ | [DB](https://github.com/blacktop/darwin-xnu-build/releases/download/v13.1/xnu-codeql.zip) | ❔ / ❔ | | macOS 13.2 | ✅ | [DB](https://github.com/blacktop/darwin-xnu-build/releases/download/v13.2/xnu-codeql.zip) | ❔ / ❔ | @@ -24,7 +25,7 @@ | macOS 14.1 | ✅ | [DB](https://github.com/blacktop/darwin-xnu-build/releases/download/v14.1/xnu-codeql.zip) | ❔ / ❔ | | macOS 14.2 | ✅ | [DB](https://github.com/blacktop/darwin-xnu-build/releases/download/v14.2/xnu-codeql.zip) | ❔ / ❔ | | macOS 14.3 | ✅ | [DB](https://github.com/blacktop/darwin-xnu-build/releases/download/v14.3/xnu-codeql.zip) | ✅ / ✅ | -| macOS 14.4 | ✅ | ❌ | ✅ / ✅ | +| macOS 14.4 | ✅ | [DB](https://github.com/blacktop/darwin-xnu-build/releases/download/v14.4/xnu-codeql.zip) | ✅ / ✅ | > [!NOTE] > CodeQL DBs built with `MACHINE_CONFIG=VMAPPLE` diff --git a/build.sh b/build.sh index a774db4..3429f79 100755 --- a/build.sh +++ b/build.sh @@ -132,10 +132,16 @@ install_ipsw() { choose_xnu() { if [ -z "$MACOS_VERSION" ]; then gum style --border normal --margin "1" --padding "1 2" --border-foreground 212 "Choose $(gum style --foreground 212 'macOS') version to build:" - MACOS_VERSION=$(gum choose "13.0" "13.1" "13.2" "13.3" "13.4" "13.5" "14.0" "14.1" "14.2" "14.3" "14.4") + MACOS_VERSION=$(gum choose "12.5" "13.0" "13.1" "13.2" "13.3" "13.4" "13.5" "14.0" "14.1" "14.2" "14.3" "14.4") fi TIGHTBEAMC="tightbeamc-not-supported" case ${MACOS_VERSION} in + '12.5') + RELEASE_URL='https://raw.githubusercontent.com/apple-oss-distributions/distribution-macOS/macos-125/release.json' + KDK_NAME='Kernel Debug Kit 12.5 build 21G72' + KDKROOT='/Library/Developer/KDKs/KDK_12.5_21G72.kdk' + RC_DARWIN_KERNEL_VERSION='22.6.0' + ;; '13.0') RELEASE_URL='https://raw.githubusercontent.com/apple-oss-distributions/distribution-macOS/macos-130/release.json' KDK_NAME='Kernel Debug Kit 13.0 build 22A380' @@ -261,7 +267,7 @@ patches() { if [ "$CODEQL" -eq "0" ]; then PATCH_DIR="" case ${MACOS_VERSION} in - '13.0' | '13.1' | '13.2' | '13.3' | '13.4' | '13.5' | '14.0' | '14.1' | '14.2' | '14.3') + '12.5' | '13.0' | '13.1' | '13.2' | '13.3' | '13.4' | '13.5' | '14.0' | '14.1' | '14.2' | '14.3') PATCH_DIR="${WORK_DIR}/patches" ;; '14.4') diff --git a/patches/iobuffermemd_monterey.patch b/patches/iobuffermemd_monterey.patch new file mode 100644 index 0000000..eb8b5ad --- /dev/null +++ b/patches/iobuffermemd_monterey.patch @@ -0,0 +1,13 @@ +diff --git a/iokit/Kernel/IOBufferMemoryDescriptor.cpp b/iokit/Kernel/IOBufferMemoryDescriptor.cpp +index f0d246a7..f1d35835 100644 +--- a/iokit/Kernel/IOBufferMemoryDescriptor.cpp ++++ b/iokit/Kernel/IOBufferMemoryDescriptor.cpp +@@ -332,7 +332,7 @@ IOBufferMemoryDescriptor::initWithPhysicalMask( + KMA_GUARD_LAST | KMA_ZERO); + + if (((uint32_t) alignment) != alignment) { +- return NULL; ++ return false; + } + if (kheap == KHEAP_DATA_BUFFERS) { + kma_flags = (kma_flags_t) (kma_flags | KMA_DATA);