Skip to content

Commit 2cffe57

Browse files
kernel: Apply config options to x86_64 only
Config options set by upstream are removed if they are going to be overwritten by downstream options.
1 parent 4b3917b commit 2cffe57

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

kernel/kernel.sh

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

44
KERNEL_VERSION=6.11.2-300.fc41
55

@@ -13,7 +13,7 @@ rm -r "kernel-$KERNEL_VERSION.src.rpm" "kernel-$KERNEL_VERSION.src"
1313
sed -i 's/# define buildid .local/%define buildid .t2/g' "kernel.spec"
1414

1515
# Bump release
16-
# sed -i 's/%define specrelease 200/%define specrelease 202/g' "kernel.spec"
16+
sed -i 's/%define specrelease 200/%define specrelease 210/g' "kernel.spec"
1717

1818
# Disable debug kernels
1919
sed -i "/%define with_debug /c %define with_debug 0" "kernel.spec"
@@ -26,12 +26,18 @@ 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_MODULE_FORCE_UNLOAD=y
31-
EOF
32-
cat << EOF | tee -a "kernel-x86_64-*.config" > /dev/null
33-
CONFIG_CMDLINE="intel_iommu=on iommu=pt mem_sleep=s2idle pcie_ports=native"
34-
CONFIG_CMDLINE_BOOL=y
35-
CONFIG_CMDLINE_OVERRIDE=n
36-
EOF
29+
30+
function apply_kconfig {
31+
kconfig="kernel-x86_64-fedora.config"
32+
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"
36+
}
37+
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
42+
3743
cat "linux-t2-patches"/*.patch > "t2linux-combined.patch"

0 commit comments

Comments
 (0)