Files

44 lines
1.4 KiB
Bash
Raw Permalink Normal View History

2023-06-20 10:56:40 +05:30
#!/usr/bin/bash
2024-10-20 15:53:52 -07:00
set -ex
2024-10-09 17:08:48 -07:00
KERNEL_VERSION=6.11.2-300.fc41
2024-04-06 20:45:11 -07:00
cd "$sourcedir"
koji download-build --quiet --arch=src "kernel-$KERNEL_VERSION"
2023-11-21 14:02:11 -08:00
rpmdev-extract -q "kernel-$KERNEL_VERSION.src.rpm"
mv -n "kernel-$KERNEL_VERSION.src"/* .
rm -r "kernel-$KERNEL_VERSION.src.rpm" "kernel-$KERNEL_VERSION.src"
2023-06-22 15:27:40 +05:30
# Set buildid to .t2
2023-11-21 14:02:11 -08:00
sed -i 's/# define buildid .local/%define buildid .t2/g' "kernel.spec"
2023-06-22 15:27:40 +05:30
# Bump release
2024-10-20 15:53:52 -07:00
sed -i 's/%define specrelease 200/%define specrelease 210/g' "kernel.spec"
2024-06-17 21:41:11 -07:00
# Disable debug kernels
sed -i "/%define with_debug /c %define with_debug 0" "kernel.spec"
2023-06-22 15:27:40 +05:30
2024-10-24 19:45:47 -07:00
# Disable debuginfo
sed -i "/%define with_debuginfo /c %define with_debuginfo 0" "kernel.spec"
2023-11-21 14:02:11 -08:00
# Add our patches
sed -i "/Patch1:/a Patch2: t2linux-combined.patch" "kernel.spec"
2023-12-01 23:53:58 -08:00
sed -i "/ApplyOptionalPatch patch-%{patchversion}-redhat.patch/a ApplyOptionalPatch t2linux-combined.patch" "kernel.spec"
2023-06-22 15:27:40 +05:30
2023-11-21 14:02:11 -08:00
cat "linux-t2-patches/extra_config" > "kernel-local"
2024-10-20 15:53:52 -07:00
function apply_kconfig {
kconfig="kernel-x86_64-fedora.config"
config_opt=$(echo "$1" | cut -d'=' -f1)
sed -i "/# $config_opt is not set/d" "$kconfig"
sed -i "/$config_opt=/d" "$kconfig"
echo "$1" >> "$kconfig"
}
apply_kconfig 'CONFIG_MODULE_FORCE_UNLOAD=y'
apply_kconfig 'CONFIG_CMDLINE="intel_iommu=on iommu=pt mem_sleep=s2idle pcie_ports=native"'
apply_kconfig 'CONFIG_CMDLINE_BOOL=y'
echo "# CONFIG_CMDLINE_OVERRIDE is not set" >> kernel-x86_64-fedora.config
2023-11-21 14:02:11 -08:00
cat "linux-t2-patches"/*.patch > "t2linux-combined.patch"