Skip to content

Commit 25b4658

Browse files
kernel: Add missing Kconfig
1 parent 125ac40 commit 25b4658

1 file changed

Lines changed: 35 additions & 10 deletions

File tree

kernel/kernel.sh

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/bash
2-
set -ex
2+
set -e
33

44
KERNEL_VERSION=6.13.7-200.fc41
55

@@ -26,19 +26,44 @@ sed -i "/Patch1:/a Patch2: t2linux-combined.patch" "kernel.spec"
2626
sed -i "/ApplyOptionalPatch patch-%{patchversion}-redhat.patch/a ApplyOptionalPatch t2linux-combined.patch" "kernel.spec"
2727

2828
cat "linux-t2-patches/extra_config" > "kernel-local"
29+
cat << 'EOF' > "kernel-local"
30+
CONFIG_SPI_HID_APPLE_OF=y
31+
CONFIG_HID_DOCKCHANNEL=y
32+
CONFIG_APPLE_DOCKCHANNEL=y
33+
CONFIG_APPLE_RTKIT_HELPER=m
34+
CONFIG_DRM_APPLETBDRM=y
35+
CONFIG_HID_APPLETB_BL=y
36+
CONFIG_HID_APPLETB_KBD=y
37+
CONFIG_APFS_FS=y
38+
CONFIG_INPUT_SPARSEKMAP=y
39+
EOF
2940

30-
function apply_kconfig {
31-
kconfig="kernel-x86_64-fedora.config"
41+
function write_kconfig_to_file {
3242
config_opt=$(echo "$1" | cut -d'=' -f1)
33-
sed -i "/# $config_opt is not set/d" "$kconfig"
34-
sed -i "/$config_opt=/d" "$kconfig"
35-
echo "$1" >> "$kconfig"
43+
if [[ "$config_opt" =~ '# '(.+)' is not set' ]]; then
44+
config_opt="${BASH_REMATCH[1]}"
45+
fi
46+
sed -i "/# $config_opt is not set/d" "$2"
47+
sed -i "/$config_opt=/d" "$2"
48+
echo "$1" >> "$2"
3649
}
3750

38-
apply_kconfig 'CONFIG_MODULE_FORCE_UNLOAD=y'
39-
apply_kconfig 'CONFIG_CMDLINE="intel_iommu=on iommu=pt mem_sleep=s2idle pcie_ports=native"'
40-
apply_kconfig 'CONFIG_CMDLINE_BOOL=y'
41-
echo "# CONFIG_CMDLINE_OVERRIDE is not set" >> kernel-x86_64-fedora.config
51+
function set_kconfig_x86_64 {
52+
for file in \
53+
"kernel-x86_64-fedora.config" \
54+
"kernel-x86_64-rt-debug-fedora.config" \
55+
"kernel-x86_64-rt-fedora.config" \
56+
"kernel-x86_64-debug-fedora.config"
57+
do
58+
write_kconfig_to_file "$1" "$file"
59+
done
60+
}
61+
62+
set_kconfig_x86_64 'CONFIG_APPLE_BCE=m'
63+
set_kconfig_x86_64 'CONFIG_MODULE_FORCE_UNLOAD=y'
64+
set_kconfig_x86_64 'CONFIG_CMDLINE="intel_iommu=on iommu=pt mem_sleep=s2idle pcie_ports=native"'
65+
set_kconfig_x86_64 'CONFIG_CMDLINE_BOOL=y'
66+
set_kconfig_x86_64 '# CONFIG_CMDLINE_OVERRIDE is not set'
4267

4368
git apply --directory="linux-t2-patches" "./fix-context-4001-asahi-trackpad.patch"
4469
cat "linux-t2-patches"/*.patch > "t2linux-combined.patch"

0 commit comments

Comments
 (0)