Skip to content

Commit faf0b83

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 faf0b83

File tree

53 files changed

+59689
-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

+59689
-0
lines changed

config/sources/families/uefi-x86.conf

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

0 commit comments

Comments
 (0)