Skip to content

Commit 3182054

Browse files
committed
uefi: x86: current (6.12) and edge (6.18): add Apple T2 patches
- from linux-t2 project: https://github.com/t2linux/linux-t2-patches - https://t2linux.org/ - x86: add .config hook `custom_kernel_config__applet2()` - original patches from t2linux for 6.18 and 6.12 - rewrite patches against v6.18-rc4 and v6.12.57 - `7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch` needed special attention for correct patch attribution (missing From) - `1002-Put-apple-bce-in-drivers-staging` needs reordering to the top to avoid conflicts with EXTRAWIFI sed-based "patching"
1 parent 7339b7e commit 3182054

File tree

53 files changed

+59690
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+59690
-0
lines changed

config/sources/families/uefi-x86.conf

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,59 @@ declare -g LINUXFAMILY="x86"
1212
declare -g ARCH="amd64"
1313
# shellcheck source=config/sources/families/include/uefi_common.inc
1414
source "${BASH_SOURCE%/*}/include/uefi_common.inc"
15+
16+
# Extra branch "applet2" for uefi-x86 (Apple T2-based machines, all Intel)
17+
case "${BRANCH}" in
18+
19+
current | edge)
20+
display_alert "Configuring for Apple T2-based machines" "x86: BRANCH=${BRANCH}" "info"
21+
22+
# Extra .config stuff for the Applet T2 stuff in this kernel
23+
function custom_kernel_config__applet2() {
24+
# From https://github.com/t2linux/linux-t2-patches/blob/6.18/extra_config ignore DRM_KUNIT_TEST & APFS_FS
25+
opts_y+=(
26+
BT_HCIUART_BCM
27+
STAGING
28+
)
29+
opts_m+=(
30+
APPLE_BCE
31+
APPLE_GMUX
32+
BRCMFMAC
33+
BT_BCM
34+
BT_HCIBCM4377
35+
BT_HCIUART
36+
HID_APPLETB_BL
37+
HID_APPLETB_KBD
38+
HID_APPLE
39+
HID_MAGICMOUSE
40+
DRM_APPLETBDRM
41+
HID_SENSOR_ALS
42+
SENSORS_APPLESMC
43+
SND_PCM
44+
APFS_FS
45+
)
46+
}
47+
48+
# Auto-grab patches from t2linux github if not already present
49+
if [[ ! -d "${SRC}/patch/kernel/${KERNELPATCHDIR}" ]]; then
50+
# Grab from github .tar.gz and extract there; patches are in the root of the archive
51+
GH_URL="https://github.com/t2linux/linux-t2-patches/archive/refs/heads/${KERNEL_MAJOR_MINOR}.tar.gz"
52+
display_alert "Fetching Apple T2 patches from" "GH_URL=${GH_URL}" "info"
53+
mkdir -pv "${SRC}/patch/kernel/${KERNELPATCHDIR}"
54+
curl -L "${GH_URL}" | tar -xz --strip-components=1 -C "${SRC}/patch/kernel/${KERNELPATCHDIR}"
55+
tree "${SRC}/patch/kernel/${KERNELPATCHDIR}"
56+
# remove any non-patch files and directories
57+
# remove .github and .gitignore
58+
rm -rf "${SRC}/patch/kernel/${KERNELPATCHDIR}/.github" "${SRC}/patch/kernel/${KERNELPATCHDIR}/.gitignore"
59+
find "${SRC}/patch/kernel/${KERNELPATCHDIR}" -type f ! -name "*.patch" -delete
60+
display_alert "Apple T2 patches downloaded to" "DIR=${SRC}/patch/kernel/${KERNELPATCHDIR}; go run rewrite-kernel-patches" "info"
61+
exit 0
62+
else
63+
display_alert "Apple T2 patches already present in" "DIR=${SRC}/patch/kernel/${KERNELPATCHDIR}" "info"
64+
fi
65+
66+
;;
67+
68+
esac
69+
1570
enable_extension "grub"

0 commit comments

Comments
 (0)